Hello,
I would like to have more info about IMU calibration, if there is any documentation about that.
I want to use the magnetometer from my OAK-D W POE (IMU type: BNO086), but my values are fluctuating a lot, even after switching from MAGNETOMETER_RAW to MAGNETOMETER_CALIBRATED. What is supposed to be the difference between these values? Is it possible to calibrate the sensor on my side based on my environment?
import depthai as dai
pipeline = dai.Pipeline()
imu = pipeline.create(dai.node.IMU)
xlinkOut = pipeline.create(dai.node.XLinkOut)
xlinkOut.setStreamName("imu")
imu.enableIMUSensor(dai.IMUSensor.ACCELEROMETER, 500)
imu.enableIMUSensor(dai.IMUSensor.GYROSCOPE_CALIBRATED, 400)
imu.enableIMUSensor(dai.IMUSensor.MAGNETOMETER_CALIBRATED, 100)
imu.setBatchReportThreshold(1)
imu.setMaxBatchReports(10)
imu.out.link(xlinkOut.input)
with dai.Device(pipeline) as device:
imuQueue = device.getOutputQueue(name="imu", maxSize=50, blocking=False)
print("Starting node")
while True:
imuData = imuQueue.get()
imuPackets = imuData.packets
for imuPacket in imuPackets:
acceleroValues = imuPacket.acceleroMeter
gyroValues = imuPacket.gyroscope
magnetometerValues = imuPacket.magneticField
m_x = magnetometerValues.x
m_y = magnetometerValues.y
m_z = magnetometerValues.z
print(f"X: {m_x}, Y: {m_y}, Z: {m_z}")