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" |
| 7 | #include "aos/prime/input/joystick_input.h" |
| 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 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 14 | #include "frc971/control_loops/claw/claw.q.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 15 | #include "frc971/control_loops/drivetrain/drivetrain.q.h" |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 16 | #include "frc971/control_loops/fridge/fridge.q.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 17 | #include "frc971/constants.h" |
| 18 | #include "frc971/queues/gyro.q.h" |
| 19 | #include "frc971/autonomous/auto.q.h" |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 20 | #include "frc971/actors/fridge_profile_action.q.h" |
| 21 | #include "frc971/actors/fridge_profile_actor.h" |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 22 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 23 | using ::frc971::control_loops::claw_queue; |
Brian Silverman | ada5f2c | 2015-02-01 02:41:14 -0500 | [diff] [blame] | 24 | using ::frc971::control_loops::drivetrain_queue; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 25 | using ::frc971::control_loops::fridge_queue; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 26 | using ::frc971::sensors::gyro_reading; |
| 27 | |
| 28 | using ::aos::input::driver_station::ButtonLocation; |
| 29 | using ::aos::input::driver_station::JoystickAxis; |
| 30 | using ::aos::input::driver_station::ControlBit; |
| 31 | |
| 32 | namespace frc971 { |
| 33 | namespace input { |
| 34 | namespace joysticks { |
| 35 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 36 | // preset motion limits |
| 37 | static const double kArmDebugVelocity = 0.17; |
| 38 | static const double kArmDebugAcceleration = 0.8; |
| 39 | static const double kElevatorDebugVelocity = 0.2; |
| 40 | static const double kElevatorDebugAcceleration = 2.2; |
| 41 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 42 | const JoystickAxis kSteeringWheel(1, 1), kDriveThrottle(2, 2); |
| 43 | const ButtonLocation kShiftHigh(2, 1), kShiftLow(2, 3); |
| 44 | const ButtonLocation kQuickTurn(1, 5); |
| 45 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 46 | // TODO(danielp): Real buttons for all of these. |
Austin Schuh | 8a436e8 | 2015-02-16 23:31:28 -0800 | [diff] [blame] | 47 | const ButtonLocation kElevatorUp(3, 10); |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 48 | const ButtonLocation kElevatorDown(3, 3); |
Austin Schuh | 8a436e8 | 2015-02-16 23:31:28 -0800 | [diff] [blame] | 49 | const ButtonLocation kArmUp(3, 8); |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 50 | const ButtonLocation kArmDown(2, 6); |
Austin Schuh | 8a436e8 | 2015-02-16 23:31:28 -0800 | [diff] [blame] | 51 | const ButtonLocation kClawUp(3, 7); |
| 52 | const ButtonLocation kClawDown(3, 6); |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 53 | const ButtonLocation kClawOpen(3, 11); |
| 54 | const ButtonLocation kClawClosed(3, 5); |
| 55 | const ButtonLocation kFridgeOpen(3, 1); |
| 56 | const ButtonLocation kFridgeClosed(2, 11); |
| 57 | const ButtonLocation kRollersIn(3, 4); |
| 58 | const ButtonLocation kClawMiddle(3, 2); |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 59 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 60 | // TODO(ben): Real buttons for all of these. |
| 61 | const ButtonLocation kArmPresetOne(99, 99); |
| 62 | const ButtonLocation kArmPresetTwo(99, 99); |
| 63 | const ButtonLocation kElevatorPresetOne(99, 99); |
| 64 | const ButtonLocation kElevatorPresetTwo(99, 99); |
| 65 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 66 | // Testing mode. |
Austin Schuh | 8a436e8 | 2015-02-16 23:31:28 -0800 | [diff] [blame] | 67 | const double kElevatorVelocity = 0.5; |
| 68 | const double kArmVelocity = 0.5; |
| 69 | const double kClawVelocity = 2.0; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 70 | // TODO(danielp): Verify. |
| 71 | const double kJoystickDt = 0.01; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 72 | |
| 73 | class Reader : public ::aos::input::JoystickInput { |
| 74 | public: |
Austin Schuh | 331e13d | 2015-02-15 00:16:51 -0800 | [diff] [blame] | 75 | Reader() : was_running_(false) {} |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 76 | |
| 77 | virtual void RunIteration(const ::aos::input::driver_station::Data &data) { |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 78 | bool last_auto_running = auto_running_; |
| 79 | auto_running_ = data.GetControlBit(ControlBit::kAutonomous) && |
Brian Silverman | e1103e6 | 2015-02-15 02:03:38 -0500 | [diff] [blame] | 80 | data.GetControlBit(ControlBit::kEnabled); |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 81 | if (auto_running_ != last_auto_running) { |
| 82 | if (auto_running_) { |
| 83 | StartAuto(); |
| 84 | } else { |
| 85 | StopAuto(); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 86 | } |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | if (!data.GetControlBit(ControlBit::kAutonomous)) { |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 90 | HandleDrivetrain(data); |
| 91 | if (data.GetControlBit(ControlBit::kTestMode)) { |
| 92 | HandleTest(data); |
| 93 | } else { |
| 94 | HandleTeleop(data); |
| 95 | } |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | |
| 99 | void HandleDrivetrain(const ::aos::input::driver_station::Data &data) { |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 100 | const double wheel = -data.GetAxis(kSteeringWheel); |
| 101 | const double throttle = -data.GetAxis(kDriveThrottle); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 102 | |
Brian Silverman | ada5f2c | 2015-02-01 02:41:14 -0500 | [diff] [blame] | 103 | if (!drivetrain_queue.goal.MakeWithBuilder() |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 104 | .steering(wheel) |
| 105 | .throttle(throttle) |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 106 | .quickturn(data.IsPressed(kQuickTurn)) |
Austin Schuh | 331e13d | 2015-02-15 00:16:51 -0800 | [diff] [blame] | 107 | .control_loop_driving(false) |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 108 | .Send()) { |
| 109 | LOG(WARNING, "sending stick values failed\n"); |
| 110 | } |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | void HandleTeleop(const ::aos::input::driver_station::Data &data) { |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 114 | if (!data.GetControlBit(ControlBit::kEnabled)) { |
| 115 | action_queue_.CancelAllActions(); |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 116 | LOG(DEBUG, "Canceling\n"); |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 117 | } |
| 118 | |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 119 | if (data.PosEdge(kElevatorUp)) { |
| 120 | elevator_goal_ = 0.4; |
| 121 | arm_goal_ = 0.1; |
| 122 | claw_goal_ = 0.0; |
| 123 | } |
| 124 | if (data.PosEdge(kElevatorDown)) { |
| 125 | elevator_goal_ = 0.03; |
| 126 | arm_goal_ = 0.0; |
| 127 | claw_goal_ = 0.0; |
| 128 | } |
| 129 | |
| 130 | if (data.PosEdge(kClawMiddle)) { |
| 131 | claw_goal_ = 0.9; |
| 132 | } |
| 133 | |
| 134 | if (data.PosEdge(kClawClosed)) { |
| 135 | claw_rollers_closed_ = true; |
| 136 | } |
| 137 | if (data.PosEdge(kClawOpen)) { |
| 138 | claw_rollers_closed_ = false; |
| 139 | } |
| 140 | |
| 141 | if (data.PosEdge(kFridgeClosed)) { |
| 142 | fridge_closed_ = true; |
| 143 | } |
| 144 | if (data.PosEdge(kFridgeOpen)) { |
| 145 | fridge_closed_ = false; |
| 146 | } |
| 147 | |
| 148 | if (data.PosEdge(ControlBit::kEnabled)) { |
| 149 | // If we got enabled, wait for everything to zero. |
| 150 | LOG(INFO, "Waiting for zero.\n"); |
| 151 | waiting_for_zero_ = true; |
| 152 | } |
| 153 | |
| 154 | if (waiting_for_zero_) { |
| 155 | claw_queue.status.FetchLatest(); |
| 156 | fridge_queue.status.FetchLatest(); |
| 157 | if (!claw_queue.status.get()) { |
| 158 | LOG(ERROR, "Got no claw status packet.\n"); |
| 159 | // Not safe to continue. |
| 160 | return; |
| 161 | } |
| 162 | if (!fridge_queue.status.get()) { |
| 163 | LOG(ERROR, "Got no fridge status packet.\n"); |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | if (claw_queue.status->zeroed && fridge_queue.status->zeroed) { |
| 168 | LOG(INFO, "Zeroed! Starting teleop mode.\n"); |
| 169 | waiting_for_zero_ = false; |
| 170 | |
| 171 | // Set the initial goals to where we are now. |
| 172 | elevator_goal_ = fridge_queue.status->goal_height; |
| 173 | arm_goal_ = fridge_queue.status->goal_angle; |
| 174 | claw_goal_ = claw_queue.status->angle; |
| 175 | } else { |
| 176 | return; |
| 177 | } |
| 178 | } else { |
| 179 | if (!action_queue_.Running()) { |
| 180 | auto new_fridge_goal = fridge_queue.goal.MakeMessage(); |
| 181 | new_fridge_goal->height = elevator_goal_; |
| 182 | new_fridge_goal->angle = arm_goal_; |
| 183 | new_fridge_goal->angular_velocity = 0.0; |
| 184 | new_fridge_goal->velocity = 0.0; |
| 185 | new_fridge_goal->grabbers.top_front = fridge_closed_; |
| 186 | new_fridge_goal->grabbers.top_back = fridge_closed_; |
| 187 | new_fridge_goal->grabbers.bottom_front = fridge_closed_; |
| 188 | new_fridge_goal->grabbers.bottom_back = fridge_closed_; |
| 189 | |
| 190 | if (!new_fridge_goal.Send()) { |
| 191 | LOG(ERROR, "Sending fridge goal failed.\n"); |
| 192 | } else { |
| 193 | LOG(DEBUG, "sending goals: elevator: %f, arm: %f\n", elevator_goal_, |
| 194 | arm_goal_); |
| 195 | } |
| 196 | if (!claw_queue.goal.MakeWithBuilder() |
| 197 | .angle(claw_goal_) |
| 198 | .rollers_closed(claw_rollers_closed_) |
| 199 | .intake(data.IsPressed(kRollersIn) ? 12.0 : 0.0) |
| 200 | .Send()) { |
| 201 | LOG(ERROR, "Sending claw goal failed.\n"); |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 206 | action_queue_.Tick(); |
| 207 | was_running_ = action_queue_.Running(); |
| 208 | } |
| 209 | |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 210 | void HandleTest(const ::aos::input::driver_station::Data &data) { |
| 211 | if (action_queue_.Running()) { |
| 212 | // We don't really want any actions running. |
| 213 | LOG(DEBUG, "Cancelling actions for test mode.\n"); |
| 214 | action_queue_.CancelAllActions(); |
| 215 | } |
| 216 | |
| 217 | if (data.GetControlBit(ControlBit::kEnabled)) { |
| 218 | if (data.PosEdge(ControlBit::kEnabled)) { |
| 219 | // If we got enabled, wait for everything to zero. |
| 220 | LOG(INFO, "Waiting for zero.\n"); |
| 221 | waiting_for_zero_ = true; |
| 222 | } |
| 223 | if (waiting_for_zero_) { |
| 224 | claw_queue.status.FetchLatest(); |
| 225 | fridge_queue.status.FetchLatest(); |
| 226 | if (!claw_queue.status.get()) { |
| 227 | LOG(ERROR, "Got no claw status packet.\n"); |
| 228 | // Not safe to continue. |
| 229 | return; |
| 230 | } |
| 231 | if (!fridge_queue.status.get()) { |
| 232 | LOG(ERROR, "Got no fridge status packet.\n"); |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | if (claw_queue.status->zeroed && fridge_queue.status->zeroed) { |
| 237 | LOG(INFO, "Zeroed! Starting test mode.\n"); |
| 238 | waiting_for_zero_ = false; |
| 239 | |
| 240 | // Set the initial goals to where we are now. |
| 241 | elevator_goal_ = fridge_queue.status->height; |
| 242 | arm_goal_ = fridge_queue.status->angle; |
| 243 | claw_goal_ = claw_queue.status->angle; |
| 244 | } else { |
| 245 | return; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // These buttons move a subsystem up or down for as long as they are |
| 250 | // pressed, at low velocity. |
| 251 | if (data.IsPressed(kElevatorUp)) { |
| 252 | elevator_goal_ += kElevatorVelocity * kJoystickDt; |
| 253 | } |
| 254 | if (data.IsPressed(kElevatorDown)) { |
| 255 | elevator_goal_ -= kElevatorVelocity * kJoystickDt; |
| 256 | } |
| 257 | if (data.IsPressed(kArmUp)) { |
| 258 | arm_goal_ += kArmVelocity * kJoystickDt; |
| 259 | } |
| 260 | if (data.IsPressed(kArmDown)) { |
| 261 | arm_goal_ -= kArmVelocity * kJoystickDt; |
| 262 | } |
| 263 | if (data.IsPressed(kClawUp)) { |
| 264 | claw_goal_ += kClawVelocity * kJoystickDt; |
| 265 | } |
| 266 | if (data.IsPressed(kClawDown)) { |
| 267 | claw_goal_ -= kClawVelocity * kJoystickDt; |
| 268 | } |
| 269 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 270 | if (!action_queue_.Running()) { |
| 271 | if (!fridge_queue.goal.MakeWithBuilder() |
| 272 | .height(elevator_goal_) |
| 273 | .angle(arm_goal_) |
| 274 | .Send()) { |
| 275 | LOG(ERROR, "Sending fridge goal failed.\n"); |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 276 | } else { |
| 277 | LOG(DEBUG, "sending goals: elevator: %f, arm: %f\n", elevator_goal_, |
| 278 | arm_goal_); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 279 | } |
| 280 | if (!claw_queue.goal.MakeWithBuilder().angle(claw_goal_).Send()) { |
| 281 | LOG(ERROR, "Sending claw goal failed.\n"); |
| 282 | } |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 283 | } |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 284 | /* |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 285 | if (data.IsPressed(kArmPresetOne) || data.IsPressed(kArmPresetTwo)) { |
| 286 | actors::FridgeProfileParams fridge_params; |
| 287 | fridge_params.arm_max_velocity = kArmDebugVelocity; |
| 288 | fridge_params.arm_max_acceleration = kArmDebugAcceleration; |
| 289 | if (data.IsPressed(kArmPresetOne)) { |
| 290 | LOG(INFO, "Preset asked for test arm position one position.\n"); |
| 291 | fridge_params.arm_angle = M_PI / 4.0; |
| 292 | fridge_params.top_front_grabber = false; |
| 293 | fridge_params.top_back_grabber = false; |
| 294 | fridge_params.bottom_front_grabber = false; |
| 295 | fridge_params.bottom_back_grabber = false; |
| 296 | action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params)); |
| 297 | } else if (data.IsPressed(kArmPresetTwo)) { |
| 298 | LOG(INFO, "Preset asked for test arm position two position.\n"); |
| 299 | fridge_params.arm_angle = -M_PI / 4.0; |
| 300 | fridge_params.top_front_grabber = true; |
| 301 | fridge_params.top_back_grabber = true; |
| 302 | fridge_params.bottom_front_grabber = true; |
| 303 | fridge_params.bottom_back_grabber = true; |
| 304 | action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params)); |
| 305 | } |
| 306 | } else if (data.IsPressed(kElevatorPresetOne) || |
| 307 | data.IsPressed(kElevatorPresetOne)) { |
| 308 | actors::FridgeProfileParams fridge_params; |
| 309 | fridge_params.elevator_max_velocity = kElevatorDebugVelocity; |
| 310 | fridge_params.elevator_max_acceleration = kElevatorDebugAcceleration; |
| 311 | if (data.IsPressed(kElevatorPresetOne)) { |
| 312 | LOG(INFO, "Preset asked for test elevator position one position.\n"); |
| 313 | fridge_params.elevator_height = 0.5; |
| 314 | fridge_params.top_front_grabber = false; |
| 315 | fridge_params.top_back_grabber = false; |
| 316 | fridge_params.bottom_front_grabber = false; |
| 317 | fridge_params.bottom_back_grabber = false; |
| 318 | action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params)); |
| 319 | } else if (data.IsPressed(kElevatorPresetTwo)) { |
| 320 | LOG(INFO, "Preset asked for test elevator position two position.\n"); |
| 321 | fridge_params.elevator_height = 1.2; |
| 322 | fridge_params.top_front_grabber = true; |
| 323 | fridge_params.top_back_grabber = true; |
| 324 | fridge_params.bottom_front_grabber = true; |
| 325 | fridge_params.bottom_back_grabber = true; |
| 326 | action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params)); |
| 327 | } |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 328 | } |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 329 | */ |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 330 | } |
| 331 | } |
| 332 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 333 | private: |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 334 | void StartAuto() { |
| 335 | LOG(INFO, "Starting auto mode\n"); |
| 336 | ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(true).Send(); |
| 337 | } |
| 338 | |
| 339 | void StopAuto() { |
| 340 | LOG(INFO, "Stopping auto mode\n"); |
| 341 | ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(false).Send(); |
| 342 | } |
| 343 | |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 344 | bool was_running_; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 345 | |
| 346 | // Previous goals for systems. |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 347 | double elevator_goal_ = 0.2; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 348 | double arm_goal_ = 0.0; |
| 349 | double claw_goal_ = 0.0; |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 350 | bool claw_rollers_closed_ = false; |
| 351 | bool fridge_closed_ = false; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 352 | |
| 353 | // If we're waiting for the subsystems to zero. |
Austin Schuh | cde7ffe | 2015-02-20 22:10:41 -0800 | [diff] [blame^] | 354 | bool waiting_for_zero_ = true; |
Daniel Petti | 6189652 | 2015-02-15 18:01:43 -0800 | [diff] [blame] | 355 | |
Austin Schuh | 6182f8d | 2015-02-14 22:15:04 -0800 | [diff] [blame] | 356 | bool auto_running_ = false; |
| 357 | |
Austin Schuh | 331e13d | 2015-02-15 00:16:51 -0800 | [diff] [blame] | 358 | ::aos::common::actions::ActionQueue action_queue_; |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 359 | |
| 360 | ::aos::util::SimpleLogInterval no_drivetrain_status_ = |
| 361 | ::aos::util::SimpleLogInterval(::aos::time::Time::InSeconds(0.2), WARNING, |
| 362 | "no drivetrain status"); |
| 363 | }; |
| 364 | |
| 365 | } // namespace joysticks |
| 366 | } // namespace input |
| 367 | } // namespace frc971 |
| 368 | |
| 369 | int main() { |
| 370 | ::aos::Init(); |
| 371 | ::frc971::input::joysticks::Reader reader; |
| 372 | reader.Run(); |
| 373 | ::aos::Cleanup(); |
| 374 | } |