-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angle unit conversion #79
Comments
Hi there brusangel, The sweep does not use a standard "encoder". The plastics of the device itself provide the ticks. It's a bit more complex than just a simple formula for "counter-ticks" to degrees, as the sensor performs calibration routines to adapt to inconsistencies in the physical ticks and properly interpolate angles between ticks depending on various settings. Realistically you should never have to concern yourself with the method of encoding, as the sensor communicates sensor readings with an azimuth value in degrees. See the section titled The Sweeppy and Sweepjs also return the value in millidegrees. |
Closing this now. Feel free to comment here if you'd like to reopen the issue. |
thank you very much for your answer, I'm working with Python (sweeppy), so far I have a very simple code to extract lidar information into an standard array:
the above code yields an output in the following style: the first field as you may recognize is the positioning data, followed by distance and rss. I've searched for the wrapper for the C function you mentioned which can be the appropriate way to use the function in python? thanks! |
The The returned samples that you posted are a collection of sensor readings. Each is comprised of 3 values (angle, distance and signal strength). The angle is presented in millidegrees. For example, the first reading you posted |
@brusangel here is the lib's interface. All the response object's are If you are looking for a transformation to Cartesian coordinates, the real time viewer does something similar to: for sample in scan.samples:
distance = min(sample.distance, k_max_laser_distance_m)
angle = math.radians(sample.angle / 1000.)
x = math.cos(angle) * distance
y = math.sin(angle) * distance
x = x + k_max_laser_distance_m
y = y + k_max_laser_distance_m Maybe we should just expose these helpers to users => #15 |
@dcyoung , @daniel-j-h guys! thanks for your help totally get it! I've just got more question (please excuse my lack of knowledge), this |
This is used in the real time viewer to zoom into a couple of meters - you don't want to show the full 40 m range to the user, when the typical use-case is scanning a room. |
from sweep datasheet:
could we get provided with a formula to convert from the encoder "counter-ticks" to degrees?
or at least the encoder model, so that we can see the manufacturer information (ticks per degree or so).
kind regards!
The text was updated successfully, but these errors were encountered: