Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 1 | #include <math.h> |
| 2 | #include <stdio.h> |
| 3 | #include <string.h> |
| 4 | #include <unistd.h> |
| 5 | |
| 6 | #include "aos/actions/actions.h" |
| 7 | #include "aos/init.h" |
| 8 | #include "aos/input/action_joystick_input.h" |
| 9 | #include "aos/input/driver_station_data.h" |
| 10 | #include "aos/input/drivetrain_input.h" |
| 11 | #include "aos/input/joystick_input.h" |
| 12 | #include "aos/logging/logging.h" |
| 13 | #include "aos/logging/logging.h" |
| 14 | #include "aos/util/log_interval.h" |
| 15 | #include "frc971/autonomous/auto.q.h" |
| 16 | #include "frc971/autonomous/base_autonomous_actor.h" |
| 17 | #include "frc971/control_loops/drivetrain/drivetrain.q.h" |
| 18 | |
| 19 | #include "y2019/control_loops/drivetrain/drivetrain_base.h" |
| 20 | #include "y2019/control_loops/superstructure/superstructure.q.h" |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 21 | #include "y2019/status_light.q.h" |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 22 | |
| 23 | using ::y2019::control_loops::superstructure::superstructure_queue; |
| 24 | using ::aos::input::driver_station::ButtonLocation; |
| 25 | using ::aos::input::driver_station::ControlBit; |
| 26 | using ::aos::input::driver_station::JoystickAxis; |
| 27 | using ::aos::input::driver_station::POVLocation; |
| 28 | |
| 29 | namespace y2019 { |
| 30 | namespace input { |
| 31 | namespace joysticks { |
| 32 | |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 33 | const ButtonLocation kSuctionBall(3, 13); |
| 34 | const ButtonLocation kSuctionHatch(3, 12); |
| 35 | const ButtonLocation kDeployStilt(3, 8); |
| 36 | const ButtonLocation kFallOver(3, 9); |
Austin Schuh | 2cf16b8 | 2019-02-15 23:23:22 -0800 | [diff] [blame] | 37 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 38 | struct ElevatorWristPosition { |
| 39 | double elevator; |
| 40 | double wrist; |
| 41 | }; |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 42 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 43 | const ButtonLocation kRocketForwardLower(5, 1); |
| 44 | const ButtonLocation kRocketForwardMiddle(5, 2); |
| 45 | const ButtonLocation kRocketForwardUpper(5, 4); |
| 46 | const ButtonLocation kCargoForward(5, 3); |
| 47 | |
| 48 | const POVLocation kRocketBackwardUnpressed(5, -1); |
| 49 | const POVLocation kRocketBackwardLower(5, 180); |
| 50 | const POVLocation kRocketBackwardMiddle(5, 90); |
| 51 | const POVLocation kRocketBackwardUpper(5, 0); |
| 52 | const POVLocation kCargoBackward(5, 270); |
| 53 | |
| 54 | const ButtonLocation kPanelSwitch(5, 7); |
| 55 | const ButtonLocation kCargoSwitch(5, 8); |
| 56 | |
| 57 | const ButtonLocation kBallHPIntakeForward(5, 6); |
| 58 | const ButtonLocation kBallHPIntakeBackward(5, 5); |
| 59 | const JoystickAxis kBallOutake(5, 3); |
| 60 | const JoystickAxis kBallIntake(5, 4); |
| 61 | |
| 62 | const ButtonLocation kPanelHPIntakeForward(5, 6); |
| 63 | const ButtonLocation kPanelHPIntakeBackward(5, 5); |
| 64 | |
| 65 | const ButtonLocation kRelease(2, 4); |
| 66 | |
| 67 | const ElevatorWristPosition kStowPos{0.36, 0.0}; |
| 68 | |
| 69 | const ElevatorWristPosition kPanelHPIntakeForwrdPos{0.04, M_PI / 2.0}; |
Sabina Davis | e6fe6c5 | 2019-03-03 15:48:51 -0800 | [diff] [blame] | 70 | const ElevatorWristPosition kPanelHPIntakeBackwardPos{0.05, -M_PI / 2.0}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 71 | |
| 72 | const ElevatorWristPosition kPanelForwardLowerPos{0.0, M_PI / 2.0}; |
| 73 | const ElevatorWristPosition kPanelBackwardLowerPos{0.0, -M_PI / 2.0}; |
| 74 | |
Sabina Davis | e48004f | 2019-03-02 23:15:24 -0800 | [diff] [blame] | 75 | const ElevatorWristPosition kPanelForwardMiddlePos{0.75, M_PI / 2.0}; |
| 76 | const ElevatorWristPosition kPanelBackwardMiddlePos{0.78, -M_PI / 2.0}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 77 | |
Sabina Davis | e48004f | 2019-03-02 23:15:24 -0800 | [diff] [blame] | 78 | const ElevatorWristPosition kPanelForwardUpperPos{1.51, M_PI / 2.0}; |
| 79 | const ElevatorWristPosition kPanelBackwardUpperPos{1.50, -M_PI / 2.0}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 80 | |
Sabina Davis | e6fe6c5 | 2019-03-03 15:48:51 -0800 | [diff] [blame] | 81 | const ElevatorWristPosition kPanelCargoForwardPos{0.0, M_PI / 2.0}; |
| 82 | const ElevatorWristPosition kPanelCargoBackwardPos{0.0, -M_PI / 2.0}; |
| 83 | |
| 84 | const ElevatorWristPosition kBallForwardLowerPos{0.46, M_PI / 2.0}; |
| 85 | const ElevatorWristPosition kBallBackwardLowerPos{0.15, -M_PI / 2.0}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 86 | |
Sabina Davis | e48004f | 2019-03-02 23:15:24 -0800 | [diff] [blame] | 87 | const ElevatorWristPosition kBallForwardMiddlePos{1.16, 1.546}; |
| 88 | const ElevatorWristPosition kBallBackwardMiddlePos{0.876021, -1.546}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 89 | |
Sabina Davis | e48004f | 2019-03-02 23:15:24 -0800 | [diff] [blame] | 90 | const ElevatorWristPosition kBallForwardUpperPos{1.50, 0.961}; |
| 91 | const ElevatorWristPosition kBallBackwardUpperPos{1.41, -1.217}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 92 | |
Sabina Davis | e48004f | 2019-03-02 23:15:24 -0800 | [diff] [blame] | 93 | const ElevatorWristPosition kBallCargoForwardPos{0.699044, 1.353}; |
| 94 | const ElevatorWristPosition kBallCargoBackwardPos{0.828265, -1.999}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 95 | |
Sabina Davis | e6fe6c5 | 2019-03-03 15:48:51 -0800 | [diff] [blame] | 96 | const ElevatorWristPosition kBallHPIntakeForwardPos{0.55, 1.097}; |
| 97 | const ElevatorWristPosition kBallHPIntakeBackwardPos{0.89, -2.018}; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 98 | |
| 99 | const ElevatorWristPosition kBallIntakePos{0.29, 2.14}; |
Austin Schuh | 2cf16b8 | 2019-02-15 23:23:22 -0800 | [diff] [blame] | 100 | |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 101 | class Reader : public ::aos::input::ActionJoystickInput { |
| 102 | public: |
| 103 | Reader(::aos::EventLoop *event_loop) |
| 104 | : ::aos::input::ActionJoystickInput( |
| 105 | event_loop, |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 106 | ::y2019::control_loops::drivetrain::GetDrivetrainConfig()) { |
| 107 | superstructure_queue.goal.FetchLatest(); |
| 108 | if (superstructure_queue.goal.get()) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 109 | grab_piece_ = superstructure_queue.goal->suction.grab_piece; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 110 | } |
| 111 | } |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 112 | |
| 113 | void HandleTeleop(const ::aos::input::driver_station::Data &data) { |
| 114 | superstructure_queue.position.FetchLatest(); |
| 115 | superstructure_queue.status.FetchLatest(); |
| 116 | if (!superstructure_queue.status.get() || |
| 117 | !superstructure_queue.position.get()) { |
| 118 | LOG(ERROR, "Got no superstructure status packet.\n"); |
| 119 | return; |
| 120 | } |
| 121 | |
| 122 | auto new_superstructure_goal = superstructure_queue.goal.MakeMessage(); |
| 123 | |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 124 | if (data.IsPressed(kSuctionBall)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 125 | grab_piece_ = true; |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 126 | } else if (data.IsPressed(kSuctionHatch)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 127 | grab_piece_ = true; |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 128 | } else if (data.IsPressed(kRelease) || |
| 129 | !superstructure_queue.status->has_piece) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 130 | grab_piece_ = false; |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 131 | } |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 132 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 133 | if (data.IsPressed(kRocketBackwardUnpressed)) { |
| 134 | elevator_wrist_pos_ = kStowPos; |
| 135 | } |
| 136 | new_superstructure_goal->intake.unsafe_goal = -1.2; |
| 137 | new_superstructure_goal->roller_voltage = 0.0; |
| 138 | |
| 139 | const bool kDoBallIntake = data.GetAxis(kBallIntake) > 0.9; |
| 140 | const bool kDoBallOutake = data.GetAxis(kBallOutake) > 0.9; |
| 141 | |
| 142 | if (data.IsPressed(kPanelSwitch)) { |
| 143 | switch_ball_ = false; |
| 144 | } else if (data.IsPressed(kCargoSwitch)) { |
| 145 | switch_ball_ = true; |
| 146 | } |
| 147 | |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 148 | // TODO(sabina): max height please? |
Austin Schuh | 77ac321 | 2019-02-19 16:50:14 -0800 | [diff] [blame] | 149 | if (data.IsPressed(kFallOver)) { |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 150 | new_superstructure_goal->stilts.unsafe_goal = 0.71; |
Michael Schuh | 587dcb5 | 2019-02-28 21:31:03 -0800 | [diff] [blame] | 151 | new_superstructure_goal->stilts.profile_params.max_velocity = 0.65; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 152 | new_superstructure_goal->stilts.profile_params.max_acceleration = 2.0; |
Austin Schuh | 77ac321 | 2019-02-19 16:50:14 -0800 | [diff] [blame] | 153 | } else if (data.IsPressed(kDeployStilt)) { |
| 154 | new_superstructure_goal->stilts.unsafe_goal = 0.50; |
Michael Schuh | 587dcb5 | 2019-02-28 21:31:03 -0800 | [diff] [blame] | 155 | new_superstructure_goal->stilts.profile_params.max_velocity = 0.65; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 156 | if (stilts_was_above_) { |
| 157 | new_superstructure_goal->stilts.profile_params.max_acceleration = 0.75; |
| 158 | } else { |
| 159 | new_superstructure_goal->stilts.profile_params.max_acceleration = 2.0; |
| 160 | } |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 161 | } else { |
Austin Schuh | 2cf16b8 | 2019-02-15 23:23:22 -0800 | [diff] [blame] | 162 | new_superstructure_goal->stilts.unsafe_goal = 0.01; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 163 | new_superstructure_goal->stilts.profile_params.max_velocity = 0.25; |
| 164 | new_superstructure_goal->stilts.profile_params.max_acceleration = 2.0; |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 165 | } |
| 166 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 167 | if (superstructure_queue.status->stilts.position > 0.65) { |
| 168 | stilts_was_above_ = true; |
| 169 | } else if (superstructure_queue.status->stilts.position < 0.1) { |
| 170 | stilts_was_above_ = false; |
Austin Schuh | 2cf16b8 | 2019-02-15 23:23:22 -0800 | [diff] [blame] | 171 | } |
| 172 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 173 | if (switch_ball_) { |
| 174 | if (superstructure_queue.status->has_piece) { |
| 175 | new_superstructure_goal->wrist.profile_params.max_acceleration = 20; |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 176 | } |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 177 | |
| 178 | // Go to intake position and apply vacuum |
| 179 | if (data.IsPressed(kBallHPIntakeForward)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 180 | grab_piece_ = true; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 181 | elevator_wrist_pos_ = kBallHPIntakeForwardPos; |
| 182 | } else if (data.IsPressed(kBallHPIntakeBackward)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 183 | grab_piece_ = true; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 184 | elevator_wrist_pos_ = kBallHPIntakeBackwardPos; |
| 185 | } |
| 186 | |
| 187 | // Go to elevator/wrist position. Overrides intake position if pressed so |
| 188 | // we can re-grab the ball. |
| 189 | if (data.IsPressed(kRocketForwardLower)) { |
| 190 | elevator_wrist_pos_ = kBallForwardLowerPos; |
| 191 | } else if (data.IsPressed(kRocketBackwardLower)) { |
| 192 | elevator_wrist_pos_ = kBallBackwardLowerPos; |
| 193 | } else if (data.IsPressed(kRocketForwardMiddle)) { |
| 194 | elevator_wrist_pos_ = kBallForwardMiddlePos; |
| 195 | } else if (data.IsPressed(kRocketBackwardMiddle)) { |
| 196 | elevator_wrist_pos_ = kBallBackwardMiddlePos; |
| 197 | } else if (data.IsPressed(kRocketForwardUpper)) { |
| 198 | elevator_wrist_pos_ = kBallForwardUpperPos; |
| 199 | } else if (data.IsPressed(kRocketBackwardUpper)) { |
| 200 | elevator_wrist_pos_ = kBallBackwardUpperPos; |
| 201 | } else if (data.IsPressed(kCargoForward)) { |
| 202 | elevator_wrist_pos_ = kBallCargoForwardPos; |
| 203 | } else if (data.IsPressed(kCargoBackward)) { |
| 204 | elevator_wrist_pos_ = kBallCargoBackwardPos; |
| 205 | } |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 206 | } else { |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 207 | if (data.IsPressed(kPanelHPIntakeForward)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 208 | grab_piece_ = true; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 209 | elevator_wrist_pos_ = kPanelHPIntakeForwrdPos; |
| 210 | } else if (data.IsPressed(kPanelHPIntakeBackward)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 211 | grab_piece_ = true; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 212 | elevator_wrist_pos_ = kPanelHPIntakeBackwardPos; |
| 213 | } |
| 214 | |
| 215 | // Go to elevator/wrist position. Overrides intake position if pressed so |
| 216 | // we can re-grab the panel. |
| 217 | if (data.IsPressed(kRocketForwardLower)) { |
| 218 | elevator_wrist_pos_ = kPanelForwardLowerPos; |
| 219 | } else if (data.IsPressed(kRocketBackwardLower)) { |
| 220 | elevator_wrist_pos_ = kPanelBackwardLowerPos; |
| 221 | } else if (data.IsPressed(kRocketForwardMiddle)) { |
| 222 | elevator_wrist_pos_ = kPanelForwardMiddlePos; |
| 223 | } else if (data.IsPressed(kRocketBackwardMiddle)) { |
| 224 | elevator_wrist_pos_ = kPanelBackwardMiddlePos; |
| 225 | } else if (data.IsPressed(kRocketForwardUpper)) { |
| 226 | elevator_wrist_pos_ = kPanelForwardUpperPos; |
| 227 | } else if (data.IsPressed(kRocketBackwardUpper)) { |
| 228 | elevator_wrist_pos_ = kPanelBackwardUpperPos; |
Sabina Davis | e6fe6c5 | 2019-03-03 15:48:51 -0800 | [diff] [blame] | 229 | } else if (data.IsPressed(kCargoForward)) { |
| 230 | elevator_wrist_pos_ = kPanelCargoForwardPos; |
| 231 | } else if (data.IsPressed(kCargoBackward)) { |
| 232 | elevator_wrist_pos_ = kPanelCargoBackwardPos; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 233 | } |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 234 | } |
| 235 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 236 | if (switch_ball_) { |
| 237 | if (kDoBallOutake || |
| 238 | (kDoBallIntake && !superstructure_queue.status->has_piece)) { |
| 239 | new_superstructure_goal->intake.unsafe_goal = 0.959327; |
| 240 | } |
Austin Schuh | 23a5163 | 2019-02-19 16:50:36 -0800 | [diff] [blame] | 241 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 242 | if (kDoBallIntake && !superstructure_queue.status->has_piece) { |
| 243 | elevator_wrist_pos_ = kBallIntakePos; |
| 244 | new_superstructure_goal->roller_voltage = 9.0; |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 245 | grab_piece_ = true; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 246 | } else { |
| 247 | if (kDoBallOutake) { |
| 248 | new_superstructure_goal->roller_voltage = -6.0; |
| 249 | } else { |
| 250 | new_superstructure_goal->intake.unsafe_goal = -1.2; |
| 251 | new_superstructure_goal->roller_voltage = 0.0; |
| 252 | } |
| 253 | } |
Austin Schuh | 23a5163 | 2019-02-19 16:50:36 -0800 | [diff] [blame] | 254 | } |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 255 | |
| 256 | if (data.IsPressed(kRelease)) { |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 257 | grab_piece_ = false; |
Austin Schuh | 1a17e13 | 2019-02-17 15:05:06 -0800 | [diff] [blame] | 258 | } |
| 259 | |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 260 | if (switch_ball_) { |
| 261 | new_superstructure_goal->suction.gamepiece_mode = 0; |
| 262 | } else { |
| 263 | new_superstructure_goal->suction.gamepiece_mode = 1; |
| 264 | } |
| 265 | |
| 266 | new_superstructure_goal->suction.grab_piece = grab_piece_; |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 267 | |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 268 | new_superstructure_goal->elevator.unsafe_goal = |
| 269 | elevator_wrist_pos_.elevator; |
| 270 | new_superstructure_goal->wrist.unsafe_goal = elevator_wrist_pos_.wrist; |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 271 | |
| 272 | LOG_STRUCT(DEBUG, "sending goal", *new_superstructure_goal); |
| 273 | if (!new_superstructure_goal.Send()) { |
| 274 | LOG(ERROR, "Sending superstructure goal failed.\n"); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | private: |
| 279 | // Current goals here. |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 280 | ElevatorWristPosition elevator_wrist_pos_ = kStowPos; |
Sabina Davis | c632934 | 2019-03-01 20:44:42 -0800 | [diff] [blame] | 281 | bool grab_piece_ = false; |
Tyler Chatow | 7bcb52f | 2019-02-24 00:16:54 -0800 | [diff] [blame] | 282 | |
| 283 | bool switch_ball_ = false; |
| 284 | bool stilts_was_above_ = false; |
Sabina Davis | 91b2360 | 2019-01-21 00:06:01 -0800 | [diff] [blame] | 285 | }; |
| 286 | |
| 287 | } // namespace joysticks |
| 288 | } // namespace input |
| 289 | } // namespace y2019 |
| 290 | |
| 291 | int main() { |
| 292 | ::aos::Init(-1); |
| 293 | ::aos::ShmEventLoop event_loop; |
| 294 | ::y2019::input::joysticks::Reader reader(&event_loop); |
| 295 | reader.Run(); |
| 296 | ::aos::Cleanup(); |
| 297 | } |