-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
AHRS: added common origin between backends #27851
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. The copied block will go away when I manage to get the common base class stuff sorted....
Need to test it on real vehicles a bit.
.. also should have an autotest |
this was flight tested on a 5" quad, switching between EK2 and EK3 did not change position |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an autotest would be nice but if it's too difficult then merging is OK
i'll try to do an autotest |
6e16092
to
e06db98
Compare
e06db98
to
c80822a
Compare
this allows for use of a common origin between backends, and aligns with EKF3 behaviour
and remove code that aligns origin to AHRS, this will be handled by the AHRS common origin logic
this aligns the origin between EKF2, EKF3 and ExternalAHRS, making for smooth transitions between AHRS backends in flight
when common origin is set we should return that, not backends private origin
test EK2 and EK3 common origin
c80822a
to
1e5f9da
Compare
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 |
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