-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Current Behavior
When flying without a GPS lock and a radio failsafe happens, instead of engaging RTH mode, Inav enters into emergency landing mode. That's ok, because without GPS lock it's really hard to know how to return to home.
However, the problem is that once the barometer altitude "reads" 0m and a landing hasn't yet been detected, Inav punches the throttle for a climbout before trying to land again.
This is VERY BAD if flying over downward sloping terrain, as the ground will never be reached in the landing mode, because it will be in a negative altitude with relation to the home altitude.
In simpler terms, "emergency landing mode" doesn't land the model. It keeps the model flying indefinitely.
This happened to me yesterday, on Inav 7.0.0RC2. My GPS was having trouble getting a lock, but since I just wanted to do some PID tuning and keep it nearby, I bypassed the no-gps arming lock and flew. Midway through the flight I had a radio failsafe and it entered into emergency landing mode. The quad was less than 300m from me, over an open field, so I didn't worry. I would just walk over there and pick it up once it landed. But since the field was downward sloping, it never landed. Instead, it entered into that ping-pong between 0m and 40ish meters (baro altitude) until the battery ran out, while drifting with the wind. The quad ended up in a patch of trees around 2km from the takeoff point.
Steps to Reproduce
- Set failsafe to RTH mode
- Fly without a GPS lock
- Enter radio failsafe over a downward sloping terrain
- Watch helplessly as the quad ping-pongs being blown away by the wind until the battery is drained and it finally doesn't have enough power to climb and ends up crashing or hitting some obstacle.
Expected behavior
When in emergency landing mode, it should descend until a landing is detected (or some obstacle is hit), regardless if the landing will occur in a negative altitude relative to the takeoff. Relying on baro altitude for "ground detection" is not the best idea, specially if the area is downward sloping. Also, baro altitude can drift a little during the flight, so it isn't reliable or precise enough to detect ground.
Suggested solution(s)
Remove the check for "0 baro altitude" when in emergency mode. Let it descend until the accelerometer based landing detection triggers.
- FC Board name and vendor: Matek F405 miniTE
- INAV version string: Inav 7.0.0 RC2 (though I don't think this behaviour is specific to an inav version)