Enhancing RTL or creating a new command

Anyone know of code work for a command to follow original way points back to the launch point instead of a straight line like RTL does?

I’ve done searches on various groups and sites looking for anything like this, no luck. Appreciate any pointers to code work in this area.

Or, is this already doable and I’ve totally missed how to do this in APM:Plane

Here is my idea for the new command/function and how it came about.

Concept for new APM command/function: Reverse Course to Launch (RCTL)

This idea came about after a year long closing on a river valley road. Undetected river erosion on a wooded embankment causing the road to sink. The only way it could have been detected would have been eyes on the river doing inspections along the shore.

A UAV flying the the river course filming the area for later review (or live) could have given an early warning to this and other potential concerns. The challenge in this example is a winding river with small hills, cliffs, wooded shore line and the river itself being narrow. At times the river valley less then 1000 ft wide. To be effective a UAV would need to fly at 100-200 ft. AGL over the river.

That’s the scenario and this is where a reverse course comes into play. With current APM software an issue of a normal RTL or a FAILSAFE occurring the UAV would need to climb to 900+ ft. to make a safe return to launch, and; putting it in a different airspace.

Reverse Course would execute a 180 degree turn and follow previously passed way points back to the launch point.

This function also would benefit APM:Rover and could make it useful in watercraft on rivers.

Reverse could also be a programmed to execute based on other factors such as battery condition, time, distance covered, or on command.

Thanks for looking.

If it is a long mission with a survey pattern, you certainly wouldn’t want to reverse that whole course. Rather than a new mode, would it be better to use a similar model to the new DO_LAND__START command. You could insert a command in the flight plan called DO_RTL_PATH. If the plane enters RTL, it will look for this command, and if it sees it, the AP will skip to this point of the flight plan and follow the subsequent WPs home. At that point it will look for DO_LAND_START and execute the approach, or it will simply loiter over Home.
So as to not interfere with a normal flight plan, the DO_RTL_PATH command and all its WPs would be at the end of the flight plan after the LAND command. They would lay dormant unless RTL is engaged. To avoid clutter, these WPs will all show up in a different color, perhaps semi transparent in MP.
The DO_RTL_PATH command would need its own radius in which the plane must be for it to be used. Also, the plane will always RTL to the closest WP after the DO_RTL_PATH command. This will ensure that 1) the plane won’t fly away from you to start the RTL, and 2) it will take the shortest route home along the defined path.
Ideally the RTL_PATH could be a separate flight plan stored on the Pixhawk SD Card. That wouldn’t be possible on the APM 2.x however.

Sounds interesting; I’ll look into it. Perhaps generating a mission and posting it would give people a good idea of the area. This could also be done with a drone boat.