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 | |
Austin Schuh | 4ee6042 | 2017-02-05 16:49:52 -0800 | [diff] [blame] | 7 | // The 6 joystick axes. |
| 8 | double[6] axis; |
Austin Schuh | fee2e60 | 2015-03-08 18:26:05 -0700 | [diff] [blame] | 9 | |
| 10 | // The POV axis. |
| 11 | int32_t pov; |
Austin Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame] | 12 | }; |
| 13 | |
Austin Schuh | df6cbb1 | 2019-02-02 13:46:52 -0800 | [diff] [blame^] | 14 | // 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 Silverman | 699f0cb | 2015-02-05 19:45:01 -0500 | [diff] [blame] | 16 | message JoystickState { |
Tyler Chatow | c92b487 | 2019-02-23 21:42:11 -0800 | [diff] [blame] | 17 | Joystick[6] joysticks; |
Austin Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame] | 18 | |
| 19 | bool test_mode; |
| 20 | bool fms_attached; |
| 21 | bool enabled; |
| 22 | bool autonomous; |
| 23 | uint16_t team_id; |
Brian Silverman | 699f0cb | 2015-02-05 19:45:01 -0500 | [diff] [blame] | 24 | |
Austin Schuh | c231df4 | 2018-03-21 20:43:24 -0700 | [diff] [blame] | 25 | // 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 Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame] | 30 | // 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 Silverman | 699f0cb | 2015-02-05 19:45:01 -0500 | [diff] [blame] | 34 | // useful for testing. The only difference in behavior should be motors not |
| 35 | // actually turning on. |
Austin Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame] | 36 | bool fake; |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
Austin Schuh | df6cbb1 | 2019-02-02 13:46:52 -0800 | [diff] [blame^] | 39 | // 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 Silverman | 699f0cb | 2015-02-05 19:45:01 -0500 | [diff] [blame] | 43 | message 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 | |