Browse Source

AP_NavEKF2: use first usable compass index to set magSelectIndex

c415-sdk
Siddharth Purohit 4 years ago committed by Andrew Tridgell
parent
commit
124eaf1a38
  1. 6
      libraries/AP_NavEKF2/AP_NavEKF2_MagFusion.cpp
  2. 2
      libraries/AP_NavEKF2/AP_NavEKF2_core.cpp

6
libraries/AP_NavEKF2/AP_NavEKF2_MagFusion.cpp

@ -148,14 +148,14 @@ void NavEKF2_core::controlMagYawReset()
// send initial alignment status to console // send initial alignment status to console
if (!yawAlignComplete) { if (!yawAlignComplete) {
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "EKF2 IMU%u initial yaw alignment complete",(unsigned)imu_index); GCS_SEND_TEXT(MAV_SEVERITY_INFO, "EKF2 IMU%u MAG%u initial yaw alignment complete",(unsigned)imu_index, (unsigned)magSelectIndex);
} }
// send in-flight yaw alignment status to console // send in-flight yaw alignment status to console
if (finalResetRequest) { if (finalResetRequest) {
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "EKF2 IMU%u in-flight yaw alignment complete",(unsigned)imu_index); GCS_SEND_TEXT(MAV_SEVERITY_INFO, "EKF2 IMU%u MAG%u in-flight yaw alignment complete",(unsigned)imu_index, (unsigned)magSelectIndex);
} else if (interimResetRequest) { } else if (interimResetRequest) {
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "EKF2 IMU%u ground mag anomaly, yaw re-aligned",(unsigned)imu_index); GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "EKF2 IMU%u MAG%u ground mag anomaly, yaw re-aligned",(unsigned)imu_index, (unsigned)magSelectIndex);
} }
// update the yaw reset completed status // update the yaw reset completed status

2
libraries/AP_NavEKF2/AP_NavEKF2_core.cpp

@ -348,7 +348,7 @@ void NavEKF2_core::InitialiseVariablesMag()
inhibitMagStates = true; inhibitMagStates = true;
magSelectIndex = 0; magSelectIndex = dal.compass().get_first_usable();
lastMagOffsetsValid = false; lastMagOffsetsValid = false;
magStateResetRequest = false; magStateResetRequest = false;
magStateInitComplete = false; magStateInitComplete = false;

Loading…
Cancel
Save