How to start with the IMU module

This guide contains all the basic notions you will need to use the IMU module.

IMU module category


Sensor modules are able to measure physical world environment.

How to use your IMU module with Pyluos

To control your IMU module, you have to connect it to a Luos network and connect this network through a communication module to Pyluos.

Then you can access to your module and control it.

IMU module can measure:

  • Compass – magnetic field data in micro tesla on each axis
  • Gyro – X, Y, Z axis rotational acceleration data in degrees per second
  • Accel – X, Y, Z axis linear acceleration data in Gees
  • Heading – 360 degrees from North with Y+ axis as the pointer
  • Rotational Matrix – linear math 9 element matrix representation
  • Euler Angles – Pitch, roll, yaw based in degrees with frame reference
  • Quaternions – sensor fused w, x, y, z rotational angles
  • Linear Acceleration – linear acceleration in body frame coordinates
  • Gravity Vector – Which access gravity effects
  • Pedometer – step number
  • walk time – duration (second) of the walk

By default the module will send you only quaternions to keep the number of data low and avoid bus congestion. Retrieving any other type of measure requires to enable it first.

The easiest way to enable a measure is by using it, pyluos enables automatically a called measure. For example, to retrieve the linear acceleration value when it’s disable, you simply have to execute:

This command is really simple but doesn’t allow you to disable the value after using it in order to keep your robot responsive. Another way to enable or disable a value is to set it to True or false. For example, if now you want to disable the linear acceleration measure previously activated, you can execute:

If you are using ipython notebook you can use the control() command available for each module. This command will list all available data from your module and you can see witch one is enabled and clic on it to enable or disable it:

Example of use of your IMU module using Ipython notebook

In this example, we will display in 3D the sensor rotation using quaternions. In order to do that, we will use the pythreejs lib and ipython notebook.

First, we have to install and enable this library by following these commands on a terminal:

Now, restart ipython notebook and add this code to a new python script:

You should have something like that: