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

Fix obstacle distance #1700

Merged
merged 2 commits into from
Feb 7, 2022
Merged

Conversation

oroelipas
Copy link

Hi!

This PR contains two bugfix in the /mavros_extras/src/plugins/obstacle_distance.cpp file.

The first one corrects the way the reduction of size of the LaserScan is done.
The code should redux the resolution of the array to adjust to the mavlink OBSTACLE_DISTANCE message (72 values) taking the minimum value as aggregation function of the interpolation.

The scale_factor was taken as integer, so the interpolation worked wrong.

This image shows the error and the fix:

interpolarion bugfix explained

The second bugfix assigns a value to increment_f in case the size of the input LaserScan is bigger than the mavlink OBSTACLE_DISTANCE message.
This was missing, so ardupilot was usgin the value of increment (and NOT increment_f), showing wrong objects.

Copy link
Member

@vooon vooon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

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

3 participants