The IMU class is responsible for using the 3 built in sensors of the IMU to generate the inertial/positional coordinates of the device. More...
Public Member Functions | |
def | __init__ (self, BUS_ADDR, DEV_ADDR) |
Defins IMU class @Details Enables positional feedback through an IMU sensor. More... | |
def | enable (self) |
This method enables the IMU by initializing the previously created object and setting it in master mode. More... | |
def | disable (self) |
This method disables the IMU by deinitializing the previously created class object. More... | |
def | calib_stat (self) |
This method simply runs an infinite loop that first provides the user with calibration instructions, and then keeps providing the user with feedback on calibration progress until it's complete. More... | |
def | set_mode (self, mode) |
This method sets the mode of the IMU between different sensors or fusion modes that manipulate which sensors of the IMU are active. More... | |
def | orientation (self) |
This method extracts, converts, and calculates the Euler angle values of the IMU. More... | |
def | velocity (self) |
This method extracts, converts, and calculates the angular velocity values of the IMU. More... | |
Public Attributes | |
cal_stat | |
cal_stat stores the calibration values for the three sensors on board the IMU More... | |
Eu_angles | |
Eu_angles stores the extracted, converted and calculates values for the current IMU Euler angle positions. More... | |
AV_velocity | |
AV_velocity stores the redundantly named object that contains the extracted, converted, and caclulated values of angular velocity about each coordinate axis. More... | |
The IMU class is responsible for using the 3 built in sensors of the IMU to generate the inertial/positional coordinates of the device.
The accelerometer provides angular velocity data while the magnetometer and gyroscope provide spatial coordinate data which dictates the position of the IMU. This class is responsible for enabling or disabling an IMU object that has been created. Once it has been calibrated, it will continuously return values for the angular position and angular velocity of the IMU every two seconds.
def IMU_Controller.IMU.__init__ | ( | self, | |
BUS_ADDR, | |||
DEV_ADDR | |||
) |
Defins IMU class @Details Enables positional feedback through an IMU sensor.
Initialization method which imports all required libraries, declares variables, and sets them equal to appropriate initial conditions. For readability of code, the I2C class of the pyb class is specifically imported. Also, the variables passed along as arguments are redeclared with underscores so they are not public attributes.
BUS_ADDR | This argument passes along the bus address of the IMU being used |
DEV_ADDR | This argument passes along the device address of the IM |
def IMU_Controller.IMU.calib_stat | ( | self | ) |
This method simply runs an infinite loop that first provides the user with calibration instructions, and then keeps providing the user with feedback on calibration progress until it's complete.
The calibration vector contains the system, gyroscope, accelerometer, and magnetometer calibration values respectively.
def IMU_Controller.IMU.disable | ( | self | ) |
This method disables the IMU by deinitializing the previously created class object.
In order to reuse it, the object would have to be re-created instead of just re-enabling.
def IMU_Controller.IMU.enable | ( | self | ) |
def IMU_Controller.IMU.orientation | ( | self | ) |
This method extracts, converts, and calculates the Euler angle values of the IMU.
def IMU_Controller.IMU.set_mode | ( | self, | |
mode | |||
) |
This method sets the mode of the IMU between different sensors or fusion modes that manipulate which sensors of the IMU are active.
Most commonly and for purposes of this lab, the NDOF mode was used because it provided the most accurate data of the IMU's position and velocity.
mode | This argument passes along the desired mode to set the IMU object to, as extracted from the bno055 data sheet |
def IMU_Controller.IMU.velocity | ( | self | ) |
This method extracts, converts, and calculates the angular velocity values of the IMU.
IMU_Controller.IMU.AV_velocity |
AV_velocity stores the redundantly named object that contains the extracted, converted, and caclulated values of angular velocity about each coordinate axis.
AV_velocity is a 3-value tuple that contains angular velocity with respect to the XYZ axes in units of degrees/second This value is divided by the same gain as the Euler angles to achieve these units.
IMU_Controller.IMU.cal_stat |
cal_stat stores the calibration values for the three sensors on board the IMU
cal_stat specifically stores the status of system calibration, gryoscope calibration, accelerometer calibration, and magnetometer calibration as values between 0-3 in a row vector. It dictates whether each sensor, and the system overall is finished calibrating. A 0 indicates an uncalibrated element while a three indicates a fully calibrated element.
IMU_Controller.IMU.Eu_angles |
Eu_angles stores the extracted, converted and calculates values for the current IMU Euler angle positions.
The Eu_angles object stores the result of dividing the euler values by the appropriate gain to achieve the desired unitset output. More specifically, this project uses units of degrees for angle measurements. This object is stored as a 3 value tuple.