ME305Lab
Public Member Functions | Public Attributes | List of all members
BNO055.BNO055 Class Reference

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
 

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
i2c- I2C object, found in pyb library.

Member Function Documentation

◆ angular_velo()

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.

◆ calib_read()

def BNO055.BNO055.calib_read (   self)

Read calibration coefficients as array of packed binary data.

Returns
Returns calibration coefficients as 22-byte-long bytearray.

◆ calib_status()

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).

◆ calib_write()

def BNO055.BNO055.calib_write (   self,
  offset_array 
)

Write calibration coefficients to IMU registers from known binary data array.

Parameters
offset_array22-byte-long bytearray containing calibration coefficients.

◆ config_mode()

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.

◆ euler_angle()

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.

◆ IMU_mode()

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.


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