ME 405 Romi
Loading...
Searching...
No Matches
imu.IMU Class Reference

Initializes IMU Sensor. More...

Classes

class  reg
 Register Class. More...

Public Member Functions

 __init__ (self, i2c)
 Initialization.
 euler (self)
 Read Euler Angles.
 calibration_check (self)
 Check IMU Calibration.
 calibration_check_sys (self)
 Check System Calibration.
 calibration_check_gyro (self)
 Check Gyroscope Calibration.
 calibration_check_accel (self)
 Check Accelerometer Calibration.
 calibration_check_mag (self)
 Check Magnetometer Calibration.
 get_calibration_coeff_accel (self)
 Get the Accelerometer Calibration Coefficients.
 get_calibration_coeff_mag (self)
 Get the Magnetometer Calibration Coefficients.
 get_calibration_coeff_gyro (self)
 Get the Gyroscope Calibration Coefficients.
 get_calibration_coeff (self)
 Get the Accelerometer, Magnetometer and Gyroscope Calibration Coefficients Method.
 change_mode (self, mode)
 Change the IMU Operating Mode.
 write_calibration_coeff (self, coef1, coef2, coef3, coef4, coef5, coef6, coef7, coef8, coef9, coef10, coef11)
 Write Calibration Coefficients.
 get_Euler_x (self)
 Get Euler x data.
 get_Euler_y (self)
 Get Euler Y data.
 get_Euler_z (self)
 Get Euler Z data.
 get_Yaw_Velocity (self)
 Get Yaw Angular Velocity data.
 get_Roll_Velocity (self)
 Get Roll Angular Velocity data.
 get_Pitch_Velocity (self)
 Get Pitch Angular Velocity data.

Static Public Attributes

int DEV_ADDR = 0x28

Protected Member Functions

 _read_reg (self, reg)
 Read Register.

Protected Attributes

 _buf = bytearray((0 for n in range(22)))
 _i2c = i2c
 _buf_8 = bytearray((0))

Detailed Description

Initializes IMU Sensor.

This class manages the IMU sensors for romi.

Definition at line 7 of file imu.py.

Constructor & Destructor Documentation

◆ __init__()

imu.IMU.__init__ ( self,
i2c )

Initialization.

Parameters
P1I2C Object

Definition at line 45 of file imu.py.

Member Function Documentation

◆ _read_reg()

imu.IMU._read_reg ( self,
reg )
protected

Read Register.

Helper method to get data from the IMU

Parameters
P1IMU register adresss

Definition at line 58 of file imu.py.

Here is the caller graph for this function:

◆ calibration_check()

imu.IMU.calibration_check ( self)

Check IMU Calibration.

Returns the Caliration status of the System, Gyroscope, Accelerometer and Magnetometer

Value of 3 means fully calibrated

Definition at line 87 of file imu.py.

Here is the call graph for this function:

◆ calibration_check_accel()

imu.IMU.calibration_check_accel ( self)

Check Accelerometer Calibration.

Returns the Caliration status of the Accelerometer

Value of 3 means fully calibrated

Definition at line 122 of file imu.py.

Here is the call graph for this function:

◆ calibration_check_gyro()

imu.IMU.calibration_check_gyro ( self)

Check Gyroscope Calibration.

Returns the Caliration status of the Gyroscope

Value of 3 means fully calibrated

Definition at line 112 of file imu.py.

Here is the call graph for this function:

◆ calibration_check_mag()

imu.IMU.calibration_check_mag ( self)

Check Magnetometer Calibration.

Returns the Caliration status of the Magnetometer

Value of 3 means fully calibrated

Definition at line 132 of file imu.py.

Here is the call graph for this function:

◆ calibration_check_sys()

imu.IMU.calibration_check_sys ( self)

Check System Calibration.

Returns the Calibration status of the System

Returns a 3 when the entire system is calibrated

Definition at line 102 of file imu.py.

Here is the call graph for this function:

