ardupilot
ardupilot copied to clipboard
AHRS: added common origin between backends
This ensures that EKF2, EKF3 and ExternalAHRS all have a common origin
Note that the origin will come from the first running backend that gets an origin, even if it is not the active backend. This is needed because EKF2 and EKF3 refuse to change origin once it is set. The placement of this code in the update function for each backend is done as two backends may get an origin on the same loop, so we must check for an origin as soon as we call the backends update
.. also should have an autotest
this was flight tested on a 5" quad, switching between EK2 and EK3 did not change position
.. also should have an autotest
not really sure how to do that ... the obvious method of not setting EK2_ENABLE=1 until after EK3 has set origin won't work, as this PR only does the origin set once
i'll try to do an autotest
back for dev call this week. I think we should merge this now, but separately see if we can stop the EKFs from changing the origin height on baro reset, but as a separate PR