-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Guidance feature for Collision Prevention #12917
Conversation
5288c12
to
ece5a0e
Compare
@baumanta Let me know if this needs any docs - when you're ready to submit. |
@mhkabir it is a bit of a long story related to overlapping long and short range sensors. The correction for pitch was quite minimal, so I don't think that will impair the breaking maneuver. But doing the adaption had some negative effects on recognizing valid sensor data. E.g. if the sensor registers no obstacle, it sends a value just above the sensor range. Then we know, we should limit flight speed, such we can break at that distance, but we do not actually have any sensor data. If that sensor overlaps with a longer range sensor, we will want to use the data of that one, because the other value is not actually valid. If we now do the pitch adaption and the value gets smaller to the point that is is inside sensor range, we cannot know anymore whether it is an actual obstacle reading or not. We could solve that by using another array stating whether data is valid or not, but I don't think it is worth the effort. The light green bin which is constantly around 7.9 is the distance sensor, the other bins are filled with camera data. You can see that distance sensor bin goes inside range (which was 7.9m) all the time due to pitch correction even though the raw signal is constantly at 7.9m (no obstacle). If we receive a valid signal (inside range) from a short range sensor, this has priority over the long range sensor. So we were constantly limiting the flight speed to be able to break in 7.9m even though we did not need to. |
How about we perform the pitch correction in the distance sensor callback, and only if the sensor is within range? When testing in simulation, I had found that the pitch correction helped greatly when accelerating (pitch down) towards obstacles. |
@mhkabir with otherwise, I might be able to put it back in with an if statement as well, such that we just leave the data at max range without correction and only perform the step for close data |
This has been tested extensively and flies quite nice. here a link to some of the flight logs: |
EXPECT_FLOAT_EQ(modified_setpoint.norm(), 0.f); | ||
if (setpoint_length > 0.f) { | ||
matrix::Vector2f setpoint_dir = modified_setpoint / setpoint_length; | ||
float sp_angle_body_frame = atan2(setpoint_dir(1), setpoint_dir(0)); |
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.
float sp_angle_body_frame = atan2(setpoint_dir(1), setpoint_dir(0)); | |
float sp_angle_body_frame = atan2f(setpoint_dir(1), setpoint_dir(0)); |
Replaced by #13017 due to branch permissions |
Add guidance feature to the collision prevention library. Enable the algorithm to slightly change the setpoint direction to help navigate in cluttered environments and fly through narrow gaps.
SITL and flight tested