ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.09k stars 17.66k forks source link

Plane: `RETURN_TO_LAUNCH` mission command should not switch mode #18496

Open IamPete1 opened 3 years ago

IamPete1 commented 3 years ago

Currently a RETURN_TO_LAUNCH mission command will just switch to RTL mode.

https://github.com/ArduPilot/ardupilot/blob/a39a948c57b53fb4c36ace731c1a40fea9233638/ArduPlane/commands_logic.cpp#L74-L76

This means that you cannot do a RTL part way through a mission. We also have a verify function that is never used because were no longer in auto to run it. https://github.com/ArduPilot/ardupilot/blob/a39a948c57b53fb4c36ace731c1a40fea9233638/ArduPlane/commands_logic.cpp#L249-L250

Instead plane should behave as copter and the RTL should be a submode of auto.

This will also avoid hitting the auto switch to QRTL or RTL auto land via do land start, if you wanted those things you could program your mission to do that.

IamPete1 commented 3 years ago

This is the last user of ModeReason::MISSION_CMD