Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
IMUnamespace::MPU6050 Class Reference

Public Member Functions

 MPU6050 (int SensorNum, I2C_HandleTypeDef *I2CHandle)
 The constructor for the MPU6050 class, which initializes non-I/O members. More...
 
void init (uint8_t lpf)
 This function is used to initialize all aspects of the IMU which require I/O. More...
 
void Read_Gyroscope_Withoffset ()
 Reads the gyroscope with offsets without interrupts. More...
 
void Read_Gyroscope_Withoffset_IT ()
 Reads the gyroscope with interrupts and offsets. More...
 
void Read_Accelerometer_Withoffset ()
 Reads the accelerometer with offsets without interrupts. More...
 
void Read_Accelerometer_Withoffset_IT ()
 Reads the accelerometer with interrupts and offsets. More...
 
void Fill_Struct (IMUStruct *myStruct)
 Fills an IMUStruct. More...
 
 ~MPU6050 ()
 The MPU6050 desctructor. More...
 

Private Member Functions

int Write_Reg (uint8_t reg_addr, uint8_t data)
 Writes to a register from the MPU6050. More...
 
uint8_t Read_Reg (uint8_t reg_addr)
 Reads a byte from a register on the sensor, and stores it in the member variable received_byte. More...
 
BaseType_t Read_Data_IT (uint8_t Reg_addr, uint8_t *sensor_buffer)
 Reads 6 bytes from the sensor with interrupts, and stores them in the sensor_buffer. More...
 
uint8_t Read_Data (uint8_t Reg_addr, uint8_t *sensor_buffer)
 Reads 6 bytes from the sensor, and stores them in the sensor_buffer. More...
 
int Set_LPF (uint8_t lpf)
 Sets the offsets of the sensor. More...
 
void Manually_Set_Offsets (int SensorNum)
 Sets the offsets of the sensor. More...
 

Private Attributes

uint16_t _Sample_Rate
 
I2C_HandleTypeDef * _I2C_Handle
 
float _x_Gyro
 
float _y_Gyro
 
float _z_Gyro
 
float _x_Accel
 
float _y_Accel
 
float _z_Accel
 
float _x_GyroOffset
 
float _y_GyroOffset
 
float _z_GyroOffset
 
float _x_AccelOffset
 
float _y_AccelOffset
 
float _z_AccelOffset
 
uint8_t received_byte
 

Detailed Description

Definition at line 45 of file MPU6050.h.

Constructor & Destructor Documentation

◆ ~MPU6050()

IMUnamespace::MPU6050::~MPU6050 ( )
inline

The MPU6050 desctructor.

Parameters
None
Returns
None

Definition at line 103 of file MPU6050.h.

Member Function Documentation

◆ Manually_Set_Offsets()

void IMUnamespace::MPU6050::Manually_Set_Offsets ( int  SensorNum)
inlineprivate

Sets the offsets of the sensor.

Parameters
SensorNumThe integer ID of the sensor being used
Returns
None

Definition at line 152 of file MPU6050.h.

Here is the caller graph for this function:

Member Data Documentation

◆ _x_Accel

float IMUnamespace::MPU6050::_x_Accel
private

x-axis acceleration read from sensor

Definition at line 169 of file MPU6050.h.

◆ _x_Gyro

float IMUnamespace::MPU6050::_x_Gyro
private

x-axis angular velocity read from sensor

Definition at line 166 of file MPU6050.h.

◆ _y_Accel

float IMUnamespace::MPU6050::_y_Accel
private

y-axis acceleration read from sensor

Definition at line 170 of file MPU6050.h.

◆ _y_Gyro

float IMUnamespace::MPU6050::_y_Gyro
private

y-axis angular velocity read from sensor

Definition at line 167 of file MPU6050.h.

◆ _z_Accel

float IMUnamespace::MPU6050::_z_Accel
private

z-axis acceleration read from sensor

Definition at line 171 of file MPU6050.h.

◆ _z_Gyro

float IMUnamespace::MPU6050::_z_Gyro
private

z-axis angular velocity read from sensor

Definition at line 168 of file MPU6050.h.


The documentation for this class was generated from the following files: