Skip to content

Conversation

tonyyng
Copy link
Contributor

@tonyyng tonyyng commented Jul 29, 2020

After a couple of recent radio failures resulted in my airplane landing itself, I came up with a way to designate a safe landing spot, instead of the location where you arm your plane.

During landing for fixed wing, the airplane circles around "home", an area which likely includes you, other pilots, parked cars, trees, etc.

This approach lets you identify alternate locations which are safe. During arming, if any of these locations are within 200m, it is used as home, instead of the point where you armed your plane.

For more details, see Safehomes.md.

@digitalentity digitalentity added this to the 2.6 milestone Jul 29, 2020
@giacomo892
Copy link
Collaborator

Very interesting indeed! Thanks for the contribution
I'd add an option to force the plane to land at the resonably nearest safehome from the arming point during a failsafe, regardless the "200m" constraint.
You can possibly have a nice place that can handle a complete failsafe landing and it couldn't be close enough to trigger the 200m check.

@digitalentity
Copy link
Member

Nice indeed! As @giacomo892 mentioned, this still could be improved, but we can definitely target this feature for 2.6

@stronnag
Copy link
Collaborator

and maybe remove set nav_rth_home_offset_* to avoid confusion.

@tonyyng
Copy link
Contributor Author

tonyyng commented Jul 29, 2020

Very interesting indeed! Thanks for the contribution
I'd add an option to force the plane to land at the resonably nearest safehome from the arming point during a failsafe, regardless the "200m" constraint.
You can possibly have a nice place that can handle a complete failsafe landing and it couldn't be close enough to trigger the 200m check.

After considering your suggestion, my preference would be to keep the implementation simple. I don't have enough knowledge or experience with this software to implement something much more complex.

The current logic is executed once when the plane is armed, designating the location that will replace home. The pilot is explicitly informed of the change in the home location. Your suggestion would involve changes at the point in time where a failsafe occurs and then executing logic to determine where to land. This is more risk than I feel comfortable writing code and testing.

In my mind, the 200m value is what I would choose for "reasonably nearest". What would you suggest as the reasonable limit for redirecting the aircraft to land elsewhere? I could increase it or change the 200m constraint to be a setting, allowing it to be set based on individual preference. I don't see this as a setting that many people are going to "tweak and tune". I just wanted an alternative to landing around the arming point.

@tonyyng
Copy link
Contributor Author

tonyyng commented Jul 29, 2020

and maybe remove set nav_rth_home_offset_* to avoid confusion.

I agree with this. These changes allow you to have the same functionality in a more reliable way.

Beyond removing the logic and setting definition, what else is involved? Release notes? Who decides if this should be done?

@stronnag stronnag added the Release Notes Add this when a PR needs to be mentioned in the release notes label Jul 29, 2020
@stronnag
Copy link
Collaborator

and maybe remove set nav_rth_home_offset_* to avoid confusion.

I agree with this. These changes allow you to have the same functionality in a more reliable way.

Then please do it in the next iteration of your PR.

Beyond removing the logic and setting definition, what else is involved? Release notes? Who decides if this should be done?

It will be part of the review, the author of the original feature requested / supports its removal.

I've marked this as for the Release Note so we won't forget. Once it's merged it can be added to the draft RN.

@tonyyng
Copy link
Contributor Author

tonyyng commented Jul 29, 2020

This is more risk than I feel comfortable writing code and testing.

Having said that, if anyone else feels up to making improvements, feel free to do so.

@stronnag
Copy link
Collaborator

Tested with multiple safehomes. Home is selected correctly in all cases.

Flight tested for RTH, WP and F/S cases (see also #5997). Home correctly instantiated (including case when all options out of range).

@stronnag stronnag merged commit f3da1c2 into iNavFlight:master Jul 31, 2020
Scavanger pushed a commit to Scavanger/inav that referenced this pull request Aug 4, 2020
* Merge Safehome feature from development repo

* Remove set nav_rth_home_offset_* to avoid confusion
@tonyyng tonyyng deleted the Add-Safehomes branch August 18, 2020 16:44
@StuweFPV
Copy link

I love this idea of that new feature. however I don't agree with the 200m limit that is introduced.
On my permanent spot i have my offset distance at 300m and it works perfectly. 200m will only slightly improve the situation vs launch position as RTH but still crash the plane into the trees. By forcing me onto a 200m limit you're completely eliminating the whole offset landing idea for me to be used (and maybe others also).
Please use 200m as default but give us the option to change that limit at our own risk. I don't see why it cannot go up to at least 500m+
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes Add this when a PR needs to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants