BNO055 class for the IMU containing modes of operation, initialization, and reading data.
More...
#include <bno055.h>
|
| | BNO055 (I2C_HandleTypeDef *hi2c, uint8_t addr=0x28) |
| | Constructor Function to initialize the BNO055 Class.
|
| bool | init_imu (REG mode=REG::NDOF) |
| | Function handles the configuration and initialization of the BNO055 IMU.
|
| bool | updateEuler () |
| | Function Updates the Euler values based on the IMU's current readings. Roll Pitch, and Yaw are updated within the class.
|
| bool | readCalibStatus (uint8_t &sys, uint8_t &gyro, uint8_t &accel, uint8_t &mag) |
| | Function Checks the Calibration status of the IMU and individual sensors.
|
| bool | updateGyro () |
| | Function pull they data from the gyroscope retrieving angular velocities.
|
| int16_t | getYawRateZ () |
| | Function allows users to retrieve the yaw rate around the Z axis.
|
| int16_t | getYaw () |
| | Function allows for the user to get the current yaw value.
|
| int16_t | getRoll () |
| | Function allows for the user to get the current roll value.
|
| int16_t | getPitch () |
| | Function allows for the user to get the current pitch value.
|
|
| bool | writeByte (uint8_t reg, uint8_t value) |
| | Function writes values to the specified register given by the user.
|
| bool | readLen (uint8_t reg, uint8_t *buffer, uint8_t len) |
| | Function reads the current value of the specified register given by the user.
|
BNO055 class for the IMU containing modes of operation, initialization, and reading data.
◆ REG
Enumerated class REG of the IMU modes that will be used.
| Enumerator |
|---|
| CONFIG_MODE | Configuration Mode CONFIG_MODE
|
| IMU | Normal IMU Mode IMU
|
| NDOF | Fusion Mode NDOF
|
◆ BNO055()
| BNO055::BNO055 |
( |
I2C_HandleTypeDef * | hi2c, |
|
|
uint8_t | addr = 0x28 ) |
Constructor Function to initialize the BNO055 Class.
◆ getPitch()
| int16_t BNO055::getPitch |
( |
| ) |
|
Function allows for the user to get the current pitch value.
- Returns
- int16_t
◆ getRoll()
| int16_t BNO055::getRoll |
( |
| ) |
|
Function allows for the user to get the current roll value.
- Returns
- int16_t
◆ getYaw()
| int16_t BNO055::getYaw |
( |
| ) |
|
Function allows for the user to get the current yaw value.
- Returns
- int16_t
◆ getYawRateZ()
| int16_t BNO055::getYawRateZ |
( |
| ) |
|
Function allows users to retrieve the yaw rate around the Z axis.
- Returns
- int16_t
◆ init_imu()
Function handles the configuration and initialization of the BNO055 IMU.
- Parameters
-
| mode | Parameter for determining what mode to operate the IMU at see REG modes |
- Returns
- Boolean
◆ readCalibStatus()
| bool BNO055::readCalibStatus |
( |
uint8_t & | sys, |
|
|
uint8_t & | gyro, |
|
|
uint8_t & | accel, |
|
|
uint8_t & | mag ) |
Function Checks the Calibration status of the IMU and individual sensors.
- Parameters
-
| sys | Parameter for a reference to the system calibration status |
| gyro | Parameter for a reference to the gyro calibration status |
| accel | Parameter for a reference to the accel calibration status |
| mag | Parameter for a reference to the mag calibration status |
- Returns
- True upon successful readings
◆ readLen()
| bool BNO055::readLen |
( |
uint8_t | reg, |
|
|
uint8_t * | buffer, |
|
|
uint8_t | len ) |
|
private |
Function reads the current value of the specified register given by the user.
- Parameters
-
| reg | Parameter that takes in a register to read from |
| buffer | Parameter that takes in a data buffer to read the data from the select register |
| len | Parameter that specifies the length of the incoming data |
- Returns
- Boolean
◆ updateEuler()
| bool BNO055::updateEuler |
( |
| ) |
|
Function Updates the Euler values based on the IMU's current readings. Roll Pitch, and Yaw are updated within the class.
- Returns
- Boolean
◆ updateGyro()
| bool BNO055::updateGyro |
( |
| ) |
|
Function pull they data from the gyroscope retrieving angular velocities.
- Returns
- Boolean
◆ writeByte()
| bool BNO055::writeByte |
( |
uint8_t | reg, |
|
|
uint8_t | value ) |
|
private |
Function writes values to the specified register given by the user.
- Parameters
-
| reg | Parameter that takes in a register value to write to |
| value | Parameter that takes in the data to write to the specified register |
- Returns
- Boolean
◆ addr
Private variable addr. Holds the imu device specific address (0x28 or 0x29)
◆ gyroX
Private variable gyroX. Holds the X data read from the IMU's gyroscope
◆ gyroY
Private variable gyroY. Holds the Y data read from the IMU's gyroscope
◆ gyroZ
Private variable gyroZ. Holds the Z data read from the IMU's gyroscope
◆ hi2c
| I2C_HandleTypeDef* BNO055::hi2c |
|
private |
Private Variable hi2c. Sets the I2C definition fromt the STM32 HAL Config
◆ pitch
Private variable pitch. Holds the pitch data read from the IMU
◆ roll
Private variable roll. Holds the roll data read from the IMU
◆ yaw
Private variable yaw. Holds the yaw data read from the IMU
The documentation for this class was generated from the following files:
- C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/Inc/bno055.h
- C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/src/bno055.cpp