« Back to documentation index
IMU Class Reference
This is a device driver class for the ST LSM9DS1 inertial measurement unit.
More...
#include <IMU.h >
Detailed Description
This is a device driver class for the ST LSM9DS1 inertial measurement unit.
Definition at line 21 of file IMU.h .
Constructor & Destructor Documentation
IMU
(
SPI &
spi ,
DigitalOut &
csAG ,
DigitalOut &
csM
)
Creates an IMU object.
Parameters:
spi a reference to an spi controller to use.
csAG the chip select output for the accelerometer and the gyro sensor.
csM the chip select output for the magnetometer.
Definition at line 29 of file IMU.cpp .
Deletes the IMU object.
Definition at line 79 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 166 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 181 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 196 of file IMU.cpp .
Reads the gyroscope about the x-axis.
Returns: the rotational speed about the x-axis given in [rad/s].
Definition at line 121 of file IMU.cpp .
Reads the gyroscope about the y-axis.
Returns: the rotational speed about the y-axis given in [rad/s].
Definition at line 136 of file IMU.cpp .
Reads the gyroscope about the z-axis.
Returns: the rotational speed about the z-axis given in [rad/s].
Definition at line 151 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 211 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 226 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 241 of file IMU.cpp .