Skip to content

Commit

Permalink
AP_NavEKF3: don't look at compass learning with GPS yaw
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tridge committed Apr 11, 2024
1 parent f605c0f commit f731921
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,12 @@ void NavEKF3_core::readMagData()
return;
}

if (compass.learn_offsets_enabled()) {
// while learning offsets keep all mag states reset
if (compass.learn_offsets_enabled() &&
frontend->sources.getYawSource() != AP_NavEKF_Source::SourceYaw::GPS_COMPASS_FALLBACK) {
/*
while learning offsets keep all mag states reset
note that compass learning is ignored with GPS with compass fallback
*/
InitialiseVariablesMag();
wasLearningCompass_ms = imuSampleTime_ms;
} else if (wasLearningCompass_ms != 0 && imuSampleTime_ms - wasLearningCompass_ms > 1000) {
Expand Down

0 comments on commit f731921

Please sign in to comment.