ME305Lab
|
Public Member Functions | |
def | __init__ (self, i2c) |
Create IMU driver with I2C in controller mode. More... | |
def | config_mode (self) |
Sets IMU to configuration mode. More... | |
def | IMU_mode (self) |
Sets IMU sensor to IMU fusion mode. More... | |
def | calib_status (self) |
Read calibration status byte from IMU, parse into individual statuses. More... | |
def | calib_read (self) |
Read calibration coefficients as array of packed binary data. More... | |
def | calib_write (self, offset_array) |
Write calibration coefficients to IMU registers from known binary data array. More... | |
def | euler_angle (self) |
Read Euler angles from IMU for feedback measurements. More... | |
def | angular_velo (self) |
Read angular velocities from IMU for feedback measurements. More... | |
Public Attributes | |
i2c | |
mag_stat | |
acc_stat | |
gyr_stat | |
sys_stat | |
roll | |
pitch | |
rollv | |
pitchv | |
def BNO055.BNO055.__init__ | ( | self, | |
i2c | |||
) |
Create IMU driver with I2C in controller mode.
This function is called upon initialization of BNO055 class. The I2C object will be passed into init, allowing for communication between the MCU and IMU sensor.
i2c | - I2C object, found in pyb library. |
def BNO055.BNO055.angular_velo | ( | self | ) |
Read angular velocities from IMU for feedback measurements.
Reads the data from IMU Euler angle velocity registers for roll and pitch velocity (heading not needed). Data is 4 bytes, and stored in bytearray 'buf'. Data is unpacked into two 16-bit integers, and converted to radians.
def BNO055.BNO055.calib_read | ( | self | ) |
Read calibration coefficients as array of packed binary data.
def BNO055.BNO055.calib_status | ( | self | ) |
Read calibration status byte from IMU, parse into individual statuses.
Reads the onboard calibration statuses from IMU registers. These have a value ranging from 0 (non calibrated) to 3 (fully calibrated).
def BNO055.BNO055.calib_write | ( | self, | |
offset_array | |||
) |
Write calibration coefficients to IMU registers from known binary data array.
offset_array | 22-byte-long bytearray containing calibration coefficients. |
def BNO055.BNO055.config_mode | ( | self | ) |
Sets IMU to configuration mode.
In configuration mode, the IMU can be read calibrated. This function is used by the functions calib_status and calib_read, to read and set the calibration constants stored in the IMU registers.
def BNO055.BNO055.euler_angle | ( | self | ) |
Read Euler angles from IMU for feedback measurements.
Reads the data from IMU Euler angle registers for roll and pitch (heading not needed). Data is 4 bytes, and stored in bytearray 'buf'. Data is unpacked into two 16-bit integers, and converted to radians.
def BNO055.BNO055.IMU_mode | ( | self | ) |
Sets IMU sensor to IMU fusion mode.
In IMU mode, the IMU will continuously compute data from each axis, which will be outputted and read by the MCU.