brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | package aos; |
| 2 | |
Austin Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame^] | 3 | struct Joystick { |
| 4 | // A bitmask of the button state. |
| 5 | uint16_t buttons; |
| 6 | |
| 7 | // The 4 joystick axes. |
| 8 | double[4] axis; |
| 9 | }; |
| 10 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | message RobotState { |
Austin Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame^] | 12 | Joystick[4] joysticks; |
| 13 | |
| 14 | bool test_mode; |
| 15 | bool fms_attached; |
| 16 | bool enabled; |
| 17 | bool autonomous; |
| 18 | uint16_t team_id; |
| 19 | // If this is true, then this message isn't actually from the control |
| 20 | // system and so should not be trusted as evidence that the button inputs |
| 21 | // etc are actually real and should be acted on. |
| 22 | // However, most things should ignore this so that sending fake messages is |
| 23 | // useful for testing. |
| 24 | bool fake; |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | // The robot_state Queue is checked by all control loops to make sure that the |
| 28 | // joystick code hasn't died. |
| 29 | // It also provides information about whether or not the robot is in autonomous |
| 30 | // mode and what the team_id is. |
| 31 | |
| 32 | queue RobotState robot_state; |