blob: e482c5d90fe60313cd93846afd4e9d8a43eb7715 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001package aos;
2
Austin Schuh374fd172014-10-25 17:57:54 -07003struct Joystick {
4 // A bitmask of the button state.
5 uint16_t buttons;
6
Austin Schuh4ee60422017-02-05 16:49:52 -08007 // The 6 joystick axes.
8 double[6] axis;
Austin Schuhfee2e602015-03-08 18:26:05 -07009
10 // The POV axis.
11 int32_t pov;
Austin Schuh374fd172014-10-25 17:57:54 -070012};
13
Austin Schuhdf6cbb12019-02-02 13:46:52 -080014// This message is checked by all control loops to make sure that the
15// joystick code hasn't died. It is published on ".aos.joystick_state"
Brian Silverman699f0cb2015-02-05 19:45:01 -050016message JoystickState {
Tyler Chatowc92b4872019-02-23 21:42:11 -080017 Joystick[6] joysticks;
Austin Schuh374fd172014-10-25 17:57:54 -070018
19 bool test_mode;
20 bool fms_attached;
21 bool enabled;
22 bool autonomous;
23 uint16_t team_id;
Brian Silverman699f0cb2015-02-05 19:45:01 -050024
Austin Schuhc231df42018-03-21 20:43:24 -070025 // 2018 scale and switch positions.
26 // TODO(austin): Push these out to a new message?
27 bool switch_left;
28 bool scale_left;
29
Austin Schuh374fd172014-10-25 17:57:54 -070030 // If this is true, then this message isn't actually from the control
31 // system and so should not be trusted as evidence that the button inputs
32 // etc are actually real and should be acted on.
33 // However, most things should ignore this so that sending fake messages is
Brian Silverman699f0cb2015-02-05 19:45:01 -050034 // useful for testing. The only difference in behavior should be motors not
35 // actually turning on.
Austin Schuh374fd172014-10-25 17:57:54 -070036 bool fake;
brians343bc112013-02-10 01:53:46 +000037};
38
Austin Schuhdf6cbb12019-02-02 13:46:52 -080039// This message is sent out on this queue when sensors are read. It contains
40// global robot state and information about whether the process reading sensors
41// has been restarted, along with all counters etc it keeps track of. It is
42// published on ".aos.robot_state"
Brian Silverman699f0cb2015-02-05 19:45:01 -050043message RobotState {
44 // The PID of the process reading sensors.
45 // This is here so control loops can tell when it changes.
46 int32_t reader_pid;
47
48 // True when outputs are enabled.
49 // Motor controllers keep going for a bit after this goes to false.
50 bool outputs_enabled;
51 // Indicates whether something is browned out (I think motor controller
52 // outputs). IMPORTANT: This is NOT !outputs_enabled. outputs_enabled goes to
53 // false for other reasons too (disabled, e-stopped, maybe more).
54 bool browned_out;
55
56 // Whether the two sensor rails are currently working.
57 bool is_3v3_active;
58 bool is_5v_active;
59 // The current voltages measured on the two sensor rails.
60 double voltage_3v3;
61 double voltage_5v;
62
63 // The input voltage to the roboRIO.
64 double voltage_roborio_in;
65
66 // From the DriverStation object, aka what FMS sees and what shows up on the
67 // actual driver's station.
68 double voltage_battery;
69};
70