-
Notifications
You must be signed in to change notification settings - Fork 18k
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_Proximity: get_status() returns first good sensor status #25913
Conversation
1d31f98
to
956b517
Compare
How about removing the check of proximity sensor status from AC_Avoid and just rely on the _proximity.get_obstacle_count() working correctly? As long as get_obstacle_count() properly handles a proximity sensor failing and does not return stale values then it should be sufficient. If it does keep returning stale values then we still have a problem even after this PR's fix. |
956b517
to
da59fbc
Compare
Thanks, Randy. I have implemented what you have have asked in your comment and verified in SITL that it works as expected. |
da59fbc
to
4f258b1
Compare
AP_Proximity::Status AP_Proximity::get_status() const | ||
{ | ||
Status sensors_status = Status::NotConnected; |
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.
We don't really need this out here; could have a constant return value and a more-local variable introduced for get_instance_status
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.
I kept it that way because the status could be "not connected" or "no data".. I would like the sensor to return the value that is true for a sensor, rather than an arbitrary constant
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.
After the get_obstacle_count and get_object_count are removed we can merge, thanks!
4f258b1
to
e65c4c3
Compare
Thanks, added the MergeOnCIPass... |
Currently, if multiple proximity sensors are configured and any one stops working, avoidance stops working. This can be dangerous as we still have some good sensors that might be available.
This will fix the issue.