Helper class for controlling the Mpu.
More...
#include <RBCXMpu.h>
Helper class for controlling the Mpu.
◆ clearCalibrationData()
void rb::Mpu::clearCalibrationData |
( |
| ) |
|
Clears the data recorded by setCalibrationData.
◆ getAcc()
Get the Mpu acceleration data.
- Returns
- The Mpu acceleration data in Gs.
◆ getAccX()
float rb::Mpu::getAccX |
( |
| ) |
|
Get the Mpu acceleration data on the X axis.
- Returns
- The Mpu acceleration data on the X axis in Gs.
◆ getAccY()
float rb::Mpu::getAccY |
( |
| ) |
|
Get the Mpu acceleration data on the Y axis.
- Returns
- The Mpu acceleration data on the Y axis in Gs.
◆ getAccZ()
float rb::Mpu::getAccZ |
( |
| ) |
|
Get the Mpu acceleration data on the Z axis.
- Returns
- The Mpu acceleration data on the Z axis in Gs.
◆ getAngle()
Get the Mpu angle data.
- Returns
- The Mpu angle data in degrees.
◆ getAngleX()
float rb::Mpu::getAngleX |
( |
| ) |
|
Get the Mpu angle data on the X axis.
- Returns
- The Mpu angle data on the X axis in degrees.
◆ getAngleY()
float rb::Mpu::getAngleY |
( |
| ) |
|
Get the Mpu angle data on the Y axis.
- Returns
- The Mpu angle data on the Y axis in degrees.
◆ getAngleZ()
float rb::Mpu::getAngleZ |
( |
| ) |
|
Get the Mpu angle data on the Z axis.
The Z angle is relative to the original heading of the robot at the start of the program, or after latest resetAngleZ() call, NOT to geographic north.
- Returns
- The Mpu angle data on the Z axis in degrees.
◆ getCompressCoef()
uint8_t rb::Mpu::getCompressCoef |
( |
| ) |
|
Get the Mpu compression coefficient (1 - 20).
- Returns
- The Mpu compression coefficient.
◆ getGyro()
Get the Mpu gyroscope data.
- Returns
- The Mpu gyroscope data in degrees per second.
◆ getGyroX()
float rb::Mpu::getGyroX |
( |
| ) |
|
Get the Mpu gyroscope data on the X axis.
- Returns
- The Mpu gyroscope data on the X axis in degrees per second.
◆ getGyroY()
float rb::Mpu::getGyroY |
( |
| ) |
|
Get the Mpu gyroscope data on the Y axis.
- Returns
- The Mpu gyroscope data on the Y axis in degrees per second.
◆ getGyroZ()
float rb::Mpu::getGyroZ |
( |
| ) |
|
Get the Mpu gyroscope data on the Z axis.
- Returns
- The Mpu gyroscope data on the Z axis in degrees per second.
◆ init()
Initialize the Mpu. This function must be called before using the Mpu. It will send a request to the coprocessor to initialize the Mpu.
◆ resetAngleZ()
void rb::Mpu::resetAngleZ |
( |
| ) |
|
◆ sendOne()
void rb::Mpu::sendOne |
( |
| ) |
|
Send a one shot request to the coprocessor to get the Mpu data. The data will be available in the get functions. To get the data continuously, use the sendStart()
function.
◆ sendStart()
void rb::Mpu::sendStart |
( |
| ) |
|
Start sending the Mpu data continuously to the coprocessor. The data will be available in the get functions. To stop the continuous sending, use the sendStop()
function.
◆ sendStop()
void rb::Mpu::sendStop |
( |
| ) |
|
Stop sending the Mpu data continuously to the coprocessor. To start the continuous sending, use the sendStart()
function.
◆ setCalibrationData()
void rb::Mpu::setCalibrationData |
( |
| ) |
|
Records current Gyro and Accelerometer data as "start" position and subtracts it from future readings.
◆ setCompressCoef()
void rb::Mpu::setCompressCoef |
( |
uint8_t |
coef | ) |
|
Set the Mpu compression coefficient (10 - 20). It is used to reduce sending interval. The Mpu data are summed up and sent every interval * coef
ms.
- Parameters
-
coef | The Mpu compression coefficient. |
◆ Manager
The documentation for this class was generated from the following files: