BA / Mbed OS BaBoRo1
Embed: (wiki syntax)

« Back to documentation index

IMU Class Reference

IMU Class Reference

This is a device driver class for the ST LSM9DS1 inertial measurement unit. More...

#include <IMU.h>

Public Member Functions

 IMU (SPI &spi, DigitalOut &csAG, DigitalOut &csM)
 Creates an IMU object.
virtual ~IMU ()
 Deletes the IMU object.
float readGyroX ()
 Reads the gyroscope about the x-axis.
float readGyroY ()
 Reads the gyroscope about the y-axis.
float readGyroZ ()
 Reads the gyroscope about the z-axis.
float readAccelerationX ()
 Reads the acceleration in x-direction.
float readAccelerationY ()
 Reads the acceleration in y-direction.
float readAccelerationZ ()
 Reads the acceleration in z-direction.
float readMagnetometerX ()
 Reads the magnetic field in x-direction.
float readMagnetometerY ()
 Reads the magnetic field in x-direction.
float readMagnetometerZ ()
 Reads the magnetic field in x-direction.

Detailed Description

This is a device driver class for the ST LSM9DS1 inertial measurement unit.

Definition at line 18 of file IMU.h.


Constructor & Destructor Documentation

IMU ( SPI &  spi,
DigitalOut &  csAG,
DigitalOut &  csM 
)

Creates an IMU object.

Parameters:
spia reference to an spi controller to use.
csAGthe chip select output for the accelerometer and the gyro sensor.
csMthe chip select output for the magnetometer.

Definition at line 27 of file IMU.cpp.

~IMU (  ) [virtual]

Deletes the IMU object.

Definition at line 66 of file IMU.cpp.


Member Function Documentation

float readAccelerationX (  )

Reads the acceleration in x-direction.

Returns:
the acceleration in x-direction, given in [m/s2].

Definition at line 148 of file IMU.cpp.

float readAccelerationY (  )

Reads the acceleration in y-direction.

Returns:
the acceleration in y-direction, given in [m/s2].

Definition at line 162 of file IMU.cpp.

float readAccelerationZ (  )

Reads the acceleration in z-direction.

Returns:
the acceleration in z-direction, given in [m/s2].

Definition at line 176 of file IMU.cpp.

float readGyroX (  )

Reads the gyroscope about the x-axis.

Returns:
the rotational speed about the x-axis given in [rad/s].

Definition at line 106 of file IMU.cpp.

float readGyroY (  )

Reads the gyroscope about the y-axis.

Returns:
the rotational speed about the y-axis given in [rad/s].

Definition at line 120 of file IMU.cpp.

float readGyroZ (  )

Reads the gyroscope about the z-axis.

Returns:
the rotational speed about the z-axis given in [rad/s].

Definition at line 134 of file IMU.cpp.

float readMagnetometerX (  )

Reads the magnetic field in x-direction.

Returns:
the magnetic field in x-direction, given in [Gauss].

Definition at line 190 of file IMU.cpp.

float readMagnetometerY (  )

Reads the magnetic field in x-direction.

Returns:
the magnetic field in x-direction, given in [Gauss].

Definition at line 204 of file IMU.cpp.

float readMagnetometerZ (  )

Reads the magnetic field in x-direction.

Returns:
the magnetic field in x-direction, given in [Gauss].

Definition at line 218 of file IMU.cpp.