ardupilot
ardupilot copied to clipboard
Copter: support `DO_RETURN_PATH_START` in AUTO RTL mode
This adds support for a new mission item (https://github.com/ArduPilot/mavlink/pull/212, https://github.com/mavlink/mavlink/pull/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 and DO_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 a DO_RETURN_PATH_START and if it cannot find one it will look for a DO_LAND_START. We might want to add a parameter like plane's RTL_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.
Not expecting this to be merged, but looking for approval of the concept so we can get the MAVLink PR (https://github.com/mavlink/mavlink/pull/2088) merged.
I did a longer explanation of why this might be needed there: https://github.com/mavlink/mavlink/pull/2088#issuecomment-1997561004
I'm really looking forward to this feature!
... todo add a plane impl. :-)
This looks very cool.
tridge liked it too.
This picked up a conflict in arducopter.py autotest, I have rebased.
Rebased.