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

AP_RangeFinder: TeraRanger a to close reading is not the minimum distance #13376

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

WickedShell
Copy link
Contributor

This is a bit of a drive by change, but as far as I can tell using the minimum distance here is unsafe. The problem with copying the minimum distance in, is that if we are to close to get a reading we could be any distance less then the minimum distance. However the logic for determing if a rangefinder is good or not only considers the driver to be out of range low, if the distance is less then the minimum distance. Logic can be seen here.

This could be combined with the following case, I kept them separate just to ensure that the meanings are preserved, and to make it easier to directly flag something like OutOfRangeLow in the future.

I don't actually have one of these units, so I can't test (or even verify) if this is a real problem (and solution). Does anyone have the hardware to actually do the test?

@tridge tridge merged commit 7bc1f4f into ArduPilot:master Jan 28, 2020
@rmackay9
Copy link
Contributor

rmackay9 commented Feb 6, 2021

The problem with this solution is that the lidar will show "unhealthy" instead of "out-of-range-low". Instead I think we should probably return 0 as the distance so its state becomes "out-of-range-low". A similar argument is also true for when the distance is too long.

Certainly this PR is an improvement over the previous logic which was dangerous though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants