-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
LD06: Record only 2deg slices #27045
Conversation
mw46d
commented
May 12, 2024
- Some recording changes were taken from the RPLidar driver code.
- Using the average of the 12 readings/package is not a good idea. Those packages don't describe the same 'angle' for each rotation. So you end up with a lot of different distances per package. I tried to fix things to well-defined 2deg slices and take the minimum reading reported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this improves the driver out-of-sight - thanks for this!
I've just tested this on an LD06 locally, and it makes the driver actually usable!
I've taken the liberty of adjusting a few patches in here to conform to our style guidelines, and adjusted the message on your commit to also conform to our requirements.
I've also adjusted the handling of a bad size received to avoid the nasty buffer overflow, rebasing on a previous PR of mine.
Thanks!
@lvale you said you had some of these. I've no idea how they're at all useful for you before this PR :-)
incorrect distances+angles being returned
the length field is actually the count of 3-byte data elements
I've created a simulator for this device now. And corrected the sanity check again. |
const float degrees_per_ms = degrees_per_s / 1000.0f; | ||
const float degrees_per_sample = degrees_per_ms / samples_per_ms; | ||
|
||
// ::fprintf(stderr, "Packing %u samples in for %ums interval (%f degrees/sample)\n", sample_count, time_delta_ms, degrees_per_sample); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's get rid of this debug
@Adithya-Patil, are you OK with this? Any comments on the orientation? The wiki docs say the wire should be facing backwards |
That's how my sensor is oriented as well;-) |
Hi @mw46d, Ah, so you've got one of these sensors? Do you find that it doesn't actually work with the code in 4.5, 4.6 and/or master? |
That's why I started that PR;-) Some time ago |