ME 305
Functions
task_IMU.py File Reference

Directly interfaces with IMU. More...

Functions

def task_IMU.taskIMU (taskname, period, zFlag, pFlag, vFlag, position, Velo, opmode, cFlag, calwrite, cal_byte, calread, bFlag)
 Generator function to inteface with IMU. More...
 

Detailed Description

Directly interfaces with IMU.

Called at a frequency of 100Hz, this task file uses the class BNO_driver within the BNO_driver.py drive file to interface with the IMU.Continually updating the position of the IMU, this task file uses flag values altered by the user in task_user.py to execute actions defined in BNO_dirver.py. Once the action is completed, these flags are reset.

Author
Ryan Dean
Zachary Hendrix
Date
2/1/2022

Function Documentation

◆ taskIMU()

def task_IMU.taskIMU (   taskname,
  period,
  zFlag,
  pFlag,
  vFlag,
  position,
  Velo,
  opmode,
  cFlag,
  calwrite,
  cal_byte,
  calread,
  bFlag 
)

Generator function to inteface with IMU.

Generator function receives values of certain flags that correspond to a desired action from the user. This then triggers the function to interact with the encoder.py drive file, performing the necessary action or storing the value for the user to then see with their interface.

Parameters
tasknameName of the task being performed.
periodSpecifies how long the task has to perform its function. received as microseconds. Specified as an integer.
zFlagHolds True or False value to know when to change IMU mode
pFlagHolds True or False value to know when position command was called by the user to know the angular position of platform in Euler angles.
vFlagHolds True or False value to know when to collect velocity data
positionStores current angular position of platformto be transferred to task_user.py
VeloStores angular velocity of platform
opmodeStores user selected operating mode of IMU
cFlagHolds True or False to begin platform calibration
calfile
calwriteHolds True or False to begin writing calibration data to IMU
cal_byteStores byte data of the calibration status of IMU
calreadHolds True or False to begin reading IMU calibration data to later write to a text file
bFlagHolds True or False to begin recording platform position and velocity data
Returns
yields None

Generator function receives values of certain flags that correspond to a desired action from the user. This then triggers the function to interact with the encoder.py drive file, performing the necessary action or storing the value for the user to then see with their interface.

Parameters
tasknameName of the task being performed.
periodSpecifies how long the task has to perform its function. received as microseconds. Specified as an integer.
zFlagHolds True or False value to know when to change IMU mode
pFlagHolds True or False value to know when position command was called by the user to know the angular position of platform in Euler angles.
vFlagHolds True or False value to know when to collect velocity data
positionStores current angular position of platformto be transferred to task_user.py
VeloStores angular velocity of platform
opmodeStores user selected operating mode of IMU
cFlagHolds True or False to begin platform calibration
calwriteHolds True or False to begin writing calibration data to IMU
cal_byteStores byte data of the calibration status of IMU
calreadHolds True or False to begin reading IMU calibration data to later write to a text file
bFlagHolds True or False to begin recording platform position and velocity data
Returns
yields None