I've been working on this for a few months now and I think it is finally ready for evaluation for a possible merge into master. My team has been wanting to simplify planning for autonomous landings so that mission planning for autonomous landing is less complex. Our motivation is that if we need to change a planned landing approach in flight all we have to do is change one waypoint. In this proposal, we just change a Rally Point. I have made 3 patches to ardupilot, mavlink, and MAVProxy:
What these "ral_landing" branches do is introduce a new DO command (MAV_CMD_DO_RALLY_LAND) to mavlink, and then support that command in MAVProxy by allowing a user to type "rally land" at the prompt (the mission must have been setup properly for this to work ... keep reading). The ardupilot patch introduces an AP_Land library that is designed to allow a landing to be performed from a Rally Point. The L1 controller is used to get the plane to find the line between a rally point and the nearest landing point in the mission, providing sufficient path planning to reliably arrive at the landing point at the desired heading. To ensure the plane does not do a 180 degree turn should it fly past the waypoint (unlikely considering the LAND_FLARE_SEC parameter ... but possible if somebody disables flaring), the L1 controller uses a Location extrapolated out 1km beyond the landing waypoint (similar to what is done continuously in CRUISE mode).
What happens during a Rally Landing is that the plane transits to the Rally Point at its loiter altitude. When it begins loitering it will then begin slowing and descending. Three conditions must be met before the plane will break out of the loiter and head for the landing point.
Note that if the plane should reach the break altitude and either of the other two conditions are not yet met then it will continue to loiter until they are (plane will not continue descending). Also, if the plane reaches the target landing speed it will not continue slowing.
I have tested this extensively in SITL and a bit in the field and it appears to function as desired. To setup a SITL or field test you need to be aware of the following parameters:
If need be, see the Parameters Page for more detail on those parameters. There is also a new parameter introduced by the patch:
When setting up a mission to utilize a Rally Landing with MAVProxy, setup the above parameters as desired. Then create a mission with a landing waypoint in it. Then add a rally point as follows:
"rally add <loiter_alt> <break_alt>"
I usually set as follows:
"rally add 100 40"
The loiter_alt sets the altitude at which the plane will transit to the Rally Point and loiter in RTL. The break_alt sets the altitude at which the plane will break out of the loiter.
The approach that the plane will take is completely user-defined. You're completely free to setup a rally point that is going to give the plane a difficult approach to the landing point, but I wouldn't recommend it (e.g., don't put the rally point right on top of the landing point -- give your plane a nice gentle glide slope). :) With flexibility comes responsibility. I've added a GUI element to MAVProxy that will hopefully help you line up your plane with a runway. If a mission with a landing waypoint has been loaded into MAVProxy ("wp load" or "wp list" commands), then a line will be drawn between each rally point and the nearest landing point after rally points are loaded ("rally list"). See this figure:
This initial patch proposal does not support flaps or any other kind of air braking. Maybe in the future.... :)
I hope you all find this proposed change to your liking. Please let me know if you have comments / questions / concerns.