|
ME 405 Romi
|
Initializes User Interface. More...
Public Member Functions | |
| __init__ (self, testing_flg, m_state_l, m_state_r, position, velocity, times, PWM_l, PWM_r, delay, uart_obj, fwd_ref, arc_ref, piv_ref, c_state, velocity2, need_Calibrate, ready_Black, ready_White, automatic_mode, imu_flg) | |
| User Interface Initialization. | |
| run (self) | |
| Runs the various tasks in UI. | |
Public Attributes | |
| testing_flg = testing_flg | |
| m_state_l = m_state_l | |
| m_state_r = m_state_r | |
| position = position | |
| velocity = velocity | |
| times = times | |
| int | state = 0 |
| ser = USB_VCP() | |
| int | output = 10 |
| int | last_test = 2 |
| int | next_test = 0 |
| int | time_idx = 0 |
| PWM_l = PWM_l | |
| PWM_r = PWM_r | |
| delay = delay | |
| uart = uart_obj | |
| int | headers_v = 0 |
| int | headers_p = 0 |
| int | ui_delay = 0 |
| fwd_ref = fwd_ref | |
| int | msg_send = 0 |
| arc_ref = arc_ref | |
| piv_ref = piv_ref | |
| c_state = c_state | |
| velocity2 = velocity2 | |
| int | which_test = 0 |
| int | test_ref = 0 |
| bool | ref_got = False |
| need_Calibrate = need_Calibrate | |
| ready_Black = ready_Black | |
| ready_White = ready_White | |
| int | data_requested = 0 |
| automatic_mode = automatic_mode | |
| imu_flg = imu_flg | |
Initializes User Interface.
UI task class which contains a generator finite state machine that starts tests and procedures on user input
This class runs continuously, setting flags that are shared with other tasks.
| ui.ui.__init__ | ( | self, | |
| testing_flg, | |||
| m_state_l, | |||
| m_state_r, | |||
| position, | |||
| velocity, | |||
| times, | |||
| PWM_l, | |||
| PWM_r, | |||
| delay, | |||
| uart_obj, | |||
| fwd_ref, | |||
| arc_ref, | |||
| piv_ref, | |||
| c_state, | |||
| velocity2, | |||
| need_Calibrate, | |||
| ready_Black, | |||
| ready_White, | |||
| automatic_mode, | |||
| imu_flg ) |
User Interface Initialization.
| P1 | Testing Flag |
| P2 | Left Motor State |
| P3 | Right Motor State |
| P4 | Position |
| P5 | Velocity |
| P6 | Encoder Time |
| P7 | PWM Left |
| P8 | PWM Right |
| P9 | Delay Flag |
| P10 | UART Object |
| P11 | Forward Reference Velocity |
| P12 | Arc Reference Velocity |
| P13 | Pivot Reference Velocity |
| P14 | Controller State |
| P15 | Velocity 2 |
| P16 | Need Calibrate Flag |
| P17 | Black Calibration Flag |
| P18 | White Calibration Flag |
| P19 | Automatic Mode Flag |
| P20 | IMU Flag |
| ui.ui.run | ( | self | ) |
Runs the various tasks in UI.
State 0 Checking for Bluetooth Command
State 1 Motor Step Resposne Test
State 2 Wating for Test Data To be collected
State 3 Delay State
State 4 Move wheels Forward
State 5 Turn in an arc
State 6 Pivot in Place
State 7 Stop wheels
State 8 Testing Check
State 9 Waiting for Data to be collected
State 10 Turn in an arc
State 11 Wait for Black Calibration Data
State 12 Wait for White Calibration Data
State 13 IMU to be used by the user