Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a parameter to delay landing in the event of a Failsafe #9502

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

MrD-RC
Copy link
Collaborator

@MrD-RC MrD-RC commented Nov 19, 2023

Landing during a failsafe is a useful feature. But, sometimes it may be unnecessary. For example, we are flying close to home and the transmitter battery dies. The aircraft could have landed before the battery in the transmitter is replaced. For rotary wings this is not so much of a problem. But for fixed wing, the landing is a controlled spiral crash. However, with both platforms, a human controlled landing would always be the better option.

This PR adds the option to delay the landing procedure start time. nav_rth_fs_landing_delay allows a delay in seconds to be set. This is only used during FS operation, so will not affect landing on RTH. As an additional safeguard. If the battery is in the WARNING or CRITIAL states. The landing will not delay any further.

Fixes #4123 #8893

@MrD-RC MrD-RC added this to the 7.1 milestone Nov 19, 2023
@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Nov 20, 2023

Tested in HITL and it works pretty nicely. I set the nav_rth_fs_landing_delay to 60.

I tested with a low battery by setting my cell count to 4. For those who don't know; HITL only has a 3S battery. I flew away and switched off the transmitter. The aircraft flew home, along the back track, and immediately landed.

I then virtually swapped in a full 3S pack, to avoid that situation. I flew away for about 1.5km and switched off the transmitter. Once again, it flew back along the back track route. Upon reaching home the message PREPARING TO LAND was displayed as the plane loitered. In about the first 30 seconds it loitered down to the RTH Home Altitude. Then held altitude while loitering for the remaining time. When the time was reached, it transitioned in to landing and touched down.

I have not tested with multirotor.

@MrD-RC MrD-RC marked this pull request as ready for review November 21, 2023 22:03
@Jetrell
Copy link

Jetrell commented Nov 23, 2023

Tested with a multicopter. Using Land_always and Land_FS_only.. With nav_rth_fs_landing_delay = 20.
In both cases when a failsafe was initiated, the quad would fly home and proceed to hover over the Home or Safehome location for the set period of time. Then it would descend and land.

Something I think would help. Is if there was a system message and countdown timer on the OSD. Like it has for PH_time in Waypoint missions.. To remind the pilot whats happening if they forgot they had this mode active. And to inform them how much time is left before the Plane or Quad will enter the landing phase.

Currently the standard system message function is blocked if any messages in the if section (osd.c:5108-5138) are used. I plan on unblocking the standard messages.
@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Nov 25, 2023

Thanks to @Jetrell for the suggestion.

https://youtu.be/L-GBW5H6cns

Also, this brought to my attention that some system messages are being blocked. I'll submit a separate PR to unblock these messages.

@MrD-RC MrD-RC merged commit 9311905 into master Dec 7, 2023
16 checks passed
@MrD-RC MrD-RC deleted the MrD_Add-FS-Landing-delay branch December 7, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to specify a time delay before executing an autoland when the craft has RTH in FS
2 participants