Add an option to specify a time delay before executing an autoland when the craft has RTH in FS
Current Behavior
Currently a craft will land immediately (or not at all depending on configuration) after reaching it's home point if RTH failsafe is enabled.
Desired Behavior
An option to set a timer to delay landing after reaching home would be useful. I had a situation today where my plane was loitering overhead for 15 minutes before I was able to reestablish a control link to it. Having the time to get myself sorted out was great but I was fully expecting the pack to die resulting in a crash if I couldn't get the Crossfire connected again. If I could have set myself a timer that I knew would bring the plane down eventually that would be great. Sometimes an auto landing is not the best option due to trees or other obstacles that you may hit on the way down so having time to try and regain control is valuable. Could also be tied to voltage instead of time.
Suggested Solution
Add another option to the landing behavior dropdown in the advanced tuning tab that lets you specify an amount of time the plane will loiter on RTH FS before auto landing. Would also be great to have a timer counting down time to auto land in the OSD. An option to specify a cell voltage level could also be useful for triggering auto land so there would be no danger of running the pack down to a level that damages it.
Who does this impact? Who is this for?
This is for all fixed wing users
Additional context
Sorry for the close and reopen. My GitHub skills are weak.
@evmoius Doesn't the "Land only on failsafe" option satisfy your use case? A timer seems needlessly complicated to me, because if you set it too low it won't be helpful and if you set it too high it might drain the battery before it lands. Tying it to battery voltage comes with another set of problems. See the issues regarding automatic RTH on low battery for a detailed discussion.
@fiam If the plane had autolanded where I was flying there is a good chance it would have hit an obstacle. Since I was able to eventually get it back under control, having some time to troubleshoot it while in the air would be great, plus I would also have some peace of mind that it will indeed attempt to land if all else fails rather than just crash when the lipo dies.
Keep in mind this would just be an additional option to the current failsafe modes. My plane can fly for an hour so running out of battery isn't a huge concern with most of my flights less than half an hour.
Waypoint has 3 additional parameters p1, p2, p3 and p2, p3 are not used. Maybe we can use p2 to store time in seconds, how long the plane should wait after reaching the point. This will work for the waypoint and waypoint rth. I'm trying do something like that https://github.com/iNavFlight/inav/compare/development...hali9:wait-wp-rth but do not have time to test it.
For normal rth, cli parameter rth_home_wait can be create similar to rth_home_altitude.
A new stage will need to be created NAV_STATE_RTH_WAIT_ABOVE_HOME.
When rth_home_altitude is not set and allow landing go to NAV_STATE_RTH_WAIT_ABOVE_HOME wait rth_home_wait seconds and then go to NAV_STATE_RTH_LANDING.
A question is:
- When
rth_home_altitudeis set and allow landing, firstly go toNAV_STATE_RTH_HOVER_ABOVE_HOME, and when reachrth_home_altitudewaitrth_home_waittime and then land. - Or when reach home point, count
rth_home_waitand at the same time descent (climb) torth_home_altitude. I think this is good option. - Or simply ignore
rth_home_altitudeand wait at the altitude you arrived at home point.
@hali9 I think your second option is probably best. Having the plane start its countdown timer when it reaches its RTH point and in that time adjust its altitude to rth_home_altitude while the timer is counting down.
I managed to achieve the intended effect. It implements the 2nd scenario.
This work on waypoint (using p2), waypoint rth (using p2), rth (using nav_rth_home_wait).
And I tested it on quadx yesterday and it works well.
I have not tested it on the plane yet.