blob: 5d3077cd576593cd9deb5c782712c3e17419582c [file] [log] [blame]
Brian Silverman20141f92015-01-05 17:39:01 -08001#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 Fredricksond69f38b2015-01-28 20:06:15 -080012#include "aos/common/actions/actions.h"
Brian Silverman20141f92015-01-05 17:39:01 -080013
Daniel Petti61896522015-02-15 18:01:43 -080014#include "frc971/control_loops/claw/claw.q.h"
Brian Silverman20141f92015-01-05 17:39:01 -080015#include "frc971/control_loops/drivetrain/drivetrain.q.h"
Daniel Petti61896522015-02-15 18:01:43 -080016#include "frc971/control_loops/fridge/fridge.q.h"
Brian Silverman20141f92015-01-05 17:39:01 -080017#include "frc971/constants.h"
18#include "frc971/queues/gyro.q.h"
19#include "frc971/autonomous/auto.q.h"
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -080020#include "frc971/actors/fridge_profile_actor.h"
Austin Schuhd8b2a242015-02-22 21:46:53 -080021#include "frc971/actors/pickup_actor.h"
22#include "frc971/actors/stack_actor.h"
23#include "frc971/actors/lift_actor.h"
Austin Schuh994d42c2015-03-01 00:02:17 -080024#include "frc971/actors/can_pickup_actor.h"
Brian Silverman20141f92015-01-05 17:39:01 -080025
Daniel Petti61896522015-02-15 18:01:43 -080026using ::frc971::control_loops::claw_queue;
Brian Silvermanada5f2c2015-02-01 02:41:14 -050027using ::frc971::control_loops::drivetrain_queue;
Daniel Petti61896522015-02-15 18:01:43 -080028using ::frc971::control_loops::fridge_queue;
Brian Silverman20141f92015-01-05 17:39:01 -080029using ::frc971::sensors::gyro_reading;
30
31using ::aos::input::driver_station::ButtonLocation;
32using ::aos::input::driver_station::JoystickAxis;
33using ::aos::input::driver_station::ControlBit;
34
35namespace frc971 {
36namespace input {
37namespace joysticks {
38
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -080039// preset motion limits
Austin Schuhd8b2a242015-02-22 21:46:53 -080040static const double kArmDebugVelocity = 0.40;
41static const double kArmDebugAcceleration = 1.0;
42static const double kElevatorDebugVelocity = 0.5;
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -080043static const double kElevatorDebugAcceleration = 2.2;
44
Brian Silverman20141f92015-01-05 17:39:01 -080045const JoystickAxis kSteeringWheel(1, 1), kDriveThrottle(2, 2);
46const ButtonLocation kShiftHigh(2, 1), kShiftLow(2, 3);
47const ButtonLocation kQuickTurn(1, 5);
48
Daniel Petti61896522015-02-15 18:01:43 -080049// TODO(danielp): Real buttons for all of these.
Austin Schuh8a436e82015-02-16 23:31:28 -080050const ButtonLocation kElevatorUp(3, 10);
Austin Schuhcde7ffe2015-02-20 22:10:41 -080051const ButtonLocation kElevatorDown(3, 3);
Austin Schuh8a436e82015-02-16 23:31:28 -080052const ButtonLocation kArmUp(3, 8);
Austin Schuh29dabb62015-03-01 00:13:40 -080053const ButtonLocation kArmHighUp(1, 4);
Austin Schuh994d42c2015-03-01 00:02:17 -080054const ButtonLocation kCanPickup(3, 8);
Austin Schuhcde7ffe2015-02-20 22:10:41 -080055const ButtonLocation kArmDown(2, 6);
Austin Schuh8a436e82015-02-16 23:31:28 -080056const ButtonLocation kClawUp(3, 7);
57const ButtonLocation kClawDown(3, 6);
Austin Schuhcde7ffe2015-02-20 22:10:41 -080058const ButtonLocation kClawOpen(3, 11);
59const ButtonLocation kClawClosed(3, 5);
60const ButtonLocation kFridgeOpen(3, 1);
61const ButtonLocation kFridgeClosed(2, 11);
62const ButtonLocation kRollersIn(3, 4);
63const ButtonLocation kClawMiddle(3, 2);
Austin Schuhd8b2a242015-02-22 21:46:53 -080064const ButtonLocation kPickup(2, 10);
65const ButtonLocation kZero(2, 7);
66
67const ButtonLocation kStack(3, 9);
Daniel Petti61896522015-02-15 18:01:43 -080068
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -080069// TODO(ben): Real buttons for all of these.
70const ButtonLocation kArmPresetOne(99, 99);
71const ButtonLocation kArmPresetTwo(99, 99);
72const ButtonLocation kElevatorPresetOne(99, 99);
73const ButtonLocation kElevatorPresetTwo(99, 99);
74
Daniel Petti61896522015-02-15 18:01:43 -080075// Testing mode.
Austin Schuh8a436e82015-02-16 23:31:28 -080076const double kElevatorVelocity = 0.5;
77const double kArmVelocity = 0.5;
78const double kClawVelocity = 2.0;
Daniel Petti61896522015-02-15 18:01:43 -080079// TODO(danielp): Verify.
80const double kJoystickDt = 0.01;
Brian Silverman20141f92015-01-05 17:39:01 -080081
82class Reader : public ::aos::input::JoystickInput {
83 public:
Austin Schuh331e13d2015-02-15 00:16:51 -080084 Reader() : was_running_(false) {}
Brian Silverman20141f92015-01-05 17:39:01 -080085
86 virtual void RunIteration(const ::aos::input::driver_station::Data &data) {
Austin Schuh6182f8d2015-02-14 22:15:04 -080087 bool last_auto_running = auto_running_;
88 auto_running_ = data.GetControlBit(ControlBit::kAutonomous) &&
Brian Silvermane1103e62015-02-15 02:03:38 -050089 data.GetControlBit(ControlBit::kEnabled);
Austin Schuh6182f8d2015-02-14 22:15:04 -080090 if (auto_running_ != last_auto_running) {
91 if (auto_running_) {
92 StartAuto();
93 } else {
94 StopAuto();
Brian Silverman20141f92015-01-05 17:39:01 -080095 }
Austin Schuh6182f8d2015-02-14 22:15:04 -080096 }
97
98 if (!data.GetControlBit(ControlBit::kAutonomous)) {
Daniel Petti61896522015-02-15 18:01:43 -080099 HandleDrivetrain(data);
100 if (data.GetControlBit(ControlBit::kTestMode)) {
101 HandleTest(data);
102 } else {
103 HandleTeleop(data);
104 }
Brian Silverman20141f92015-01-05 17:39:01 -0800105 }
106 }
107
108 void HandleDrivetrain(const ::aos::input::driver_station::Data &data) {
Brian Silverman20141f92015-01-05 17:39:01 -0800109 const double wheel = -data.GetAxis(kSteeringWheel);
110 const double throttle = -data.GetAxis(kDriveThrottle);
Brian Silverman20141f92015-01-05 17:39:01 -0800111
Brian Silvermanada5f2c2015-02-01 02:41:14 -0500112 if (!drivetrain_queue.goal.MakeWithBuilder()
Brian Silverman20141f92015-01-05 17:39:01 -0800113 .steering(wheel)
114 .throttle(throttle)
Brian Silverman20141f92015-01-05 17:39:01 -0800115 .quickturn(data.IsPressed(kQuickTurn))
Austin Schuh331e13d2015-02-15 00:16:51 -0800116 .control_loop_driving(false)
Brian Silverman20141f92015-01-05 17:39:01 -0800117 .Send()) {
118 LOG(WARNING, "sending stick values failed\n");
119 }
Brian Silverman20141f92015-01-05 17:39:01 -0800120 }
121
122 void HandleTeleop(const ::aos::input::driver_station::Data &data) {
Brian Silverman20141f92015-01-05 17:39:01 -0800123 if (!data.GetControlBit(ControlBit::kEnabled)) {
124 action_queue_.CancelAllActions();
Austin Schuh6182f8d2015-02-14 22:15:04 -0800125 LOG(DEBUG, "Canceling\n");
Brian Silverman20141f92015-01-05 17:39:01 -0800126 }
127
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800128 if (data.PosEdge(kElevatorUp)) {
Austin Schuhd8b2a242015-02-22 21:46:53 -0800129 actors::LiftParams params;
130 params.lift_height = 0.45;
131 params.lift_arm = 0.2;
132 action_queue_.EnqueueAction(actors::MakeLiftAction(params));
133
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800134 claw_goal_ = 0.0;
Austin Schuhd8b2a242015-02-22 21:46:53 -0800135 if (!claw_queue.goal.MakeWithBuilder()
136 .angle(claw_goal_)
137 .rollers_closed(claw_rollers_closed_)
138 .intake(0.0)
139 .Send()) {
140 LOG(ERROR, "Sending claw goal failed.\n");
141 }
142 }
143 if (data.PosEdge(kStack)) {
144 actors::StackParams params;
145 params.claw_out_angle = 0.6;
146 action_queue_.EnqueueAction(actors::MakeStackAction(params));
147 }
Austin Schuh994d42c2015-03-01 00:02:17 -0800148
149 if (data.PosEdge(kCanPickup)) {
150 actors::CanPickupParams params;
151 params.pickup_angle = -0.93;
152 params.pickup_height = 0.265;
153 params.lift_height = 0.65;
154 params.end_height = 0.4;
155 params.end_angle = 0.0;
156 action_queue_.EnqueueAction(actors::MakeCanPickupAction(params));
157 }
158
Austin Schuhd8b2a242015-02-22 21:46:53 -0800159 if (data.PosEdge(kPickup)) {
160 actors::PickupParams params;
Austin Schuhe4e59ef2015-03-01 00:05:37 -0800161 // Lift to here initially.
162 params.pickup_angle = 0.9;
163 // Start sucking here
164 params.suck_angle = 0.8;
165 // Go back down to here to finish sucking.
Austin Schuhd8b2a242015-02-22 21:46:53 -0800166 params.suck_angle_finish = 0.4;
Austin Schuhe4e59ef2015-03-01 00:05:37 -0800167 // Pack the box back in here.
168 params.pickup_finish_angle = 0.95;
169 params.intake_time = 0.8;
170 params.intake_voltage = 9.0;
Austin Schuhd8b2a242015-02-22 21:46:53 -0800171 action_queue_.EnqueueAction(actors::MakePickupAction(params));
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800172 }
173 if (data.PosEdge(kElevatorDown)) {
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800174 claw_goal_ = 0.0;
Austin Schuhd8b2a242015-02-22 21:46:53 -0800175
176 actors::FridgeProfileParams fridge_params;
177 fridge_params.arm_max_velocity = kArmDebugVelocity;
178 fridge_params.arm_max_acceleration = kArmDebugAcceleration;
179 fridge_params.elevator_max_velocity = kElevatorDebugVelocity;
180 fridge_params.elevator_max_acceleration = kElevatorDebugAcceleration;
181
182 fridge_params.arm_angle = 0.0;
183 fridge_params.elevator_height = 0.035;
184
185 fridge_params.top_front_grabber = fridge_closed_;
186 fridge_params.top_back_grabber = fridge_closed_;
187 fridge_params.bottom_front_grabber = fridge_closed_;
188 fridge_params.bottom_back_grabber = fridge_closed_;
189 action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params));
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800190 }
191
192 if (data.PosEdge(kClawMiddle)) {
Austin Schuhd8b2a242015-02-22 21:46:53 -0800193 claw_goal_ = 0.8;
194 }
195
Austin Schuh29dabb62015-03-01 00:13:40 -0800196 if (data.PosEdge(kArmHighUp)) {
197 claw_goal_ = 1.6;
198 }
199
Austin Schuhd8b2a242015-02-22 21:46:53 -0800200 if (data.PosEdge(kZero)) {
201 elevator_goal_ = 0.0;
202 arm_goal_ = 0.0;
203 claw_goal_ = 0.0;
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800204 }
Austin Schuh29dabb62015-03-01 00:13:40 -0800205 if (data.PosEdge(kClawUp)) {
206 claw_goal_ = 0.6;
207 }
208 if (data.PosEdge(kClawDown)) {
209 claw_goal_ = 0.0;
210 }
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800211
212 if (data.PosEdge(kClawClosed)) {
213 claw_rollers_closed_ = true;
214 }
215 if (data.PosEdge(kClawOpen)) {
216 claw_rollers_closed_ = false;
217 }
218
219 if (data.PosEdge(kFridgeClosed)) {
220 fridge_closed_ = true;
221 }
222 if (data.PosEdge(kFridgeOpen)) {
223 fridge_closed_ = false;
224 }
225
226 if (data.PosEdge(ControlBit::kEnabled)) {
227 // If we got enabled, wait for everything to zero.
228 LOG(INFO, "Waiting for zero.\n");
229 waiting_for_zero_ = true;
230 }
231
232 if (waiting_for_zero_) {
233 claw_queue.status.FetchLatest();
234 fridge_queue.status.FetchLatest();
235 if (!claw_queue.status.get()) {
236 LOG(ERROR, "Got no claw status packet.\n");
237 // Not safe to continue.
238 return;
239 }
240 if (!fridge_queue.status.get()) {
241 LOG(ERROR, "Got no fridge status packet.\n");
242 return;
243 }
244
245 if (claw_queue.status->zeroed && fridge_queue.status->zeroed) {
246 LOG(INFO, "Zeroed! Starting teleop mode.\n");
247 waiting_for_zero_ = false;
248
249 // Set the initial goals to where we are now.
250 elevator_goal_ = fridge_queue.status->goal_height;
251 arm_goal_ = fridge_queue.status->goal_angle;
252 claw_goal_ = claw_queue.status->angle;
253 } else {
254 return;
255 }
256 } else {
257 if (!action_queue_.Running()) {
258 auto new_fridge_goal = fridge_queue.goal.MakeMessage();
259 new_fridge_goal->height = elevator_goal_;
260 new_fridge_goal->angle = arm_goal_;
261 new_fridge_goal->angular_velocity = 0.0;
262 new_fridge_goal->velocity = 0.0;
263 new_fridge_goal->grabbers.top_front = fridge_closed_;
264 new_fridge_goal->grabbers.top_back = fridge_closed_;
265 new_fridge_goal->grabbers.bottom_front = fridge_closed_;
266 new_fridge_goal->grabbers.bottom_back = fridge_closed_;
267
268 if (!new_fridge_goal.Send()) {
269 LOG(ERROR, "Sending fridge goal failed.\n");
270 } else {
271 LOG(DEBUG, "sending goals: elevator: %f, arm: %f\n", elevator_goal_,
272 arm_goal_);
273 }
274 if (!claw_queue.goal.MakeWithBuilder()
275 .angle(claw_goal_)
276 .rollers_closed(claw_rollers_closed_)
277 .intake(data.IsPressed(kRollersIn) ? 12.0 : 0.0)
278 .Send()) {
279 LOG(ERROR, "Sending claw goal failed.\n");
280 }
281 }
282 }
283
Austin Schuhd8b2a242015-02-22 21:46:53 -0800284 if (action_queue_.Running()) {
285 // If we are running an action, update our goals to the current goals.
286 control_loops::fridge_queue.status.FetchLatest();
287 if (control_loops::fridge_queue.status.get()) {
288 arm_goal_ = control_loops::fridge_queue.status->goal_angle;
289 elevator_goal_ = control_loops::fridge_queue.status->goal_height;
290 } else {
291 LOG(ERROR, "No fridge status!\n");
292 }
293
294 // If we are running an action, update our goals to the current goals.
295 control_loops::claw_queue.status.FetchLatest();
296 if (control_loops::claw_queue.status.get()) {
297 claw_goal_ = control_loops::claw_queue.status->goal_angle;
298 } else {
299 LOG(ERROR, "No fridge status!\n");
300 }
301 }
Brian Silverman20141f92015-01-05 17:39:01 -0800302 action_queue_.Tick();
303 was_running_ = action_queue_.Running();
304 }
305
Daniel Petti61896522015-02-15 18:01:43 -0800306 void HandleTest(const ::aos::input::driver_station::Data &data) {
307 if (action_queue_.Running()) {
308 // We don't really want any actions running.
309 LOG(DEBUG, "Cancelling actions for test mode.\n");
310 action_queue_.CancelAllActions();
311 }
312
313 if (data.GetControlBit(ControlBit::kEnabled)) {
314 if (data.PosEdge(ControlBit::kEnabled)) {
315 // If we got enabled, wait for everything to zero.
316 LOG(INFO, "Waiting for zero.\n");
317 waiting_for_zero_ = true;
318 }
319 if (waiting_for_zero_) {
320 claw_queue.status.FetchLatest();
321 fridge_queue.status.FetchLatest();
322 if (!claw_queue.status.get()) {
323 LOG(ERROR, "Got no claw status packet.\n");
324 // Not safe to continue.
325 return;
326 }
327 if (!fridge_queue.status.get()) {
328 LOG(ERROR, "Got no fridge status packet.\n");
329 return;
330 }
331
332 if (claw_queue.status->zeroed && fridge_queue.status->zeroed) {
333 LOG(INFO, "Zeroed! Starting test mode.\n");
334 waiting_for_zero_ = false;
335
336 // Set the initial goals to where we are now.
337 elevator_goal_ = fridge_queue.status->height;
338 arm_goal_ = fridge_queue.status->angle;
339 claw_goal_ = claw_queue.status->angle;
340 } else {
341 return;
342 }
343 }
344
345 // These buttons move a subsystem up or down for as long as they are
346 // pressed, at low velocity.
347 if (data.IsPressed(kElevatorUp)) {
348 elevator_goal_ += kElevatorVelocity * kJoystickDt;
349 }
350 if (data.IsPressed(kElevatorDown)) {
351 elevator_goal_ -= kElevatorVelocity * kJoystickDt;
352 }
353 if (data.IsPressed(kArmUp)) {
354 arm_goal_ += kArmVelocity * kJoystickDt;
355 }
356 if (data.IsPressed(kArmDown)) {
357 arm_goal_ -= kArmVelocity * kJoystickDt;
358 }
359 if (data.IsPressed(kClawUp)) {
360 claw_goal_ += kClawVelocity * kJoystickDt;
361 }
362 if (data.IsPressed(kClawDown)) {
363 claw_goal_ -= kClawVelocity * kJoystickDt;
364 }
365
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -0800366 if (!action_queue_.Running()) {
367 if (!fridge_queue.goal.MakeWithBuilder()
368 .height(elevator_goal_)
369 .angle(arm_goal_)
370 .Send()) {
371 LOG(ERROR, "Sending fridge goal failed.\n");
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800372 } else {
373 LOG(DEBUG, "sending goals: elevator: %f, arm: %f\n", elevator_goal_,
374 arm_goal_);
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -0800375 }
376 if (!claw_queue.goal.MakeWithBuilder().angle(claw_goal_).Send()) {
377 LOG(ERROR, "Sending claw goal failed.\n");
378 }
Daniel Petti61896522015-02-15 18:01:43 -0800379 }
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800380 /*
Ben Fredrickson9fb2ab12015-02-16 16:42:08 -0800381 if (data.IsPressed(kArmPresetOne) || data.IsPressed(kArmPresetTwo)) {
382 actors::FridgeProfileParams fridge_params;
383 fridge_params.arm_max_velocity = kArmDebugVelocity;
384 fridge_params.arm_max_acceleration = kArmDebugAcceleration;
385 if (data.IsPressed(kArmPresetOne)) {
386 LOG(INFO, "Preset asked for test arm position one position.\n");
387 fridge_params.arm_angle = M_PI / 4.0;
388 fridge_params.top_front_grabber = false;
389 fridge_params.top_back_grabber = false;
390 fridge_params.bottom_front_grabber = false;
391 fridge_params.bottom_back_grabber = false;
392 action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params));
393 } else if (data.IsPressed(kArmPresetTwo)) {
394 LOG(INFO, "Preset asked for test arm position two position.\n");
395 fridge_params.arm_angle = -M_PI / 4.0;
396 fridge_params.top_front_grabber = true;
397 fridge_params.top_back_grabber = true;
398 fridge_params.bottom_front_grabber = true;
399 fridge_params.bottom_back_grabber = true;
400 action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params));
401 }
402 } else if (data.IsPressed(kElevatorPresetOne) ||
403 data.IsPressed(kElevatorPresetOne)) {
404 actors::FridgeProfileParams fridge_params;
405 fridge_params.elevator_max_velocity = kElevatorDebugVelocity;
406 fridge_params.elevator_max_acceleration = kElevatorDebugAcceleration;
407 if (data.IsPressed(kElevatorPresetOne)) {
408 LOG(INFO, "Preset asked for test elevator position one position.\n");
409 fridge_params.elevator_height = 0.5;
410 fridge_params.top_front_grabber = false;
411 fridge_params.top_back_grabber = false;
412 fridge_params.bottom_front_grabber = false;
413 fridge_params.bottom_back_grabber = false;
414 action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params));
415 } else if (data.IsPressed(kElevatorPresetTwo)) {
416 LOG(INFO, "Preset asked for test elevator position two position.\n");
417 fridge_params.elevator_height = 1.2;
418 fridge_params.top_front_grabber = true;
419 fridge_params.top_back_grabber = true;
420 fridge_params.bottom_front_grabber = true;
421 fridge_params.bottom_back_grabber = true;
422 action_queue_.EnqueueAction(MakeFridgeProfileAction(fridge_params));
423 }
Daniel Petti61896522015-02-15 18:01:43 -0800424 }
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800425 */
Daniel Petti61896522015-02-15 18:01:43 -0800426 }
427 }
428
Brian Silverman20141f92015-01-05 17:39:01 -0800429 private:
Austin Schuh6182f8d2015-02-14 22:15:04 -0800430 void StartAuto() {
431 LOG(INFO, "Starting auto mode\n");
432 ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(true).Send();
433 }
434
435 void StopAuto() {
436 LOG(INFO, "Stopping auto mode\n");
437 ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(false).Send();
438 }
439
Brian Silverman20141f92015-01-05 17:39:01 -0800440 bool was_running_;
Daniel Petti61896522015-02-15 18:01:43 -0800441
442 // Previous goals for systems.
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800443 double elevator_goal_ = 0.2;
Daniel Petti61896522015-02-15 18:01:43 -0800444 double arm_goal_ = 0.0;
445 double claw_goal_ = 0.0;
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800446 bool claw_rollers_closed_ = false;
447 bool fridge_closed_ = false;
Daniel Petti61896522015-02-15 18:01:43 -0800448
449 // If we're waiting for the subsystems to zero.
Austin Schuhcde7ffe2015-02-20 22:10:41 -0800450 bool waiting_for_zero_ = true;
Daniel Petti61896522015-02-15 18:01:43 -0800451
Austin Schuh6182f8d2015-02-14 22:15:04 -0800452 bool auto_running_ = false;
453
Austin Schuh331e13d2015-02-15 00:16:51 -0800454 ::aos::common::actions::ActionQueue action_queue_;
Brian Silverman20141f92015-01-05 17:39:01 -0800455
456 ::aos::util::SimpleLogInterval no_drivetrain_status_ =
457 ::aos::util::SimpleLogInterval(::aos::time::Time::InSeconds(0.2), WARNING,
458 "no drivetrain status");
459};
460
461} // namespace joysticks
462} // namespace input
463} // namespace frc971
464
465int main() {
466 ::aos::Init();
467 ::frc971::input::joysticks::Reader reader;
468 reader.Run();
469 ::aos::Cleanup();
470}