Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 1 | namespace aos; |
| 2 | |
| 3 | table Joystick { |
| 4 | // A bitmask of the butotn state. |
| 5 | buttons:ushort; |
| 6 | |
| 7 | // The 6 joystick axes. |
| 8 | // TODO: Should have size of 6 |
| 9 | axis:[double]; |
| 10 | |
| 11 | // The POV axis. |
| 12 | pov:int; |
| 13 | } |
| 14 | |
James Kuszmaul | a880673 | 2020-02-14 19:45:35 -0800 | [diff] [blame] | 15 | enum Alliance : byte { kRed, kBlue, kInvalid } |
| 16 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 17 | // This message is checked by all control loops to make sure that the |
| 18 | // joystick code hasn't died. It is published on "/aos" |
| 19 | table JoystickState { |
| 20 | //TODO: should have fixed size. |
| 21 | joysticks:[Joystick]; |
| 22 | |
| 23 | test_mode:bool; |
| 24 | fms_attached:bool; |
| 25 | enabled:bool; |
| 26 | autonomous:bool; |
| 27 | team_id:ushort; |
| 28 | |
| 29 | // 2018 scale and switch positions. |
| 30 | // TODO(austin): Push these out to a new message? |
| 31 | switch_left:bool; |
| 32 | scale_left:bool; |
| 33 | |
| 34 | // If this is true, then this message isn't actually from the control |
| 35 | // system and so should not be trusted as evidence that the button inputs |
| 36 | // etc are actually real and should be acted on. |
| 37 | // However, most things should ignore this so that sending fake messages is |
| 38 | // useful for testing. The only difference in behavior should be motors not |
| 39 | // actually turning on. |
| 40 | fake:bool; |
James Kuszmaul | a880673 | 2020-02-14 19:45:35 -0800 | [diff] [blame] | 41 | |
| 42 | // Color of our current alliance. |
| 43 | alliance:Alliance; |
| 44 | |
| 45 | // String corresponding to the game data string |
| 46 | game_data:string; |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | root_type JoystickState; |