Fixed wing flight detection fix#10621
Conversation
|
I armed, throttled up a little and briskly walked around the field, bouncing the plane a bit, to simulate rolling over the grass.. Then I shut the throttle off and put the plane down (obviously without disarming) and waited. With I couldn't conclusively test the second part. Due to there only being 4m altitude difference at my general location. But that didn't show up as an immediate disarm after the second arming with |
|
HITL testing should be OK for this given it's just logic rather than dynamic performance related. |
|
initial reporter also tested on his geared plane and all works as expected now. Think we can merge |
|
Let's merge it in 8.1. Sounds fairly safe and more people will be able to test in a nightly build, until we start the 8.1 rc saga :) |
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_altitudeset 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_altitudetoEACH_ARMso 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.