Yaw Estimate Discontinuity

I am attempting to use a drone to map a structure. To perform this mapping, I use the yaw estimate of the drone to generate a point cloud from stereo depth information. My issue is that the drone’s yaw estimate acquires a discontinuity in the middle of the mapping process. A representative log can be accessed here:

https://review.px4.io/plot_app?log=2bb4519d-ffaa-4605-9cbd-98da907e5445

As can be seen in the log, the yaw estimate of the drone jumps from ~92 degrees to ~111 degrees just after the 2:07 timestamp.

I have taken the following steps to debug this issue:

  • Disabled GPS fusion. Yaw data is therefore provided only by the magnetometer. (The drone position estimate is provided by an external vision system. This system does not provide the drone with any attitude estimate, and it uses the drone’s attitude estimate in a pre-flight calibration routine to align the external vision system’s coordinate system with the local NED coordinate system.)
  • Set the EKF2_MAG_TYPE to 1, so that only magnetic heading fusion is performed
  • Performed a compass calibration

Any insight about why this yaw estimate discontinuity exists would be very helpful!

Thanks.