-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
AC_Avoid: Added new OA type (Dijkstra + BendyRuler fusion) #14934
Conversation
very exciting to see this |
8da42a9
to
5cd2e34
Compare
5cd2e34
to
99132c5
Compare
This PR has been rebased to work with the new BendyRuler type (Vertical Avoidance) |
@@ -649,6 +655,9 @@ bool AP_OABendyRuler::calc_margin_from_object_database(const Location &start, co | |||
if (!start.get_vector_from_origin_NEU(start_NEU) || !end.get_vector_from_origin_NEU(end_NEU)) { | |||
return false; | |||
} | |||
if (start_NEU == end_NEU) { |
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 have inlcluded this bit as an extra safety check. I found this as a potential bug. Its not really needed in this PR.
What happens is, if the two points are the same, Vector3f::closest_distance_between_line_and_point
returns 0
therefore the line
Vector3f::closest_distance_between_line_and_point(start_NEU, end_NEU, point_cm) * 0.01f - item.radius;
would falsely return a negative margin.. Something that can be scary mid flight..
I must also add that this new feature, when in use with Vertical BendyRuler can get potentially dangerous if obstacle + fence approach together.. Vertical BendyRuler does not have the capabilities to dodge any fence except alt fence. It only exists to climb over proximity objects . So incase a user enables Vertical BendyRuler, and an obstacle were to force the vehicle go near a polygon fence.. Copter would start climbing till Fence alt is near and be stuck there. |
@@ -136,6 +145,12 @@ bool AP_OAPathPlanner::pre_arm_check(char *failure_msg, uint8_t failure_msg_len) | |||
return false; | |||
} | |||
break; | |||
case OA_PATHPLAN_DJIKSTRA_BENDYRULER: | |||
if(_oadijkstra == nullptr || _oabendyruler == nullptr) { |
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.
tiny thing but we should have a space after the "if".
Merged, thanks!! |
This PR creates a new OA Type which attempts to fuse Dijkstra and BendyRuler to be used together.
The basic idea is:
Testing:
This has been tested on Morse + SITL with fence's and obstacle in between a guided mission
https://www.youtube.com/watch?v=s0z0b2U2fAk