Skip to content

Conversation

@breadoven
Copy link
Collaborator

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 to FIRST_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 set inav_reset_altitude to EACH_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.

@b14ckyy b14ckyy requested a review from mmosca January 19, 2025 15:26
@b14ckyy b14ckyy added this to the 8.1 milestone Jan 19, 2025
@mmosca mmosca changed the base branch from master to maintenance-8.x.x January 21, 2025 22:44
@Jetrell
Copy link

Jetrell commented Jan 25, 2025

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 nav_disarm_on_landing = ON it did not disarm the FC as desired.
Then I power cycled and rearmed and flew around.. After landing it disarmed within a few seconds, as expected.

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 inav_reset_altitude = FIRST_ARM.

@breadoven
Copy link
Collaborator Author

HITL testing should be OK for this given it's just logic rather than dynamic performance related.

@b14ckyy
Copy link
Collaborator

b14ckyy commented Jan 25, 2025

initial reporter also tested on his geared plane and all works as expected now. Think we can merge

@mmosca
Copy link
Collaborator

mmosca commented Jan 25, 2025

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 :)

@mmosca mmosca merged commit b0dd438 into iNavFlight:maintenance-8.x.x Jan 25, 2025
21 checks passed
@breadoven breadoven deleted the abo_fw_flight_detect_fix branch May 18, 2025 09:30
@MrD-RC MrD-RC modified the milestones: 8.1, 9.0 Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inav can "disarm because of landing" even if the aircraft has not taken off. (Inav 8.0.0 RC4)

5 participants