User interface task for data collection and interaction with all the tasks. More...
Public Member Functions | |
| def | __init__ (self, period, balance_flag, calib_pan_flag, calib_IMU_flag, disable_flag, state_vect_x, state_vect_y, L_1, L_2) |
| Constructs the user interface task. More... | |
| def | run (self) |
| Runs one iteration of the FSM. More... | |
| def | transition_to (self, new_state) |
| Transitions the FSM to a new state. More... | |
Public Attributes | |
| period | |
| The frequency of the task. More... | |
| state | |
| Sets initial state to State 0. More... | |
| runs | |
| Sets the number of runs to 0. More... | |
| next_time | |
| The utime.ticks_us() value associated with the next run of the FSM. More... | |
| ser | |
| A serial port to use for user I/O. More... | |
| balance_flag | |
| A boolean flag used to start balancing the platform and/or ball. More... | |
| i | |
| A variable used for indexing. More... | |
| calib_pan_flag | |
| A boolean flag used to start touch panel calibration. More... | |
| calib_IMU_flag | |
| A boolean flag used to start IMU calibration. More... | |
| disable_flag | |
| A boolean flag used to disable motors. More... | |
| state_vect_x | |
| A shared list used to define state vector x. More... | |
| state_vect_y | |
| A shared list used to define state vector y. More... | |
| L_1 | |
| Variable used to define actuation level for motor 1. More... | |
| L_2 | |
| Variable used to define actuation level for motor 2. More... | |
| time_array | |
| An array for time. More... | |
| x_array | |
| An array for x position. More... | |
| thy_array | |
| An array for theta y angle. More... | |
| xd_array | |
| An array for x velocity. More... | |
| thyd_array | |
| An array for angular velocity (y direction) More... | |
| y_array | |
| An array for y position. More... | |
| thx_array | |
| An array for theta x angle. More... | |
| yd_array | |
| An array for y velocity. More... | |
| thxd_array | |
| An array for angular velocity (x direction) More... | |
| collect_time | |
| Starts timer for data collection. More... | |
| time_diff | |
| Creates a variable that calculates difference between time reference points. More... | |
User interface task for data collection and interaction with all the tasks.
Implements a finite state machine that communicates with the user to interface with all the tasks
| def LabFF_task_userinterface.Task_User.__init__ | ( | self, | |
| period, | |||
| balance_flag, | |||
| calib_pan_flag, | |||
| calib_IMU_flag, | |||
| disable_flag, | |||
| state_vect_x, | |||
| state_vect_y, | |||
| L_1, | |||
| L_2 | |||
| ) |
Constructs the user interface task.
The user task is implemented as a finite state machine that interacts between the user and the program.
| period | The period, in microseconds, between runs of the task |
| balance_flag | A boolean flag used to enable ball balancing |
| calib_pan_flag | A boolean flag used to enable touch panel calibration |
| calib_IMU_flag | A boolean flag used to enable IMU calibration |
| disable_flag | A boolean flag used to disable the motors |
| L_1 | Variable used to define actuation level for motor 1 |
| L_2 | Variable used to define actuation level for motor 2 |
| state_vect_x | List used to define state vector x |
| state_vect_y | List used to define state vector y |
| def LabFF_task_userinterface.Task_User.run | ( | self | ) |
Runs one iteration of the FSM.
Implements a finite state machine
| def LabFF_task_userinterface.Task_User.transition_to | ( | self, | |
| new_state | |||
| ) |
Transitions the FSM to a new state.
A function that transitions the FSM to a new state
| new_state | The state to transition to |
| LabFF_task_userinterface.Task_User.balance_flag |
A boolean flag used to start balancing the platform and/or ball.
Works with the motor task and user interface to implement closed-loop control that balances the platform and ball
| LabFF_task_userinterface.Task_User.calib_IMU_flag |
A boolean flag used to start IMU calibration.
Works with the task IMU and user interface to do IMU calibration
| LabFF_task_userinterface.Task_User.calib_pan_flag |
A boolean flag used to start touch panel calibration.
Works with the task panel and user interface to do resistive touch panel calibration
| LabFF_task_userinterface.Task_User.collect_time |
Starts timer for data collection.
An increasing microsecond counter equal to current_time
| LabFF_task_userinterface.Task_User.disable_flag |
A boolean flag used to disable motors.
Works with the motor task and user interface to halt motor movement
| LabFF_task_userinterface.Task_User.i |
A variable used for indexing.
This value helps index state vector points for data collection
| LabFF_task_userinterface.Task_User.L_1 |
Variable used to define actuation level for motor 1.
This value is calculated using input gain and torque
| LabFF_task_userinterface.Task_User.L_2 |
Variable used to define actuation level for motor 2.
This value is calculated using input gain and torque
| LabFF_task_userinterface.Task_User.next_time |
The utime.ticks_us() value associated with the next run of the FSM.
Defines a variable that adds the period to the ongoing timer
| LabFF_task_userinterface.Task_User.period |
The frequency of the task.
Defines variable that specifies timer frequency
| LabFF_task_userinterface.Task_User.runs |
Sets the number of runs to 0.
Defines a variable to keep track of runs
| LabFF_task_userinterface.Task_User.ser |
A serial port to use for user I/O.
Creates a new USB_VCP object
| LabFF_task_userinterface.Task_User.state |
Sets initial state to State 0.
Starts timer.
FSM starts at State 0, where user input is prompted for further action
An increasing microsecond counter with an arbitrary reference point
| LabFF_task_userinterface.Task_User.state_vect_x |
A shared list used to define state vector x.
Contains variables for x position, theta y, x velocity, and angular velocity (theta y dot)
| LabFF_task_userinterface.Task_User.state_vect_y |
A shared list used to define state vector y.
Contains variables for y position, theta x, y velocity, and angular velocity (theta x dot)
| LabFF_task_userinterface.Task_User.thx_array |
An array for theta x angle.
This variable creates an empty array of 1000 data points, which will be populated with angular position data in the x axis gathered from the IMU
| LabFF_task_userinterface.Task_User.thxd_array |
An array for angular velocity (x direction)
This variable creates an empty array of 1000 data points, which will be populated with angular velocity data in the x axis gathered from the IMU
| LabFF_task_userinterface.Task_User.thy_array |
An array for theta y angle.
This variable creates an empty array of 1000 data points, which will be populated with angular position data in the y axis gathered from the IMU
| LabFF_task_userinterface.Task_User.thyd_array |
An array for angular velocity (y direction)
This variable creates an empty array of 1000 data points, which will be populated with angular velocity data in the y axis gathered from the IMU
| LabFF_task_userinterface.Task_User.time_array |
An array for time.
This variable creates an empty array of 1000 data points, which will be populated with time data
| LabFF_task_userinterface.Task_User.time_diff |
Creates a variable that calculates difference between time reference points.
Used to collect data for a maximum time of 30 seconds
| LabFF_task_userinterface.Task_User.x_array |
An array for x position.
This variable creates an empty array of 1000 data points, which will be populated with x-position data gathered from the touch panel
| LabFF_task_userinterface.Task_User.xd_array |
An array for x velocity.
This variable creates an empty array of 1000 data points, which will be populated with x-velocity data gathered from the touch panel
| LabFF_task_userinterface.Task_User.y_array |
An array for y position.
This variable creates an empty array of 1000 data points, which will be populated with y-position data gathered from the touch panel
| LabFF_task_userinterface.Task_User.yd_array |
An array for y velocity.
This variable creates an empty array of 1000 data points, which will be populated with y-velocity data gathered from the touch panel