Hi!

I'm relying on the magnetometer for my application. However, its current outputs are not useful, e.g.

  • Just restarting the cam gives magnetometer values of +-10 degrees difference
  • When driving around and rotating, the values drift
  • I'm comparing to course over ground and it almost never aligns (when going straight)

I'd want to calibrate the magnetometer using tutorials as such:

(8) How to Calibrate a Magnetometer | Digi-Key Electronics - YouTube

However, I'm unsure where I could add these values such that the IMU can use that for its own computation. E.g., I want the rotation vector from the IMU which is computed on the IMU I believe. Is there a way to do that?

Thanks a lot!

  • erik replied to this.

    Hi BenjaminKiefer ,
    There are 3 different magnetometer sensors available which you can use, mentioned below. If you have additional user-calibration you'd want to apply, you'd need to apply that either on host computer, or inside Script node, as IMU doesn't allow custom user-calibration.
    Thanks, Erik

     /**
         * Section 2.1.3
         *
         * Magnetic field measurement without any postprocessing, straight from the sensor.
         * Units are [uTesla]
         */
        MAGNETOMETER_RAW = 0x16,
        /**
         * Section 2.1.3
         *
         * The fully calibrated magnetic field measurement.
         * Units are [uTesla]
         */
        MAGNETOMETER_CALIBRATED = 0x03,
        /**
         * Section 2.1.3
         *
         * The magnetic field measurement without hard-iron offset applied.
         * Units are [uTesla]
         */
        MAGNETOMETER_UNCALIBRATED = 0x0f,

    Thanks for your reply!

    Essentially, I need a precise rotation vector with absolute heading (referenced to magnetic north).

    However, the measurements I get often times are completely wrong and always noisy. I wondered whether I can calibrate the magnetometer to account for hard and soft iron magnetic compensation.

    So, am I correct in the conclusion that I'd have to take either of these three variables and compute magnetic north separately (with calibration parameters included)?

    Thanks!

    • erik replied to this.

      Thanks for the resources.

      I've also looked at some resources that describe how to calibrate the sensor based on the raw microtesla measurements. However, I also read that many of the easier approaches might not really reliably work and instead some more advanced methods, such as Kalman filter smoothing (combined with accelerometer/gyrometer), need to be implemented.

      Hence, I was hoping for a calibration procedure that already changes parameters inside the IMU, so that I can still rely on the (stabilized) rotation vector I can get from it.

      Anyways, thank you!