Fixed wing flight detection fix #10621
Open
+17
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #10595 by adding an altitude change check for fixed wing flight detection. Flight is only detected if the altitude changes by 5m in addition to the other existing checks. The 5m is relative to a reference takeoff altitude that is constantly updated whilst disarmed only being fixed on arming as the reference takeoff altitude to be used during flight.
The takeoff reference altitude mentioned above is also used to fix a general issue related to the use of
inav_reset_altitude
set toFIRST_ARM
(default). If you change takeoff elevation after first arming/disarming the reference altitudes for launch mode max altitude, RTH altitudes and other altitude related settings potentially end up using the wrong reference takeoff altitude. This PR fixes the Launch mode issue which can cause the plane to disarm by landing shortly after arming for a new flight if the takeoff altitude exceeds the launch finish altitude or alternatively it might cause the launch to end too early. The best solution if you fly from varying takeoff altitudes is to setinav_reset_altitude
toEACH_ARM
so the change for Launch mode is really just fool proofing.Other related issues such as RTH altitudes are beyond the scope of this changes for now,
HITL testing shows this change to work as expected.