Methods and algorithm for determining isFlying() #8745
Replies: 2 comments 2 replies
-
I think the 2nd one (--) is a bit too vague. It probably needs to be more platform specific too. For example. A motor glider could have zero throttle, not be moving fast, yet could be flying for hours like that. I don't think throttle position should be used to determine if a fixed wing is flying or not. Even with non-gliders, I've flown with zero throttle for a minute or two. Though in those instances, there was a 3D speed that would have been picked up. A rotor craft could only have zero throttle for a couple of seconds before it hits the ground. My thoughts are actually moving away from in-flight is still flying detection, to having more definitive has started flying and has landed detection. If those two work well enough, is still flying is just a case of For start flight detection, we have an excellent trigger for some fixed wing already in autolaunch. If that completes, you're flying. If you don't use autolaunch, for fixed wing, a |
Beta Was this translation helpful? Give feedback.
-
This may be a useful link for this discussion, though it's old now. #2331 |
Beta Was this translation helpful? Give feedback.
-
It was suggested I open a discussion about this, and particularly get feedback from @breadoven
I'm wanting to make the isFlying () work as well as possible. The instant purpose is to allow re-arm for a few seconds after an accidental in-flight disarm.
To allow re-arming after disarming in flight, we need to detect flight.
In this PR:
#8736 (comment)
I suggested a general approach something like this:
If landing detected { likely_flying = 0 }
while armed and throttle high and speed high {
likely_flying++;
}
while throttle low or speed is low {
likely_flying--;
}
while disarmed {
likely_flying -= 10 # Quickly reduce likelihood we're still airborne
}
Beta Was this translation helpful? Give feedback.
All reactions