-
Notifications
You must be signed in to change notification settings - Fork 18.7k
EK3_OGN_HGT_MASK bit 3 incorrect behavior #24039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ArduPilot#24039 When 3rd bit is set, Ardupilot doesn't use ekfGpsRefHgt to convert GPS alt to local alt. But it still updates ekfGpsRefHgt in correctEkfOriginHeight. And the innovation used in the latter is constantly non-zero.
Co-authored-by: Pavlo Kolomiiets <[email protected]> ArduPilot#24039 When 3rd bit is set, Ardupilot doesn't use ekfGpsRefHgt to convert GPS alt to local alt. But it still updates ekfGpsRefHgt in correctEkfOriginHeight. And the innovation used in the latter is constantly non-zero.
Co-authored-by: Pavlo Kolomiiets <[email protected]> ArduPilot#24039 When 3rd bit is set, Ardupilot doesn't use ekfGpsRefHgt to convert GPS alt to local alt. But it still updates ekfGpsRefHgt in correctEkfOriginHeight. And the innovation used in the latter is constantly non-zero.
Co-authored-by: Pavlo Kolomiiets <[email protected]> ArduPilot#24039 When 3rd bit is set, Ardupilot doesn't use ekfGpsRefHgt to convert GPS alt to local alt. But it still updates ekfGpsRefHgt in correctEkfOriginHeight. And the innovation used in the latter is constantly non-zero.
We've just merged a fix for this - thanks @pavloblindnology |
Thanks for this, is it already in a stable or beta version i can test? Does ":Apply corrections to local position" mean that it will update the home altitude accordingly? i have tried using it set to 1, but when it comes back to home its sometimes 10 meters off... Log: |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Issue details
If 3rd bit of

EK3_OGN_HGT_MASK
is set together with 1st bit (EK3_OGN_HGT_MASK=5) and vertical position is taken from barometr (default parameters), copter climbs periodically indefinitely. The plot below shows 10x SITL simulation with real altitude (barometer or gps) jumping at regular intervals, while the controller (and EKF) altitude remaining constant. The real alt increases as copter periodically thinks it's below desired altitude (100m) and simply turns on the throttle to keep it.The reason is in
readGpsData
hereardupilot/libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp
Line 693 in 5144341
When 3rd bit is set, Ardupilot doesn't use
ekfGpsRefHgt
to convert GPS alt to local alt. But it still updatesekfGpsRefHgt
incorrectEkfOriginHeight
. And the innovation used in the latter is constantly non-zero.The jumps in alt are introduced by the 5-sigma check here. If the check is removed, the alt rises smoothly and with acceleration.
ardupilot/libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp
Line 817 in 5144341
It seems the cure is to always use
ekfGpsRefHgt
to convert GPS alt to local alt inreadGpsData
. Tested and it worked ok.Version
Copter-4.3.7
Platform
[ ] All
[ ] AntennaTracker
[*] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Airframe type
octa
Hardware type
SITL
Logs
BIN log
The text was updated successfully, but these errors were encountered: