Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <string.h> |
| 3 | #include <unistd.h> |
| 4 | #include <math.h> |
| 5 | |
| 6 | #include "aos/linux_code/init.h" |
Brian Silverman | c206573 | 2015-11-28 22:55:30 +0000 | [diff] [blame] | 7 | #include "aos/input/joystick_input.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 8 | #include "aos/common/input/driver_station_data.h" |
| 9 | #include "aos/common/logging/logging.h" |
| 10 | #include "aos/common/util/log_interval.h" |
| 11 | #include "aos/common/time.h" |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 12 | #include "aos/common/actions/actions.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 13 | |
Brian Silverman | b691f5e | 2015-08-02 11:37:55 -0700 | [diff] [blame] | 14 | #include "y2015/control_loops/claw/claw.q.h" |
Austin Schuh | 70810b9 | 2016-11-26 14:55:34 -0800 | [diff] [blame^] | 15 | #include "frc971/control_loops/drivetrain/drivetrain.q.h" |
Brian Silverman | b691f5e | 2015-08-02 11:37:55 -0700 | [diff] [blame] | 16 | #include "y2015/control_loops/fridge/fridge.q.h" |
| 17 | #include "y2015/constants.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 18 | #include "frc971/queues/gyro.q.h" |
| 19 | #include "frc971/autonomous/auto.q.h" |
Austin Schuh | bb227f8 | 2015-09-06 15:27:52 -0700 | [diff] [blame] | 20 | #include "y2015/autonomous/auto.q.h" |
Brian Silverman | b691f5e | 2015-08-02 11:37:55 -0700 | [diff] [blame] | 21 | #include "y2015/actors/pickup_actor.h" |
| 22 | #include "y2015/actors/stack_actor.h" |
| 23 | #include "y2015/actors/score_actor.h" |
| 24 | #include "y2015/actors/stack_and_lift_actor.h" |
| 25 | #include "y2015/actors/stack_and_hold_actor.h" |
| 26 | #include "y2015/actors/held_to_lift_actor.h" |
| 27 | #include "y2015/actors/lift_actor.h" |
| 28 | #include "y2015/actors/can_pickup_actor.h" |
| 29 | #include "y2015/actors/horizontal_can_pickup_actor.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 30 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 31 | using ::frc971::control_loops::claw_queue; |
Brian Silverman | ada5f2c | 2015-02-01 02:41:14 -0500 | [diff] [blame] | 32 | using ::frc971::control_loops::drivetrain_queue; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 33 | using ::frc971::control_loops::fridge_queue; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 34 | using ::frc971::sensors::gyro_reading; |
| 35 | |
| 36 | using ::aos::input::driver_station::ButtonLocation; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 37 | using ::aos::input::driver_station::POVLocation; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 38 | using ::aos::input::driver_station::JoystickAxis; |
| 39 | using ::aos::input::driver_station::ControlBit; |
| 40 | |
| 41 | namespace frc971 { |
| 42 | namespace input { |
| 43 | namespace joysticks { |
| 44 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 45 | // Actions needed. |
| 46 | |
| 47 | // Human Player Station Intake Button |
| 48 | // Claw open |
| 49 | // Claw close |
| 50 | // Claw down |
| 51 | |
| 52 | // Stack + Lift (together) |
| 53 | // Place |
| 54 | |
| 55 | // Hold stack |
| 56 | |
| 57 | // Horizontal can pickup |
| 58 | // Vertical can pickup |
| 59 | |
| 60 | // TODO(austin): Pull a lot of the constants below out up here so they can be |
| 61 | // globally changed easier. |
| 62 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 63 | // preset motion limits |
Brian Silverman | cb615cf | 2015-03-21 21:42:35 -0700 | [diff] [blame] | 64 | constexpr actors::ProfileParams kArmMove{0.5, 1.0}; |
| 65 | constexpr actors::ProfileParams kElevatorMove{0.3, 1.0}; |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 66 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 67 | const JoystickAxis kSteeringWheel(1, 1), kDriveThrottle(2, 2); |
Campbell Crowley | 5b27f02 | 2016-02-20 16:55:35 -0800 | [diff] [blame] | 68 | const ButtonLocation kShiftHigh(2, 3), kShiftLow(2, 1); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 69 | const ButtonLocation kQuickTurn(1, 5); |
| 70 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 71 | //const ButtonLocation kClawClosed(3, 5); |
| 72 | //const ButtonLocation kFridgeClosed(3, 1); |
Austin Schuh | d8b2a24 | 2015-02-22 21:46:53 -0800 | [diff] [blame] | 73 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 74 | |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 75 | const ButtonLocation kStackAndHold(3, 5); |
| 76 | const ButtonLocation kRollersIn(3, 2); |
| 77 | const ButtonLocation kHorizontalCanRollersIn(4, 5); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 78 | const ButtonLocation kClawToggle(4, 1); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 79 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 80 | const POVLocation kElevatorCanUp(4, 0); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 81 | |
| 82 | // POV stick 3, 180 |
| 83 | const POVLocation kCanPickup(4, 180); |
| 84 | const ButtonLocation kToteChute(4, 6); |
| 85 | const ButtonLocation kStackAndLift(4, 7); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 86 | |
| 87 | // Pull in the 6th tote. |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 88 | //const ButtonLocation kSixthTote(4, 10); |
| 89 | const ButtonLocation kCanUp(4, 10); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 90 | |
| 91 | const ButtonLocation kHeldToLift(4, 11); |
| 92 | const ButtonLocation kPickup(4, 9); |
| 93 | |
| 94 | const ButtonLocation kStack(4, 2); |
| 95 | |
| 96 | // Move the fridge out with the stack in preparation for scoring. |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 97 | const ButtonLocation kScore(4, 8); |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 98 | const ButtonLocation kCoopTop(3, 8); |
| 99 | const ButtonLocation kCoopTopRetract(3, 7); |
| 100 | const ButtonLocation kCoopBottom(3, 6); |
Brian Silverman | d427830 | 2015-03-28 00:21:15 -0400 | [diff] [blame] | 101 | const ButtonLocation kCoopBottomRetract(4, 12); |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 102 | |
Brian Silverman | d427830 | 2015-03-28 00:21:15 -0400 | [diff] [blame] | 103 | const ButtonLocation kCanReset(3, 9); |
Austin Schuh | bb227f8 | 2015-09-06 15:27:52 -0700 | [diff] [blame] | 104 | const ButtonLocation kCanGrabberLift(2, 1); |
| 105 | const ButtonLocation kFastCanGrabberLift(2, 3); |
Brian Silverman | b9811eb | 2015-03-20 16:54:41 -0700 | [diff] [blame] | 106 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 107 | const POVLocation kFridgeToggle(4, 270); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 108 | const ButtonLocation kSpit(4, 3); |
| 109 | |
| 110 | // Set stack down in the bot. |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 111 | const POVLocation kSetStackDownAndHold(4, 90); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 112 | |
Austin Schuh | 959d202 | 2015-03-29 13:51:11 -0700 | [diff] [blame] | 113 | const double kClawTotePackAngle = 0.90; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 114 | const double kArmRaiseLowerClearance = -0.08; |
Brian Silverman | 654b512 | 2015-03-20 16:58:04 -0700 | [diff] [blame] | 115 | const double kClawStackClearance = 0.55; |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 116 | const double kHorizontalCanClawAngle = 0.12; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 117 | |
Austin Schuh | 959d202 | 2015-03-29 13:51:11 -0700 | [diff] [blame] | 118 | const double kStackUpHeight = 0.60; |
| 119 | const double kStackUpArm = 0.0; |
Brian Silverman | 697d07b | 2015-03-19 23:41:11 -0700 | [diff] [blame] | 120 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 121 | class Reader : public ::aos::input::JoystickInput { |
| 122 | public: |
Austin Schuh | 331e13d | 2015-02-15 00:16:51 -0800 | [diff] [blame] | 123 | Reader() : was_running_(false) {} |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 124 | |
Brian Silverman | b9811eb | 2015-03-20 16:54:41 -0700 | [diff] [blame] | 125 | static actors::ScoreParams MakeScoreParams() { |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 126 | actors::ScoreParams r; |
Brian Silverman | b9811eb | 2015-03-20 16:54:41 -0700 | [diff] [blame] | 127 | r.move_the_stack = r.place_the_stack = true; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 128 | r.upper_move_height = 0.14; |
| 129 | r.begin_horizontal_move_height = 0.13; |
| 130 | r.horizontal_move_target = -0.7; |
Austin Schuh | 45ee2c5 | 2015-03-29 13:47:26 -0700 | [diff] [blame] | 131 | r.horizontal_start_lowering = -0.65; |
| 132 | r.home_lift_horizontal_start_position = -0.60; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 133 | r.place_height = -0.10; |
Austin Schuh | 45ee2c5 | 2015-03-29 13:47:26 -0700 | [diff] [blame] | 134 | r.home_return_height = 0.05; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 135 | return r; |
| 136 | } |
| 137 | |
| 138 | static actors::ScoreParams MakeCoopTopParams(bool place_the_stack) { |
| 139 | actors::ScoreParams r; |
Brian Silverman | b9811eb | 2015-03-20 16:54:41 -0700 | [diff] [blame] | 140 | r.move_the_stack = !place_the_stack; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 141 | r.place_the_stack = place_the_stack; |
| 142 | r.upper_move_height = 0.52; |
| 143 | r.begin_horizontal_move_height = 0.5; |
| 144 | r.horizontal_move_target = -0.48; |
Austin Schuh | 45ee2c5 | 2015-03-29 13:47:26 -0700 | [diff] [blame] | 145 | r.horizontal_start_lowering = r.horizontal_move_target; |
| 146 | r.home_lift_horizontal_start_position = -0.3; |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 147 | r.place_height = 0.35; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 148 | r.home_return_height = 0.1; |
| 149 | return r; |
| 150 | } |
| 151 | |
| 152 | static actors::ScoreParams MakeCoopBottomParams(bool place_the_stack) { |
| 153 | actors::ScoreParams r; |
Brian Silverman | b9811eb | 2015-03-20 16:54:41 -0700 | [diff] [blame] | 154 | r.move_the_stack = !place_the_stack; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 155 | r.place_the_stack = place_the_stack; |
| 156 | r.upper_move_height = 0.17; |
| 157 | r.begin_horizontal_move_height = 0.16; |
| 158 | r.horizontal_move_target = -0.7; |
Austin Schuh | 45ee2c5 | 2015-03-29 13:47:26 -0700 | [diff] [blame] | 159 | r.horizontal_start_lowering = r.horizontal_move_target; |
| 160 | r.home_lift_horizontal_start_position = -0.3; |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 161 | r.place_height = 0.0; |
| 162 | r.home_return_height = 0.1; |
| 163 | return r; |
| 164 | } |
| 165 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 166 | virtual void RunIteration(const ::aos::input::driver_station::Data &data) { |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 167 | bool last_auto_running = auto_running_; |
| 168 | auto_running_ = data.GetControlBit(ControlBit::kAutonomous) && |
Brian Silverman | e1103e6 | 2015-02-15 02:03:38 -0500 | [diff] [blame] | 169 | data.GetControlBit(ControlBit::kEnabled); |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 170 | if (auto_running_ != last_auto_running) { |
| 171 | if (auto_running_) { |
| 172 | StartAuto(); |
| 173 | } else { |
| 174 | StopAuto(); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 175 | } |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | if (!data.GetControlBit(ControlBit::kAutonomous)) { |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 179 | HandleDrivetrain(data); |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 180 | HandleTeleop(data); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 181 | } |
| 182 | } |
| 183 | |
| 184 | void HandleDrivetrain(const ::aos::input::driver_station::Data &data) { |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 185 | const double wheel = -data.GetAxis(kSteeringWheel); |
| 186 | const double throttle = -data.GetAxis(kDriveThrottle); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 187 | |
Brian Silverman | ada5f2c | 2015-02-01 02:41:14 -0500 | [diff] [blame] | 188 | if (!drivetrain_queue.goal.MakeWithBuilder() |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 189 | .steering(wheel) |
| 190 | .throttle(throttle) |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 191 | .quickturn(data.IsPressed(kQuickTurn)) |
Austin Schuh | 331e13d | 2015-02-15 00:16:51 -0800 | [diff] [blame] | 192 | .control_loop_driving(false) |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 193 | .Send()) { |
| 194 | LOG(WARNING, "sending stick values failed\n"); |
| 195 | } |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | void HandleTeleop(const ::aos::input::driver_station::Data &data) { |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 199 | double intake_power = 0.0; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 200 | if (!data.GetControlBit(ControlBit::kEnabled)) { |
| 201 | action_queue_.CancelAllActions(); |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 202 | LOG(DEBUG, "Canceling\n"); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 203 | } |
Austin Schuh | bb227f8 | 2015-09-06 15:27:52 -0700 | [diff] [blame] | 204 | if (data.IsPressed(kCanGrabberLift)) { |
| 205 | autonomous::can_control.MakeWithBuilder().can_voltage(-4).Send(); |
| 206 | } else if (data.IsPressed(kFastCanGrabberLift)) { |
| 207 | autonomous::can_control.MakeWithBuilder().can_voltage(-12).Send(); |
| 208 | } |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 209 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 210 | if (data.IsPressed(kRollersIn)) { |
| 211 | intake_power = 10.0; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 212 | claw_goal_ = 0.0; |
Austin Schuh | d8b2a24 | 2015-02-22 21:46:53 -0800 | [diff] [blame] | 213 | } |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 214 | if (data.IsPressed(kHorizontalCanRollersIn)) { |
| 215 | intake_power = 10.0; |
| 216 | claw_goal_ = kHorizontalCanClawAngle; |
| 217 | } |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 218 | if (data.IsPressed(kSpit)) { |
| 219 | intake_power = -12.0; |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 220 | action_queue_.CancelAllActions(); |
Austin Schuh | d8b2a24 | 2015-02-22 21:46:53 -0800 | [diff] [blame] | 221 | } |
Austin Schuh | 994d42c | 2015-03-01 00:02:17 -0800 | [diff] [blame] | 222 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 223 | // Toggle button for the claw |
| 224 | if (data.PosEdge(kClawToggle)) { |
| 225 | claw_rollers_closed_ = !claw_rollers_closed_; |
Austin Schuh | 994d42c | 2015-03-01 00:02:17 -0800 | [diff] [blame] | 226 | } |
| 227 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 228 | /* |
| 229 | if (data.IsPressed(kClawClosed)) { |
| 230 | claw_rollers_closed_ = true; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 231 | } |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 232 | */ |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 233 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 234 | // Horizontal can pickup. |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 235 | if (data.PosEdge(kElevatorCanUp)) { |
| 236 | actors::HorizontalCanPickupParams params; |
| 237 | params.elevator_height = 0.3; |
Austin Schuh | 4db921a | 2015-04-19 19:59:24 -0700 | [diff] [blame] | 238 | params.pickup_angle = 0.80 + kHorizontalCanClawAngle; |
| 239 | params.spit_time = 0.01; |
| 240 | params.spit_power = -8.0; |
| 241 | |
Austin Schuh | bb227f8 | 2015-09-06 15:27:52 -0700 | [diff] [blame] | 242 | params.suck_time = 0.040; |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 243 | params.suck_power = 10.0; |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 244 | |
| 245 | params.claw_settle_time = 0.05; |
| 246 | params.claw_settle_power = 5.0; |
| 247 | params.claw_full_lift_angle = 1.35; |
| 248 | params.claw_end_angle = 0.5; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 249 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 250 | // End low so we don't drop it. |
Austin Schuh | 335fd0d | 2015-04-19 20:02:38 -0700 | [diff] [blame] | 251 | params.elevator_end_height = 0.28; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 252 | params.arm_end_angle = 0.0; |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 253 | action_queue_.EnqueueAction( |
| 254 | actors::MakeHorizontalCanPickupAction(params)); |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 255 | fridge_closed_ = true; |
| 256 | } |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 257 | |
| 258 | // -0.942503 arm, 0.374752 elevator |
| 259 | // Vertical can pickup. |
| 260 | if (data.PosEdge(kCanPickup)) { |
| 261 | actors::CanPickupParams params; |
Austin Schuh | 90f2854 | 2015-03-29 13:46:03 -0700 | [diff] [blame] | 262 | params.pickup_x = 0.6; |
| 263 | params.pickup_y = 0.1; |
Austin Schuh | 335fd0d | 2015-04-19 20:02:38 -0700 | [diff] [blame] | 264 | params.lift_height = 0.25; |
Austin Schuh | 90f2854 | 2015-03-29 13:46:03 -0700 | [diff] [blame] | 265 | params.pickup_goal_before_move_height = 0.3; |
| 266 | params.start_lowering_x = 0.1; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 267 | // End low so the can is supported. |
Austin Schuh | 90f2854 | 2015-03-29 13:46:03 -0700 | [diff] [blame] | 268 | params.before_place_height = 0.4; |
Austin Schuh | 335fd0d | 2015-04-19 20:02:38 -0700 | [diff] [blame] | 269 | params.end_height = 0.28; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 270 | params.end_angle = 0.0; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 271 | action_queue_.EnqueueAction(actors::MakeCanPickupAction(params)); |
| 272 | fridge_closed_ = true; |
| 273 | } |
| 274 | |
Brian Silverman | cb615cf | 2015-03-21 21:42:35 -0700 | [diff] [blame] | 275 | if (data.PosEdge(kCanReset)) { |
| 276 | action_queue_.CancelAllActions(); |
Austin Schuh | 335fd0d | 2015-04-19 20:02:38 -0700 | [diff] [blame] | 277 | elevator_goal_ = 0.28; |
Brian Silverman | cb615cf | 2015-03-21 21:42:35 -0700 | [diff] [blame] | 278 | arm_goal_ = 0.0; |
| 279 | } |
| 280 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 281 | // Tote chute pull in when button is pressed, pack when done. |
| 282 | if (data.IsPressed(kToteChute)) { |
Austin Schuh | e301c71 | 2015-04-17 19:29:21 -0700 | [diff] [blame] | 283 | claw_goal_ = 0.8; |
| 284 | intake_power = 6.0; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 285 | } |
| 286 | if (data.NegEdge(kToteChute)) { |
| 287 | claw_goal_ = kClawTotePackAngle; |
| 288 | } |
| 289 | |
| 290 | if (data.PosEdge(kStackAndLift)) { |
| 291 | actors::StackAndLiftParams params; |
Austin Schuh | 959d202 | 2015-03-29 13:51:11 -0700 | [diff] [blame] | 292 | params.stack_params.claw_out_angle = kClawTotePackAngle; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 293 | params.stack_params.bottom = 0.020; |
| 294 | params.stack_params.over_box_before_place_height = 0.39; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 295 | params.stack_params.arm_clearance = kArmRaiseLowerClearance; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 296 | |
| 297 | params.grab_after_stack = true; |
Austin Schuh | 959d202 | 2015-03-29 13:51:11 -0700 | [diff] [blame] | 298 | params.clamp_pause_time = 0.0; |
Brian Silverman | 697d07b | 2015-03-19 23:41:11 -0700 | [diff] [blame] | 299 | params.lift_params.lift_height = kStackUpHeight; |
| 300 | params.lift_params.lift_arm = kStackUpArm; |
Austin Schuh | 3cba379 | 2015-04-19 20:01:22 -0700 | [diff] [blame] | 301 | params.lift_params.second_lift = false; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 302 | params.grab_after_lift = true; |
| 303 | fridge_closed_ = true; |
| 304 | |
| 305 | action_queue_.EnqueueAction(actors::MakeStackAndLiftAction(params)); |
| 306 | } |
| 307 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 308 | if (data.PosEdge(kStackAndHold) || data.PosEdge(kSetStackDownAndHold)) { |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 309 | actors::StackAndHoldParams params; |
| 310 | params.bottom = 0.020; |
| 311 | params.over_box_before_place_height = 0.39; |
| 312 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 313 | params.arm_clearance = kArmRaiseLowerClearance; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 314 | params.clamp_pause_time = 0.25; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 315 | params.claw_clamp_angle = kClawTotePackAngle; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 316 | |
| 317 | params.hold_height = 0.68; |
Austin Schuh | 959d202 | 2015-03-29 13:51:11 -0700 | [diff] [blame] | 318 | params.claw_out_angle = kClawTotePackAngle; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 319 | |
| 320 | if (data.PosEdge(kSetStackDownAndHold)) { |
| 321 | params.place_not_stack = true; |
| 322 | params.clamp_pause_time = 0.1; |
| 323 | //params.claw_clamp_angle = kClawTotePackAngle - 0.5; |
| 324 | } else { |
| 325 | params.place_not_stack = false; |
| 326 | } |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 327 | |
| 328 | action_queue_.EnqueueAction(actors::MakeStackAndHoldAction(params)); |
| 329 | fridge_closed_ = true; |
| 330 | } |
| 331 | |
| 332 | // TODO(austin): Figure out what action needed to pull the 6th tote into the |
| 333 | // claw. |
| 334 | |
| 335 | // Lower the fridge from holding the stack, grab the stack, and then lift. |
| 336 | if (data.PosEdge(kHeldToLift)) { |
| 337 | actors::HeldToLiftParams params; |
Austin Schuh | 4fef0df | 2015-04-17 19:29:32 -0700 | [diff] [blame] | 338 | params.arm_clearance = kArmRaiseLowerClearance; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 339 | params.clamp_pause_time = 0.1; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 340 | params.before_lift_settle_time = 0.1; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 341 | params.bottom_height = 0.020; |
Austin Schuh | 4fef0df | 2015-04-17 19:29:32 -0700 | [diff] [blame] | 342 | params.claw_out_angle = kClawStackClearance; |
Brian Silverman | 697d07b | 2015-03-19 23:41:11 -0700 | [diff] [blame] | 343 | params.lift_params.lift_height = kStackUpHeight; |
| 344 | params.lift_params.lift_arm = kStackUpArm; |
Austin Schuh | 3cba379 | 2015-04-19 20:01:22 -0700 | [diff] [blame] | 345 | params.lift_params.second_lift = false; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 346 | fridge_closed_ = true; |
| 347 | |
| 348 | action_queue_.EnqueueAction(actors::MakeHeldToLiftAction(params)); |
| 349 | } |
| 350 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 351 | // Lift the can up. |
| 352 | if (data.PosEdge(kCanUp)) { |
| 353 | actors::LiftParams params; |
| 354 | params.lift_height = 0.68; |
| 355 | params.lift_arm = 0.3; |
Brian Silverman | 697d07b | 2015-03-19 23:41:11 -0700 | [diff] [blame] | 356 | params.pack_claw = false; |
| 357 | params.pack_claw_angle = 0; |
Austin Schuh | 3cba379 | 2015-04-19 20:01:22 -0700 | [diff] [blame] | 358 | params.intermediate_lift_height = 0.37; |
| 359 | params.second_lift = true; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 360 | fridge_closed_ = true; |
| 361 | |
| 362 | action_queue_.EnqueueAction(actors::MakeLiftAction(params)); |
| 363 | } |
| 364 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 365 | // Pick up a tote from the ground and put it in the bottom of the bot. |
| 366 | if (data.PosEdge(kPickup)) { |
| 367 | actors::PickupParams params; |
Austin Schuh | 7f925ac | 2015-04-18 22:56:22 -0700 | [diff] [blame] | 368 | // TODO(austin): These parameters are coppied into auto right now, need |
| 369 | // to dedup... |
| 370 | |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 371 | // Lift to here initially. |
| 372 | params.pickup_angle = 0.9; |
| 373 | // Start sucking here |
| 374 | params.suck_angle = 0.8; |
| 375 | // Go back down to here to finish sucking. |
| 376 | params.suck_angle_finish = 0.4; |
| 377 | // Pack the box back in here. |
| 378 | params.pickup_finish_angle = kClawTotePackAngle; |
| 379 | params.intake_time = 0.8; |
| 380 | params.intake_voltage = 7.0; |
| 381 | action_queue_.EnqueueAction(actors::MakePickupAction(params)); |
| 382 | } |
| 383 | |
| 384 | // Place stack on a tote in the tray, and grab it. |
| 385 | if (data.PosEdge(kStack)) { |
| 386 | actors::StackParams params; |
Austin Schuh | 959d202 | 2015-03-29 13:51:11 -0700 | [diff] [blame] | 387 | params.claw_out_angle = kClawTotePackAngle; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 388 | params.bottom = 0.020; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 389 | params.only_place = false; |
| 390 | params.arm_clearance = kArmRaiseLowerClearance; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 391 | params.over_box_before_place_height = 0.39; |
| 392 | action_queue_.EnqueueAction(actors::MakeStackAction(params)); |
| 393 | claw_rollers_closed_ = true; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 394 | fridge_closed_ = true; |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 395 | } |
| 396 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 397 | if (data.PosEdge(kScore)) { |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 398 | action_queue_.EnqueueAction( |
Brian Silverman | b9811eb | 2015-03-20 16:54:41 -0700 | [diff] [blame] | 399 | actors::MakeScoreAction(MakeScoreParams())); |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 400 | fridge_closed_ = false; |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 401 | } |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 402 | |
Brian Silverman | 913eafa | 2015-03-19 23:42:16 -0700 | [diff] [blame] | 403 | if (data.PosEdge(kCoopTop)) { |
| 404 | action_queue_.EnqueueAction( |
| 405 | actors::MakeScoreAction(MakeCoopTopParams(false))); |
| 406 | } |
| 407 | if (data.PosEdge(kCoopTopRetract)) { |
| 408 | action_queue_.EnqueueAction( |
| 409 | actors::MakeScoreAction(MakeCoopTopParams(true))); |
| 410 | fridge_closed_ = false; |
| 411 | } |
| 412 | |
| 413 | if (data.PosEdge(kCoopBottom)) { |
| 414 | action_queue_.EnqueueAction( |
| 415 | actors::MakeScoreAction(MakeCoopBottomParams(false))); |
| 416 | } |
| 417 | if (data.PosEdge(kCoopBottomRetract)) { |
| 418 | action_queue_.EnqueueAction( |
| 419 | actors::MakeScoreAction(MakeCoopBottomParams(true))); |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 420 | fridge_closed_ = false; |
| 421 | } |
| 422 | |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 423 | if (data.PosEdge(kFridgeToggle)) { |
| 424 | fridge_closed_ = !fridge_closed_; |
| 425 | } |
| 426 | |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 427 | if (data.PosEdge(ControlBit::kEnabled)) { |
| 428 | // If we got enabled, wait for everything to zero. |
| 429 | LOG(INFO, "Waiting for zero.\n"); |
| 430 | waiting_for_zero_ = true; |
| 431 | } |
| 432 | |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 433 | claw_queue.status.FetchLatest(); |
| 434 | fridge_queue.status.FetchLatest(); |
| 435 | if (!claw_queue.status.get()) { |
| 436 | LOG(ERROR, "Got no claw status packet.\n"); |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 437 | } |
| 438 | if (!fridge_queue.status.get()) { |
| 439 | LOG(ERROR, "Got no fridge status packet.\n"); |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 440 | } |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 441 | |
Brian Silverman | ea91f59 | 2015-03-28 18:25:57 -0400 | [diff] [blame] | 442 | if (claw_queue.status.get() && fridge_queue.status.get() && |
| 443 | claw_queue.status->zeroed && fridge_queue.status->zeroed) { |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 444 | if (waiting_for_zero_) { |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 445 | LOG(INFO, "Zeroed! Starting teleop mode.\n"); |
| 446 | waiting_for_zero_ = false; |
| 447 | |
| 448 | // Set the initial goals to where we are now. |
Austin Schuh | 2cee0b5 | 2015-03-29 13:41:39 -0700 | [diff] [blame] | 449 | elevator_goal_ = 0.3; |
| 450 | arm_goal_ = 0.0; |
| 451 | claw_goal_ = 0.6; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 452 | } |
| 453 | } else { |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 454 | waiting_for_zero_ = true; |
Austin Schuh | 700b922 | 2015-03-01 03:03:15 -0800 | [diff] [blame] | 455 | } |
| 456 | |
| 457 | if (!waiting_for_zero_) { |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 458 | if (!action_queue_.Running()) { |
| 459 | auto new_fridge_goal = fridge_queue.goal.MakeMessage(); |
Austin Schuh | 6e242ac | 2015-03-07 17:08:21 -0800 | [diff] [blame] | 460 | new_fridge_goal->max_velocity = elevator_params_.velocity; |
| 461 | new_fridge_goal->max_acceleration = elevator_params_.acceleration; |
Austin Schuh | 1d44bd4 | 2015-03-15 16:40:45 -0700 | [diff] [blame] | 462 | new_fridge_goal->profiling_type = 0; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 463 | new_fridge_goal->height = elevator_goal_; |
Austin Schuh | 6e242ac | 2015-03-07 17:08:21 -0800 | [diff] [blame] | 464 | new_fridge_goal->velocity = 0.0; |
| 465 | new_fridge_goal->max_angular_velocity = arm_params_.velocity; |
| 466 | new_fridge_goal->max_angular_acceleration = arm_params_.acceleration; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 467 | new_fridge_goal->angle = arm_goal_; |
| 468 | new_fridge_goal->angular_velocity = 0.0; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 469 | new_fridge_goal->grabbers.top_front = fridge_closed_; |
| 470 | new_fridge_goal->grabbers.top_back = fridge_closed_; |
| 471 | new_fridge_goal->grabbers.bottom_front = fridge_closed_; |
| 472 | new_fridge_goal->grabbers.bottom_back = fridge_closed_; |
| 473 | |
| 474 | if (!new_fridge_goal.Send()) { |
| 475 | LOG(ERROR, "Sending fridge goal failed.\n"); |
| 476 | } else { |
| 477 | LOG(DEBUG, "sending goals: elevator: %f, arm: %f\n", elevator_goal_, |
| 478 | arm_goal_); |
| 479 | } |
| 480 | if (!claw_queue.goal.MakeWithBuilder() |
| 481 | .angle(claw_goal_) |
| 482 | .rollers_closed(claw_rollers_closed_) |
Austin Schuh | a534ebe | 2015-03-29 18:23:35 -0700 | [diff] [blame] | 483 | .max_velocity(5.0) |
Brian Silverman | 1004357 | 2015-03-21 23:43:50 -0700 | [diff] [blame] | 484 | .max_acceleration(6.0) |
Austin Schuh | f14727e | 2015-03-08 18:49:12 -0700 | [diff] [blame] | 485 | .intake(intake_power) |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 486 | .Send()) { |
| 487 | LOG(ERROR, "Sending claw goal failed.\n"); |
| 488 | } |
| 489 | } |
| 490 | } |
| 491 | |
Austin Schuh | d8b2a24 | 2015-02-22 21:46:53 -0800 | [diff] [blame] | 492 | if (action_queue_.Running()) { |
| 493 | // If we are running an action, update our goals to the current goals. |
| 494 | control_loops::fridge_queue.status.FetchLatest(); |
| 495 | if (control_loops::fridge_queue.status.get()) { |
| 496 | arm_goal_ = control_loops::fridge_queue.status->goal_angle; |
| 497 | elevator_goal_ = control_loops::fridge_queue.status->goal_height; |
| 498 | } else { |
| 499 | LOG(ERROR, "No fridge status!\n"); |
| 500 | } |
| 501 | |
| 502 | // If we are running an action, update our goals to the current goals. |
| 503 | control_loops::claw_queue.status.FetchLatest(); |
| 504 | if (control_loops::claw_queue.status.get()) { |
| 505 | claw_goal_ = control_loops::claw_queue.status->goal_angle; |
| 506 | } else { |
Brian Silverman | ea91f59 | 2015-03-28 18:25:57 -0400 | [diff] [blame] | 507 | LOG(ERROR, "No claw status!\n"); |
Austin Schuh | d8b2a24 | 2015-02-22 21:46:53 -0800 | [diff] [blame] | 508 | } |
| 509 | } |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 510 | action_queue_.Tick(); |
| 511 | was_running_ = action_queue_.Running(); |
| 512 | } |
| 513 | |
| 514 | private: |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 515 | void StartAuto() { |
| 516 | LOG(INFO, "Starting auto mode\n"); |
| 517 | ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(true).Send(); |
| 518 | } |
| 519 | |
| 520 | void StopAuto() { |
| 521 | LOG(INFO, "Stopping auto mode\n"); |
| 522 | ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(false).Send(); |
| 523 | } |
| 524 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 525 | bool was_running_; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 526 | |
| 527 | // Previous goals for systems. |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 528 | double elevator_goal_ = 0.2; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 529 | double arm_goal_ = 0.0; |
| 530 | double claw_goal_ = 0.0; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 531 | bool claw_rollers_closed_ = false; |
| 532 | bool fridge_closed_ = false; |
Austin Schuh | 6e242ac | 2015-03-07 17:08:21 -0800 | [diff] [blame] | 533 | actors::ProfileParams arm_params_ = kArmMove; |
| 534 | actors::ProfileParams elevator_params_ = kElevatorMove; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 535 | |
| 536 | // If we're waiting for the subsystems to zero. |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame] | 537 | bool waiting_for_zero_ = true; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 538 | |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 539 | bool auto_running_ = false; |
| 540 | |
Austin Schuh | 331e13d | 2015-02-15 00:16:51 -0800 | [diff] [blame] | 541 | ::aos::common::actions::ActionQueue action_queue_; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 542 | |
| 543 | ::aos::util::SimpleLogInterval no_drivetrain_status_ = |
| 544 | ::aos::util::SimpleLogInterval(::aos::time::Time::InSeconds(0.2), WARNING, |
| 545 | "no drivetrain status"); |
| 546 | }; |
| 547 | |
| 548 | } // namespace joysticks |
| 549 | } // namespace input |
| 550 | } // namespace frc971 |
| 551 | |
| 552 | int main() { |
Brian Silverman | 5090c43 | 2016-01-02 14:44:26 -0800 | [diff] [blame] | 553 | ::aos::Init(-1); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 554 | ::frc971::input::joysticks::Reader reader; |
| 555 | reader.Run(); |
| 556 | ::aos::Cleanup(); |
| 557 | } |