blob: 1deaa06803d29a8597895e0b2533c3de0112cde3 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001namespace aos;
2
3table 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 Kuszmaula8806732020-02-14 19:45:35 -080015enum Alliance : byte { kRed, kBlue, kInvalid }
16
Alex Perrycb7da4b2019-08-28 19:35:56 -070017// This message is checked by all control loops to make sure that the
18// joystick code hasn't died. It is published on "/aos"
19table 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 Kuszmaula8806732020-02-14 19:45:35 -080041
42 // Color of our current alliance.
43 alliance:Alliance;
44
45 // String corresponding to the game data string
46 game_data:string;
Alex Perrycb7da4b2019-08-28 19:35:56 -070047}
48
49root_type JoystickState;