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 | |
| 15 | // This message is checked by all control loops to make sure that the |
| 16 | // joystick code hasn't died. It is published on "/aos" |
| 17 | table JoystickState { |
| 18 | //TODO: should have fixed size. |
| 19 | joysticks:[Joystick]; |
| 20 | |
| 21 | test_mode:bool; |
| 22 | fms_attached:bool; |
| 23 | enabled:bool; |
| 24 | autonomous:bool; |
| 25 | team_id:ushort; |
| 26 | |
| 27 | // 2018 scale and switch positions. |
| 28 | // TODO(austin): Push these out to a new message? |
| 29 | switch_left:bool; |
| 30 | scale_left:bool; |
| 31 | |
| 32 | // If this is true, then this message isn't actually from the control |
| 33 | // system and so should not be trusted as evidence that the button inputs |
| 34 | // etc are actually real and should be acted on. |
| 35 | // However, most things should ignore this so that sending fake messages is |
| 36 | // useful for testing. The only difference in behavior should be motors not |
| 37 | // actually turning on. |
| 38 | fake:bool; |
| 39 | } |
| 40 | |
| 41 | root_type JoystickState; |