Skip to content
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

Use yaw source change to handle compass calibration period #48

Conversation

priseborough
Copy link

Rather than forcing continual resets of the magnetomer use variables which also resets the yaw data buffer, these changes do the following:

Remove calls to InitialiseVariablesMag() based on compass.learn_offsets_enabled();

When compass.learn_offsets_enabled() is true, disable use of magnetometer data as follows:

If yaw_source = AP_NavEKF_Source::SourceYaw::COMPASS set yaw_source to AP_NavEKF_Source::SourceYaw::NONE
if yaw_source = AP_NavEKF_Source::SourceYaw::GPS_COMPASS_FALLBACK set yaw_source to AP_NavEKF_Source::SourceYaw::GPS

Restore parameter selected yaw_source when compass.learn_offsets_enabled() is false. The EKF already resets the body frame mag bias estimates and compass data buffer if the compass offsets have changed so no additional resets should be necessary.

Replay testing on a SITL log shows that after the fix, RPY tracks the SIM values.

Screenshot 2024-04-17 at 10 08 23 AM Screenshot 2024-04-17 at 10 09 14 AM Screenshot 2024-04-17 at 10 10 11 AM

tridge and others added 3 commits April 11, 2024 15:45
if using GPS yaw we don't want to do a yaw reset on completion of GPS
yaw, so just don't detect compass learning
@tridge tridge force-pushed the pr-ekf3-compass-fallback branch from f731921 to 21a9294 Compare April 22, 2024 22:31
@tridge
Copy link
Owner

tridge commented Apr 22, 2024

merged, added to dev call topic, thanks Paul!

@tridge tridge closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants