Bug Report
If EKF3 is configured to switch between rangefinder and barometer using the EK3_RNG_USE_HGT parameter, a somewhat permanent offset appears in the EKF's altitude estimate vs the barometer which is equal to the difference between the rangefinder's reported distance and the barometers altitude above EKF origin at the moment of the switch (from rangefinder to baro). Put another way, we would expect that once the EKF has started using the barometer the EKF's altitude estimate above the EKF origin should equal the barometer but it doesn't.
This issue was first reported here during the 4.7.0 beta testing.
This can be reproduced in SITL by doing the following:
- ../Tool/autotest/sim_vehicle.py --map --console
- param load ../Tools/autotest/default_params/copter-rangefinder.parm
- param set RNGFND1_MAX 10 (to set maximum rangefinder range to 10m, e.g. switch over at 5m)
- restart SITL
- param set EK3_RNG_USE_HGT 50 (meaning use rangefinder when below 50% of its maximum range)
- wait for EKF origin to be set
- param set SIM_BARO_GLITCH 3 (to add a 3m offset to the barometer altitude)
- GUIDED
- arm throttle
- takeoff 20
- LAND
- param set SIM_BARO_GLITCH 0 (just in case you want to run the test again later)Repeat the test again but this time after step 3:Repeat the test above but at step 4 set EK3_RNG_USE_HGT -1 (the default which is to use only baro)
Open the logs and compare the CTUN.Alt (EKF's altitude estimate) and BAlt (barometer reported altitude) and note the offset when EK3_RNG_USE_HGT = 50
Version
Copter-4.8.0-dev
Platform
[ ] All
[ ] AntennaTracker
[x ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Bug Report
If EKF3 is configured to switch between rangefinder and barometer using the EK3_RNG_USE_HGT parameter, a somewhat permanent offset appears in the EKF's altitude estimate vs the barometer which is equal to the difference between the rangefinder's reported distance and the barometers altitude above EKF origin at the moment of the switch (from rangefinder to baro). Put another way, we would expect that once the EKF has started using the barometer the EKF's altitude estimate above the EKF origin should equal the barometer but it doesn't.
This issue was first reported here during the 4.7.0 beta testing.
This can be reproduced in SITL by doing the following:
Open the logs and compare the CTUN.Alt (EKF's altitude estimate) and BAlt (barometer reported altitude) and note the offset when EK3_RNG_USE_HGT = 50
Version
Copter-4.8.0-dev
Platform
[ ] All
[ ] AntennaTracker
[x ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine