The gyroscope
A gyroscope measures angular velocity. A triaxial gyroscope gives the three components of the angular velocity of the body, expressed in the body frame . The sensors in phones and robots are micro-electro-mechanical systems (MEMS): a small mass vibrates at several kHz, and a rotation pushes it sideways in proportion to the rate, which is measured capacitively (Corke, 2023). Integrating the angular velocity gives orientation. If is the rotation from the body frame to the world frame at step and is held constant over the sample interval , the orientation one step later is where is the skew-symmetric matrix of and the matrix exponential is the rotation by angle about . This is the exponential map from the kinematics chapter, applied in the body frame because that is where the gyroscope measures.The accelerometer
An accelerometer is a proof mass on a spring. The spring holds the mass against gravity and against the body’s acceleration, so the displacement measures the difference between the two. With the world axis up and gravity m/s², a triaxial accelerometer reports the specific force the acceleration of the body minus gravity, rotated into the body frame. A robot standing still on a level floor has , so its accelerometer reads : an upward acceleration of one , although it is not moving. Some phone apps report the opposite sign, which adds to the confusion (Corke, 2023). To get position you invert this model. Rotate the reading into the world frame with the current orientation estimate, add gravity back, and integrate twice: The orientation enters this step. An error in rotates part of the 9.81 m/s² of gravity into the horizontal plane, where the integration treats it as acceleration. The code below implements both sensor models and this integration, which is called strapdown integration because the sensors are strapped to the body rather than held level by gimbals. The last line checks the sign convention on a robot at rest.Noise and bias
A common model for any one axis of an inertial sensor is where is the scale factor, the bias and random noise (Corke, 2023). Calibration can fix the scale factor. The bias causes most of the trouble: it differs from device to device, changes with temperature and wanders slowly over time. Integration turns each error into a growing one. White noise on the accelerometer, integrated twice, gives a position error that grows like . A constant accelerometer bias is worse: integrated twice it gives , so 0.05 m/s² becomes 2.5 m after 10 s and 90 m after a minute. A gyroscope bias acts through orientation. On a body that does not rotate, a bias about a horizontal axis tilts the orientation estimate by , and the tilt leaks m/s² of gravity into the horizontal acceleration. That error is integrated twice more, so the position error grows like . A robot that turns behaves differently, as the example below shows.Dead reckoning a TurtleBot from its IMU
The TurtleBot below drives a counterclockwise circle of radius 1.5 m at 0.2 m/s for 60 s, a little more than one lap. Its IMU samples at 200 Hz with the white noise of the course simulator’s TurtleBot3 IMU: 2e-4 rad/s on each gyro axis and 1.7e-2 m/s² on each accelerometer axis. The integration starts from the true pose and velocity, so every error that appears comes from the sensor. Four versions of the same drive differ only in the bias. The biases are illustrative, of the size the course simulator gives the D435i’s IMU: 3, -4 and 2 mrad/s on the gyro axes and 0.04, -0.03 and 0.05 m/s² on the accelerometer axes.References
- Corke, P. (2023). Robotics, vision and control: Fundamental algorithms in python.
Found an error on this page? Report an issue.

