-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Copter: support DO_RETURN_PATH_START
in AUTO RTL mode
#26383
Conversation
a05a18a
to
55ec38e
Compare
Not expecting this to be merged, but looking for approval of the concept so we can get the MAVLink PR (mavlink/mavlink#2088) merged. I did a longer explanation of why this might be needed there: mavlink/mavlink#2088 (comment) |
I'm really looking forward to this feature! |
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 like this, support it being merged, doesn't solve all the complex use cases, but helps many
... todo add a plane impl. :-) |
This looks very cool. tridge liked it too. |
DO_LAND_REJOIN
in AUTO RTL modeDO_RETURN_PATH_START
in AUTO RTL mode
@@ -2374,14 +2387,62 @@ bool AP_Mission::jump_to_landing_sequence(const Location ¤t_loc) | |||
} | |||
|
|||
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Landing sequence start"); | |||
_flags.in_landing_sequence = true; |
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.
This is not needed because set_current_cmd
will do it already.
6ad1b7b
to
8436417
Compare
This picked up a conflict in arducopter.py autotest, I have rebased. |
8436417
to
e88f775
Compare
Rebased. |
if (_flags.state == MISSION_RUNNING) { | ||
// if mission is already running don't switch away from a active landing or return path | ||
if (_flags.in_landing_sequence) { | ||
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Landing sequence active"); |
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.
Ideally we should have the subsystem prefixed on the text messages I think. I suspect we have other examples in the mission library that don't use a prefix.. we probably should though. Not a blocker though.
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.
This is a big change so its hard to be sure that it is all OK but this PR includes an autotest and we are at the beginning of a dev cycle so it should get lots of testing before the official release.
Great feature!
This adds support for a new mission item (ArduPilot/mavlink#212, mavlink/mavlink#2088) that acts as a marker to the autopilot that it can rejoin a mission at any point after this marker and before a landing or MAV_CMD_DO_LAND_START.
Demo: https://youtu.be/SoHXRTD0vEs?si=pHTvRDMcOsStv4l6
This was originally done on 4.1.0 where it has a lots of testing on real vehicles this rebase has not had the same level of testing.
Along with the new mission item this also adds support for passing in a location to the various
DO_LAND_...
AP mission functions. Copter then uses this to pass in the stopping point rather than the current location. Helpers are added to so the current method without location still works for plane. Passing in the stopping point prevents copter going back on itself when a rejoin is commanded as it is about to pass a way point at speed. Where the next waypoint is still in front of the vehicles current location but it can't stop in time to hit it and has to go back.Both
DO_LAND_START
andDO_RETURN_PATH_START
can be sent as commands to trigger there respective behavior and enter Auto RTL mode. Entering Auto RTL mode manually will first look for aDO_RETURN_PATH_START
and if it cannot find one it will look for aDO_LAND_START
. We might want to add a parameter like plane'sRTL_AUTOLAND
to control which we do when switching to Auto RTL mode.I have added a auto test, but some manual testing is probably also a good idea.