-
Notifications
You must be signed in to change notification settings - Fork 1
IMU calibration
This tutorial explains how Ridgeback's compass works and how to calibrate it for top performance.
Ridgeback includes an IMU, which allows it to estimate its own orientation in space. This is achieved using a combination of three sensors: a gyroscope, an accelerometer, and a magnetometer. These measure, respectively: angular motion, acceleration, and magnetic field. The angular motion is integrated to achieve a relative estimate, which is then anchored to two absolute reference points: the gravity vector as supplied by the accelometer, and the magnetic field vector as supplied by the magnetometer.
Unfortunately, although gravity is pretty consistent about pointing down, the magnetic reference vector has an offset due to declination, and is also highly subject to disturbance. There’s little that can be done for a disturbance outside Ridgeback (for example, driving near a strong magnetic field), but the effect of magnetic fields onboard Ridgeback from the battery, motors, sheet metal parts, etc, can be reduced by calibration.
Calibrating Ridgeback's magnetometer is a straightforward process. For best performance, it’s recommended to perform this operation on a seasonal basis.
To run the calibration routine, connect to Ridgeback by SSH, and execute:
rosrun ridgeback_base calibrate_compass
Ridgeback should rotate slowly in place for 60 seconds, recording magnetometer data.
The output will be:
Started rosbag record, duration 60 seconds, pid [6793]
Started motion commands, pid [6794]
[ INFO] [1417463864.452760841]: Subscribing to /tf
[ INFO] [1417463864.457840117]: Subscribing to /imu/rpy/raw
[ INFO] [1417463864.462399042]: Subscribing to /imu/data_raw
[ INFO] [1417463864.466624735]: Subscribing to /imu/mag
[ INFO] [1417463864.474944762]: Recording to /tmp/calibrate_compass.xxxx/imu_record.bag.
Test underway.
Time remaining: 0
Shutting down motion command publisher.
Waiting for rosbag to shut down.
Computing magnetic calibration.
Calibration generated in /tmp/calibrate_compass.g8oM/mag_config.yaml.
Restart ROS service to begin using saved calibration.
Once complete, you will be prompted to enter the user password in order to save the new calibration into $ROS_ETC_DIR. Once this is done, restart the ROS service to begin using the new calibration:
sudo service ridgeback restart
Calibration should be performed when Ridgeback is received, and any time the platform is modified by adding new peripherals. It is also recommended to recalibrate annually as part of seasonal maintenance.
This guide is based on the instructions present in the Clearpath Support Tutorials for their robots Ridgeback, Husky, Jackal, and Kingfisher.