Mag Device ID Mapping Issue with Multiple EKF Instances

We’ve been running into an issue on PX4 v1.15 where the EKF2 estimator appears to be incorrectly assigning magnetometer device IDs.

We’re using multiple EKF2 instances configured with 3 IMUs and 2 external magnetometers (connected over CAN). The system also has a third magnetometer on the autopilot itself, which we’ve disabled by setting CAL_MAG0_PRIO = 0. The two external mags are assigned high priorities (CAL_MAG1_PRIO = 75, CAL_MAG2_PRIO = 75).

However, the first three EKF instances are still assigned mag device ID 0, which appears to be an uninitialized or default value. The remaining three instances are correctly assigned to MAG1, one of the external magnetometers. Our intended behavior is for the first three EKF instances to use MAG1 and the next three to use MAG2.

Has anyone else run into this? Is there a known issue with how magnetometer device IDs are mapped across EKF instances when one is explicitly disabled?

I think this is a bit messy at this stage. I would consider manually preventing the internal mags from starting - assuming that’s what you want to do - in the startup script or rc.board_sensors for your board, and that way force using the ones you do want.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.