Skip to content
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

Merged
merged 6 commits into from
Jan 9, 2025
Merged

LD06: Record only 2deg slices #27045

merged 6 commits into from
Jan 9, 2025

Conversation

mw46d
Copy link
Contributor

@mw46d 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.

Copy link
Contributor

@peterbarker peterbarker left a 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 :-)

@peterbarker
Copy link
Contributor

I've created a simulator for this device now. And corrected the sanity check again.

@CraigElder CraigElder changed the title LD06: Record only 2deg slices, I was running into drouble on my Pixhawk LD06: Record only 2deg slices Dec 23, 2024
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);
Copy link
Contributor

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

@rmackay9
Copy link
Contributor

@Adithya-Patil, are you OK with this? Any comments on the orientation? The wiki docs say the wire should be facing backwards

@mw46d
Copy link
Contributor Author

mw46d commented Dec 23, 2024

@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;-)

@rmackay9
Copy link
Contributor

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?

@mw46d
Copy link
Contributor Author

mw46d commented Dec 23, 2024

That's why I started that PR;-) Some time ago

@peterbarker peterbarker merged commit 6efe210 into ArduPilot:master Jan 9, 2025
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Pending
Development

Successfully merging this pull request may close these issues.

4 participants