3#include <freertos/FreeRTOS.h>
170 TickType_t m_lastTicks;
172 uint8_t m_compressCoef;
178 void setState(
const CoprocStat_MpuStat& msg);
179 void calculateAcc(
const CoprocStat_MpuVector& accel);
180 void calculateGyro(
const CoprocStat_MpuVector& gyro);
181 void calculateAngle();
183 float wrap(
float angle,
float limit);
185 void sendMpuReq(CoprocReq_MpuReq mpuReq);
The main library class for working with the RBCX board. Call the install() method at the start of you...
Definition: RBCXManager.h:61
Helper class for controlling the Mpu.
Definition: RBCXMpu.h:33
void sendStop()
Stop sending the Mpu data continuously to the coprocessor. To start the continuous sending,...
Definition: RBCXMpu.cpp:52
MpuVector getGyro()
Get the Mpu gyroscope data.
Definition: RBCXMpu.cpp:165
float getGyroY()
Get the Mpu gyroscope data on the Y axis.
Definition: RBCXMpu.cpp:167
MpuVector getAngle()
Get the Mpu angle data.
Definition: RBCXMpu.cpp:170
float getGyroZ()
Get the Mpu gyroscope data on the Z axis.
Definition: RBCXMpu.cpp:168
MpuVector getAcc()
Get the Mpu acceleration data.
Definition: RBCXMpu.cpp:160
void setCalibrationData()
Records current Gyro and Accelerometer data as "start" position and subtracts it from future readings...
Definition: RBCXMpu.cpp:69
void resetAngleZ()
Definition: RBCXMpu.cpp:147
void clearCalibrationData()
Clears the data recorded by setCalibrationData.
Definition: RBCXMpu.cpp:65
void sendOne()
Send a one shot request to the coprocessor to get the Mpu data. The data will be available in the get...
Definition: RBCXMpu.cpp:40
float getAccZ()
Get the Mpu acceleration data on the Z axis.
Definition: RBCXMpu.cpp:163
float getGyroX()
Get the Mpu gyroscope data on the X axis.
Definition: RBCXMpu.cpp:166
float getAngleZ()
Get the Mpu angle data on the Z axis.
Definition: RBCXMpu.cpp:173
float getAngleY()
Get the Mpu angle data on the Y axis.
Definition: RBCXMpu.cpp:172
void init()
Initialize the Mpu. This function must be called before using the Mpu. It will send a request to the ...
Definition: RBCXMpu.cpp:34
float getAccX()
Get the Mpu acceleration data on the X axis.
Definition: RBCXMpu.cpp:161
uint8_t getCompressCoef()
Get the Mpu compression coefficient (1 - 20).
Definition: RBCXMpu.cpp:185
float getAngleX()
Get the Mpu angle data on the X axis.
Definition: RBCXMpu.cpp:171
void setCompressCoef(uint8_t coef)
Set the Mpu compression coefficient (10 - 20). It is used to reduce sending interval....
Definition: RBCXMpu.cpp:175
void sendStart()
Start sending the Mpu data continuously to the coprocessor. The data will be available in the get fun...
Definition: RBCXMpu.cpp:46
float getAccY()
Get the Mpu acceleration data on the Y axis.
Definition: RBCXMpu.cpp:162
Definition: RBCXAngle.cpp:3
MpuVector accel
Definition: RBCXMpu.h:26
MpuVector gyro
Definition: RBCXMpu.h:27
MpuVector gyro
Definition: RBCXMpu.h:20
MpuVector angleAcc
Definition: RBCXMpu.h:22
MpuVector angle
Definition: RBCXMpu.h:21
MpuVector accel
Definition: RBCXMpu.h:19
float z
Definition: RBCXMpu.h:15
float x
Definition: RBCXMpu.h:13
MpuVector()
Definition: RBCXMpu.h:9
float y
Definition: RBCXMpu.h:14