|
ME 405 Romi
|
Right Motor Encoder Class. More...
Public Member Functions | |
| __init__ (self, motor, encoder, m_state_r, position_r, velocity_r, times, PWM_r, delay) | |
| Right Encoder Initialization. | |
| run (self) | |
| Runs the tasks for the Right Motor. | |
Public Attributes | |
| my_motor_Right = motor | |
| encoder_Right = encoder | |
| m_state_r = m_state_r | |
| position_r = position_r | |
| velocity_r = velocity_r | |
| times = times | |
| PWM_r = PWM_r | |
| int | delay_count = 0 |
| int | state = 0 |
| delay = delay | |
This task class which contains a generator finite state machine that runs multiple functions.
It drives the motor, reads the encoder and runs continuously, setting flags that are shared with other tasks.
Definition at line 10 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.__init__ | ( | self, | |
| motor, | |||
| encoder, | |||
| m_state_r, | |||
| position_r, | |||
| velocity_r, | |||
| times, | |||
| PWM_r, | |||
| delay ) |
| motor_encoder_right_class.motor_encoder_right_class.run | ( | self | ) |
Runs the tasks for the Right Motor.
State 0 Enable The Right Motor
State 1 Wait to get a different command from UI
State 2 Set Effort
State 3 Disable Motor
State 4 Enable Motor and Wait State
State 5 Stop the Motor and Zero the Encoder Ticks
Definition at line 48 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.delay = delay |
Definition at line 32 of file motor_encoder_right_class.py.
| int motor_encoder_right_class.motor_encoder_right_class.delay_count = 0 |
Definition at line 30 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.encoder_Right = encoder |
Definition at line 24 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.m_state_r = m_state_r |
Definition at line 25 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.my_motor_Right = motor |
Definition at line 23 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.position_r = position_r |
Definition at line 26 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.PWM_r = PWM_r |
Definition at line 29 of file motor_encoder_right_class.py.
| int motor_encoder_right_class.motor_encoder_right_class.state = 0 |
Definition at line 31 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.times = times |
Definition at line 28 of file motor_encoder_right_class.py.
| motor_encoder_right_class.motor_encoder_right_class.velocity_r = velocity_r |
Definition at line 27 of file motor_encoder_right_class.py.