ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Copter: support `DO_RETURN_PATH_START` in AUTO RTL mode

Open IamPete1 opened this issue 1 year ago • 6 comments

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.

IamPete1 avatar Mar 03 '24 19:03 IamPete1

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

IamPete1 avatar Mar 18 '24 12:03 IamPete1

I'm really looking forward to this feature!

rmackay9 avatar Mar 19 '24 00:03 rmackay9

... todo add a plane impl. :-)

davidbuzz avatar Mar 19 '24 00:03 davidbuzz

This looks very cool.

tridge liked it too.

peterbarker avatar Mar 19 '24 00:03 peterbarker

This picked up a conflict in arducopter.py autotest, I have rebased.

IamPete1 avatar Apr 10 '24 22:04 IamPete1

Rebased.

IamPete1 avatar Apr 22 '24 13:04 IamPete1