◆ change_mode()

imu.IMU.change_mode ( self,
mode )

Change the IMU Operating Mode.

Definition at line 173 of file imu.py.

◆ euler()

imu.IMU.euler ( self)

Read Euler Angles.

Returns Heading, Roll and Pitch

Definition at line 76 of file imu.py.

Here is the call graph for this function:

◆ get_calibration_coeff()

imu.IMU.get_calibration_coeff ( self)

Get the Accelerometer, Magnetometer and Gyroscope Calibration Coefficients Method.

Returns the Accelerometer, Magnetometer and Gyroscope Calibration Coefficients as binary data

Definition at line 168 of file imu.py.

Here is the call graph for this function:

◆ get_calibration_coeff_accel()

imu.IMU.get_calibration_coeff_accel ( self)

Get the Accelerometer Calibration Coefficients.

Returns the Accelerometer Calibration Coefficients as binary data

Definition at line 140 of file imu.py.

Here is the call graph for this function:

◆ get_calibration_coeff_gyro()

imu.IMU.get_calibration_coeff_gyro ( self)

Get the Gyroscope Calibration Coefficients.

Returns the Gyroscope Calibration Coefficients as binary data

Definition at line 158 of file imu.py.

Here is the call graph for this function:

◆ get_calibration_coeff_mag()

imu.IMU.get_calibration_coeff_mag ( self)

Get the Magnetometer Calibration Coefficients.

Returns the Magnetometer Calibration Coefficients as binary data

Definition at line 149 of file imu.py.

Here is the call graph for this function:

◆ get_Euler_x()

imu.IMU.get_Euler_x ( self)

Get Euler x data.

Reads the Euler data to use as measurments

Definition at line 192 of file imu.py.

Here is the call graph for this function:

◆ get_Euler_y()

imu.IMU.get_Euler_y ( self)

Get Euler Y data.

Reads the Euler data to use as measurments

Definition at line 201 of file imu.py.

Here is the call graph for this function:

◆ get_Euler_z()

imu.IMU.get_Euler_z ( self)

Get Euler Z data.

Reads the Euler data to use as measurments

Definition at line 210 of file imu.py.

Here is the call graph for this function:

◆ get_Pitch_Velocity()

imu.IMU.get_Pitch_Velocity ( self)

Get Pitch Angular Velocity data.

Reads the Pitch Angular Velocity to use as measurments

Definition at line 233 of file imu.py.

Here is the call graph for this function:

◆ get_Roll_Velocity()

imu.IMU.get_Roll_Velocity ( self)

Get Roll Angular Velocity data.

Reads the Roll Angular Velocity to use as measurments

Definition at line 226 of file imu.py.

Here is the call graph for this function:

◆ get_Yaw_Velocity()

imu.IMU.get_Yaw_Velocity ( self)

Get Yaw Angular Velocity data.

Reads the Yaw Angular Velocity to use as measurments

Definition at line 219 of file imu.py.

Here is the call graph for this function:

◆ write_calibration_coeff()

imu.IMU.write_calibration_coeff ( self,
coef1,
coef2,
coef3,
coef4,
coef5,
coef6,
coef7,
coef8,
coef9,
coef10,
coef11 )

Write Calibration Coefficients.

Writes the Calibration Coefficients to the IMU from pre-recorded binary data

Definition at line 182 of file imu.py.

Member Data Documentation

◆ _buf

imu.IMU._buf = bytearray((0 for n in range(22)))
protected

Definition at line 47 of file imu.py.

◆ _buf_8

imu.IMU._buf_8 = bytearray((0))
protected

Definition at line 49 of file imu.py.

◆ _i2c

imu.IMU._i2c = i2c
protected

Definition at line 48 of file imu.py.

◆ DEV_ADDR

imu.IMU.DEV_ADDR = 0x28
static

Definition at line 9 of file imu.py.


The documentation for this class was generated from the following file:
  • C:/Users/14083/vscode_python/imu.py