Needs testing: Issue #10830 Surface Mode Fixes#11425
Conversation
|
There was a guy on Discord today who also experienced a similar issue to this. This was the transcript.
Note that he said he turned off the landing detector in this Diff, after the crash. Thinking it might be related. There is also a slight issue with having altitude trusted below 10cm. And not just what defines TRUSTED ? DIFF - INAV_9.0.1_cli_20260516_015624 (nav_disarm_on_landing = OFF after crash).txt |
|
@Jetrell Yes it's the same issue as #10830. The surface logic isn't very sophisticated when the AGL altitude isn't trusted. If you switch on Althold above the range finders useable range, so it isn't trusted, it simply descends at 0.5m/s until it gets back in range and becomes trusted. When this happens the throttle stick becomes useless, high or low ... it does nothing which is pretty confusing for the pilot. Maybe the throttle stick should control the descent speed in these circumstances when AGL isn't trusted, e.g. 0.5 m/s above mid throttle with a linear increase up to say 2 m/s from throttle mid to throttle low. Would make more sense to the pilot. Also the 0.5m/s is less than the landing detector minimum speed of 1 m/s which can cause it to trigger if the throttle is held low. Not sure why I chose 10cm as the detection cut off for this PR but it could be increased to maybe 50cm because detection is also only allowed in the PR if AGL altitude is trusted (that in itself would have prevented these crashes). Do you not have a rangefinder equipped quad @Jetrell to test this ? |
It is interesting about the 0.5m/s.. Emergency Landing descent speed is also 0.5m/s. Which I guess could also lead to a landing detector disarm if the throttle was lowered, if still in radio range. Increasing it to 50cm shouldn't be a problem from any lidar that works well enough to be worth using.. |
|
Test firmware build ready — commit Download firmware for PR #11425 234 targets built. Find your board's
|
There was a problem hiding this comment.
Pull request overview
Addresses issue #10830 by adjusting SURFACE (terrain-follow) behavior on multicopters to avoid premature landing detection and to make descent behavior more controllable when AGL is not trusted, and adds OSD feedback about SURFACE mode status.
Changes:
- Adjusts SURFACE altitude/throttle handling when AGL is untrusted to make throttle influence descent rate rather than forcing a constant descent.
- Restricts manual-mode “throttle low” landing-detection start condition during SURFACE to cases where AGL is trusted and very low altitude.
- Adds new OSD system messages for SURFACE OK / SURFACE inoperative status and increases system-message array capacity.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main/navigation/navigation_multicopter.c | Tweaks SURFACE RC-to-altitude / descent behavior and gates manual landing detection when SURFACE is active. |
| src/main/io/osd.h | Adds SURFACE-related OSD system message strings. |
| src/main/io/osd.c | Displays SURFACE system messages and increases system-message array size for additional messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Also active in non autonomous flight modes but only when thottle low. | ||
| * Throttle low detection only allowed during Surface if AGL trusted and below 10cm */ | ||
| bool throttleLowCheckAllowed = !navigationIsFlyingAutonomousMode(); | ||
| if (posControl.flags.isTerrainFollowEnabled) { | ||
| throttleLowCheckAllowed = throttleLowCheckAllowed && posControl.flags.estAglStatus == EST_TRUSTED && posControl.actualState.agl.pos.z < 50.0f; | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Maybe you should try the mtp-02p? It has a range of 6 meters. |
I'm not fan of Lidar rangefinders. Because they're highly susceptible to sun light causing intermittent or incorrect readings. |
|
I've "bench" tested this using the Fake rangefinder and it works as expected as far as bench testing allows, i.e. the logic works as expected. AGL altitude was varied using the transmitter scroll wheel. The descent rate ramp up works correctly on the throttle stick and the OSD system messages work as expected. False landing detection appears to work as intended which is the main point of this PR. It won't trigger a landing with throttle low, quad static and AGL not trusted. When AGL is trusted landing detection becomes more difficult if anything because of the long existing code that looks at the AGL altitude relative to Arming AGL altitude so the main issue here is not detecting a landing more than anything else. |
|
I'll merge this based on the fake rangefinder testing. It's good enough to confirm the logic works as expected. |
Should close #10830.
Inhibits landing detection when Surface mode active unless AGL altitude Trusted and below 50cm.
Changes behaviour in Surface mode without Trusted AGL altitude. Previously the craft would descend at 0.5m/s regardless of throttle stick position. PR changes this so the throttle stick provides some adjustment of the descent rate, 0.5 m/s from high to mid stick then linear increase up to 2 m/s at low stick position. Should be less confusing for the pilot to have some response from throttle control.
Provides OSD system message indicating Surface mode status.
Also updates OSD system message array size to take account of additional Geozone messages.
Needs testing.