Some kind of failsafe mode on altitude sources inconsistency

Hi everyone!

Last time when I tuned APM for Skywalker 2013 I’ve met very strange issue. Skywalker was in RTL mode, altitude was about 100 m and… suddenly altimeter showed about 10000m and Skywalker started to fall disorderly. I switched to manual mode and saved it.

Looking through codes I’ve found that code isn’t fail proof there - if barometer can say anything APM thinks it’s true. I’m sure that it’s possible to estimate differentiation between GPS’s altitude and barometer’s one to use altitude from most trusted source. If there are no plans to fix this problem and if somebody can point me to code validation procedure I’d provide some implementation of such functionality.

I would suggest raising this as an issue here github.com/diydrones/ardupilot/issues