-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
ekf2: check mag field with mag bias removed #23584
base: main
Are you sure you want to change the base?
Conversation
@@ -131,7 +131,7 @@ void Ekf::controlMagFusion(const imuSample &imu_sample) | |||
&& mag_sample.mag.isAllFinite(); | |||
|
|||
const bool starting_conditions_passing = continuing_conditions_passing | |||
&& checkMagField(mag_sample.mag) | |||
&& checkMagField(mag_sample.mag - _state.mag_B) |
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.
Should we then rather have the checkMagField
in common_conditions_passing
? Otherwise the bias can't be learned if "mag" fusion doesn't start.
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.
Yep, doesn't make sense otherwise. Thanks
00ef505
to
8dc84c7
Compare
@bresch are you using the
If it matters I'll split up checkMagField(), probably make it a pure function, and then set the rest of these logging and status fields separately. |
8dc84c7
to
490eb7e
Compare
- this is to allow the estimated mag bias to clear mag_field_disturbed and unlock mag_3D/mag_hdg
490eb7e
to
4a646e8
Compare
Yes, I find it really useful to quickly check if there is an issue with the mag. Since we'll do the checks on the bias-corrected data with this PR, I think it makes sense to also log the bias-corrected inclination and strength (as they can be used to tune the thresholds). |
Opening for review, discussion, testing.