Using a low-cost IMU – 10 degrees of freedom

In this section, we will learn to use a low-cost sensor with 10 degrees of freedom (DoF). This sensor, which is similar to Xsens MTi, has an accelerometer (x3), a magnetometer (x3), a barometer (x1), and a gyroscope (x3). It is controlled with a simple I2C interface, and in this example it will be connected to Arduino Nano (

This sensor is also used for similar uses. Xsens costs approximately $2,000, which is very expensive for normal users. The sensor explained in this section has an approximate cost of $20. The low price of this sensor permits its usage in a lot of projects.

You can see this sensor in the following image. It is thin and has few components. ...

Get Learning ROS for Robotics Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.