ME 305
|
Initializes values and manages tasks. More...
Variables | |
main.zFlag = shares.Share(False) | |
Signal that the button z has been pressed. More... | |
main.pFlag = shares.Share(False) | |
Signal that the button p has been pressed. More... | |
main.dFlag = shares.Share(False) | |
Signal that the button d has been pressed. More... | |
main.gFlag = shares.Share(False) | |
Signal that the button g has been pressed. More... | |
main.position = shares.Share(0) | |
Stores position of encoder for transfer between files. More... | |
main.delta = shares.Share(0) | |
Stores delta (speed) of encoder. | |
main.P = shares.Share(0) | |
Stores a single data point reading of encoder position. | |
main.T = shares.Share(0) | |
Stores a single data point reading of encoder time. More... | |
main.task1 = taskUser('taskUser', 10_000, zFlag, pFlag, dFlag, gFlag, position, delta,P,T) | |
Holds task information and settings to pass into task_user.py. | |
main.task2 = taskEncoder('taskEncoder',10_000, zFlag, pFlag, dFlag, gFlag, position, delta,P,T) | |
Holds task information and settings to pass into task_encoder.py. More... | |
list | main.taskList = [task1,task2] |
List of all tasks in program. More... | |
Initializes values and manages tasks.
This is the main file to run the tasks required to interact with the encoder. It will continually call the specified task until the user interrupts the program by ending it with Keyboard Interrupt (Ctrl-C). Variables shared between tasks are initialized here and the tasks, and there periods are defined to run at 100Hz. Pictures of the state transition diagrams can be found in their respective task files. A picture of the task diagram can be found below. To view the code repository for this lab, see link below.
Code repository for this lab: https://bitbucket.org/rdeanr/me305/src/master/Lab2/
The plot below shows the position output of the encoder over a period of 30 seconds using the data collection feature inherent to this program. The position was changed by manually rotating the encoder.
main.dFlag = shares.Share(False) |
Signal that the button d has been pressed.
Shared object so we can update its value in every file. It turns true after z is pressed, and turns false after the delta has been returned.
main.gFlag = shares.Share(False) |
Signal that the button g has been pressed.
Shared object so we can update its value in every file. It turns true after g is pressed, and turns false after the data collection cycle has ended.
main.pFlag = shares.Share(False) |
Signal that the button p has been pressed.
Shared object so we can update its value in every file. It turns true after z is pressed, and turns false after the position has been returned.
Shared object signaling that the user wants to collect platform position data
main.position = shares.Share(0) |
Stores position of encoder for transfer between files.
Stores angular position of platform for transfer between files.
Used to communicate between task_encoder and task_user in order to pass the position across those files.
Used to communicate between task_IMU.py and task_user.py in order to pass the position across those files.
main.T = shares.Share(0) |
Stores a single data point reading of encoder time.
Stores a single data point reading of touch panel time.
main.task2 = taskEncoder('taskEncoder',10_000, zFlag, pFlag, dFlag, gFlag, position, delta,P,T) |
Holds task information and settings to pass into task_encoder.py.
Holds task information and settings to pass into task_IMU.py.
list main.taskList = [task1,task2] |
List of all tasks in program.
This list will be used to cycle through every task in the list.
main.zFlag = shares.Share(False) |
Signal that the button z has been pressed.
Shared object so we can update its value in every file. It turns true after z is pressed, and turns false after the zeroing cycle has ended.
Signals that the user wants the IMU mode to change