EKF2 IMU1 ground mag anomaly, yaw re-aligned

I am running ArduSub software in the loop along with Gazebo. I have tested both ArduSub 4.5 and 4.0.3, but I consistently encounter the following error:

APM: EKF2 IMU1 ground mag anomaly, yaw re-aligned
APM: EKF2 IMU0 ground mag anomaly, yaw re-aligned

After this occurs, the vehicle’s pose changes unexpectedly and becomes uncontrollable. I am controlling the vehicle autonomously through a ROS2 bridge node that I developed using MAVLink, which directly manipulates the RC channels.

What could be causing this issue?

Hi @Youssefattia_98 -
It sounds like you need to achieve a better compass calibration, and make sure any high-current wires are not too close to your compass. I’m a bit mystified if this is happening in your SITL, and not with a real vehicle?

no it was happening in the SITL running along Gazebo. I have fixed it finally.

turns out that the MAG 2,3,4 where comming from the SITL not the gazebo and since its diffrent physics it had diffrent values. the EKF was getting confused and resting.

problem only arrised when the ROV was moving.

1 Like