blob: d3af8a464931e2cc2d0eaead4c06fa88b8518252 [file] [log] [blame]
Brian Silverman17f503e2015-08-02 18:17:18 -07001#include <stdio.h>
2#include <string.h>
3#include <unistd.h>
4#include <math.h>
5
6#include "aos/linux_code/init.h"
Brian Silvermanc2065732015-11-28 22:55:30 +00007#include "aos/input/joystick_input.h"
Brian Silverman17f503e2015-08-02 18:17:18 -07008#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"
12#include "aos/common/actions/actions.h"
13
Comran Morshed5323ecb2015-12-26 20:50:55 +000014#include "frc971/control_loops/drivetrain/drivetrain.q.h"
Brian Silverman17f503e2015-08-02 18:17:18 -070015#include "y2014/constants.h"
16#include "frc971/queues/gyro.q.h"
17#include "frc971/autonomous/auto.q.h"
18#include "y2014/control_loops/claw/claw.q.h"
19#include "y2014/control_loops/shooter/shooter.q.h"
20#include "y2014/actors/shoot_actor.h"
21
Comran Morshed5323ecb2015-12-26 20:50:55 +000022using ::frc971::control_loops::drivetrain_queue;
Brian Silverman17f503e2015-08-02 18:17:18 -070023using ::frc971::sensors::gyro_reading;
24
25using ::aos::input::driver_station::ButtonLocation;
26using ::aos::input::driver_station::JoystickAxis;
27using ::aos::input::driver_station::ControlBit;
28
29#define OLD_DS 0
30
Brian Silvermanb601d892015-12-20 18:24:38 -050031namespace y2014 {
Brian Silverman17f503e2015-08-02 18:17:18 -070032namespace input {
33namespace joysticks {
34
35const ButtonLocation kDriveControlLoopEnable1(1, 7),
36 kDriveControlLoopEnable2(1, 11);
37const JoystickAxis kSteeringWheel(1, 1), kDriveThrottle(2, 2);
Campbell Crowley5b27f022016-02-20 16:55:35 -080038const ButtonLocation kShiftHigh(2, 3), kShiftLow(2, 1);
Brian Silverman17f503e2015-08-02 18:17:18 -070039const ButtonLocation kQuickTurn(1, 5);
40
41const ButtonLocation kCatch(3, 10);
42
43#if OLD_DS
44const ButtonLocation kFire(3, 11);
45const ButtonLocation kUnload(1, 4);
46const ButtonLocation kReload(1, 2);
47
48const ButtonLocation kRollersOut(3, 12);
49const ButtonLocation kRollersIn(3, 7);
50
51const ButtonLocation kTuck(3, 9);
52const ButtonLocation kIntakePosition(3, 8);
53const ButtonLocation kIntakeOpenPosition(3, 10);
54const ButtonLocation kVerticalTuck(3, 1);
55const JoystickAxis kFlipRobot(3, 3);
56
57const ButtonLocation kLongShot(3, 5);
58const ButtonLocation kCloseShot(3, 2);
59const ButtonLocation kFenderShot(3, 3);
60const ButtonLocation kTrussShot(2, 11);
61const ButtonLocation kHumanPlayerShot(3, 2);
62#else
63const ButtonLocation kFire(3, 9);
64const ButtonLocation kUnload(1, 4);
65const ButtonLocation kReload(1, 2);
66
67const ButtonLocation kRollersOut(3, 8);
68const ButtonLocation kRollersIn(3, 3);
69
70const ButtonLocation kTuck(3, 4);
71const ButtonLocation kIntakePosition(3, 5);
72const ButtonLocation kIntakeOpenPosition(3, 11);
73const ButtonLocation kVerticalTuck(2, 6);
74const JoystickAxis kFlipRobot(3, 3);
75
76const ButtonLocation kLongShot(3, 7);
77const ButtonLocation kCloseShot(3, 6);
78const ButtonLocation kFenderShot(3, 2);
79const ButtonLocation kTrussShot(2, 11);
80const ButtonLocation kHumanPlayerShot(3, 1);
81#endif
82
83const ButtonLocation kUserLeft(2, 7);
84const ButtonLocation kUserRight(2, 10);
85
86const JoystickAxis kAdjustClawGoal(3, 2);
87const JoystickAxis kAdjustClawSeparation(3, 1);
88
89struct ClawGoal {
90 double angle;
91 double separation;
92};
93
94struct ShotGoal {
95 ClawGoal claw;
96 double shot_power;
97 double velocity_compensation;
98 double intake_power;
99};
100
101const double kIntakePower = 4.0;
102// In case we have to quickly adjust it.
103const double kGrabSeparation = 0;
104const double kShootSeparation = 0.11 + kGrabSeparation;
105
106const ClawGoal kTuckGoal = {-2.273474, -0.749484};
107const ClawGoal kVerticalTuckGoal = {0, kGrabSeparation};
108const ClawGoal kIntakeGoal = {-2.24, kGrabSeparation};
109const ClawGoal kIntakeOpenGoal = {-2.0, 1.1};
110
111// TODO(austin): Tune these by hand...
112const ClawGoal kFlippedTuckGoal = {2.733474, -0.75};
113const ClawGoal kFlippedIntakeGoal = {2.0, kGrabSeparation};
114const ClawGoal kFlippedIntakeOpenGoal = {0.95, 1.0};
115
116// 34" between near edge of colored line and rear edge of bumper.
117// Only works running?
118const ShotGoal kLongShotGoal = {
119 {-1.08, kShootSeparation}, 145, 0.04, kIntakePower};
120// old 34" {-1.06, kShootSeparation}, 140, 0.04, kIntakePower};
121const ShotGoal kFlippedLongShotGoal = {
122 {0.96, kShootSeparation}, 145, 0.09, kIntakePower};
123// old 34" {0.96, kShootSeparation}, 140, 0.09, kIntakePower};
124
125// 78" between near edge of colored line and rear edge of bumper.
126const ShotGoal kCloseShotGoal = {
127 {-0.95, kShootSeparation}, 105, 0.2, kIntakePower};
128// 3/4" plunger {-0.90, kShootSeparation}, 105, 0.2, kIntakePower};
129const ShotGoal kFlippedMediumShotGoal = {
130 {0.865, kShootSeparation}, 120, 0.2, kIntakePower};
131// 3/4" plunger {0.80, kShootSeparation}, 105, 0.2, kIntakePower};
132
133// Shot from the fender.
134const ShotGoal kFenderShotGoal = {
135 {-0.68, kShootSeparation}, 115.0, 0.0, kIntakePower};
136const ShotGoal kFlippedShortShotGoal = {
137 {0.63, kShootSeparation}, 115.0, 0.0, kIntakePower};
138
139const ShotGoal kHumanShotGoal = {
140 {-0.90, kShootSeparation}, 140, 0.04, kIntakePower};
141const ShotGoal kFlippedHumanShotGoal = {
142 {0.90, kShootSeparation}, 140, 0, kIntakePower};
143const ShotGoal kTrussShotGoal = {
144 {-0.68, kShootSeparation}, 88.0, 0.4, kIntakePower};
145const ShotGoal kFlippedTrussShotGoal = {
146 {0.68, kShootSeparation}, 92.0, 0.4, kIntakePower};
147
148const ShotGoal kFlippedDemoShotGoal = {
149 {1.0, kShootSeparation}, 65.0, 0.0, kIntakePower};
150const ShotGoal kDemoShotGoal = {
151 {-1.0, kShootSeparation}, 50.0, 0.0, kIntakePower};
152
153const ClawGoal k254PassGoal = {-1.95, kGrabSeparation};
154const ClawGoal kFlipped254PassGoal = {1.96, kGrabSeparation};
155
156class Reader : public ::aos::input::JoystickInput {
157 public:
158 Reader()
159 : is_high_gear_(false),
160 shot_power_(80.0),
161 goal_angle_(0.0),
162 separation_angle_(kGrabSeparation),
163 velocity_compensation_(0.0),
164 intake_power_(0.0),
165 was_running_(false) {}
166
167 void RunIteration(const ::aos::input::driver_station::Data &data) override {
168 bool last_auto_running = auto_running_;
169 auto_running_ = data.GetControlBit(ControlBit::kAutonomous) &&
170 data.GetControlBit(ControlBit::kEnabled);
171 if (auto_running_ != last_auto_running) {
172 if (auto_running_) {
173 StartAuto();
174 } else {
175 StopAuto();
176 }
177 }
178
179 if (!data.GetControlBit(ControlBit::kAutonomous)) {
180 HandleDrivetrain(data);
181 HandleTeleop(data);
182 }
183 }
184
185 void HandleDrivetrain(const ::aos::input::driver_station::Data &data) {
186 bool is_control_loop_driving = false;
187 double left_goal = 0.0;
188 double right_goal = 0.0;
189 const double wheel = -data.GetAxis(kSteeringWheel);
190 const double throttle = -data.GetAxis(kDriveThrottle);
191 const double kThrottleGain = 1.0 / 2.5;
192 if (false && (data.IsPressed(kDriveControlLoopEnable1) ||
193 data.IsPressed(kDriveControlLoopEnable2))) {
Brian Silverman17f503e2015-08-02 18:17:18 -0700194 if (data.PosEdge(kDriveControlLoopEnable1) ||
195 data.PosEdge(kDriveControlLoopEnable2)) {
196 if (drivetrain_queue.position.FetchLatest() &&
197 gyro_reading.FetchLatest()) {
Adam Snaider418bd822016-11-26 14:49:23 -0800198 distance_ = (drivetrain_queue.position->left_encoder +
Brian Silverman17f503e2015-08-02 18:17:18 -0700199 drivetrain_queue.position->right_encoder) /
200 2.0 -
201 throttle * kThrottleGain / 2.0;
Adam Snaider418bd822016-11-26 14:49:23 -0800202 angle_ = gyro_reading->angle;
203 filtered_goal_distance_ = distance_;
Brian Silverman17f503e2015-08-02 18:17:18 -0700204 }
205 }
206 is_control_loop_driving = true;
207
208 // const double gyro_angle = Gyro.View().angle;
Adam Snaider418bd822016-11-26 14:49:23 -0800209 const double goal_theta = angle_ - wheel * 0.27;
210 const double goal_distance = distance_ + throttle * kThrottleGain;
Brian Silverman17f503e2015-08-02 18:17:18 -0700211 const double robot_width = 22.0 / 100.0 * 2.54;
212 const double kMaxVelocity = 0.6;
Adam Snaider418bd822016-11-26 14:49:23 -0800213 if (goal_distance > kMaxVelocity * 0.02 + filtered_goal_distance_) {
214 filtered_goal_distance_ += kMaxVelocity * 0.03;
Brian Silverman17f503e2015-08-02 18:17:18 -0700215 } else if (goal_distance <
Adam Snaider418bd822016-11-26 14:49:23 -0800216 -kMaxVelocity * 0.02 + filtered_goal_distance_) {
217 filtered_goal_distance_ -= kMaxVelocity * 0.02;
Brian Silverman17f503e2015-08-02 18:17:18 -0700218 } else {
Adam Snaider418bd822016-11-26 14:49:23 -0800219 filtered_goal_distance_ = goal_distance;
Brian Silverman17f503e2015-08-02 18:17:18 -0700220 }
Adam Snaider418bd822016-11-26 14:49:23 -0800221 left_goal = filtered_goal_distance_ - robot_width * goal_theta / 2.0;
222 right_goal = filtered_goal_distance_ + robot_width * goal_theta / 2.0;
Brian Silverman17f503e2015-08-02 18:17:18 -0700223 is_high_gear_ = false;
224
225 LOG(DEBUG, "Left goal %f Right goal %f\n", left_goal, right_goal);
226 }
227 if (!drivetrain_queue.goal.MakeWithBuilder()
228 .steering(wheel)
229 .throttle(throttle)
230 .highgear(is_high_gear_)
231 .quickturn(data.IsPressed(kQuickTurn))
232 .control_loop_driving(is_control_loop_driving)
233 .left_goal(left_goal)
234 .right_goal(right_goal)
235 .left_velocity_goal(0)
236 .right_velocity_goal(0)
237 .Send()) {
238 LOG(WARNING, "sending stick values failed\n");
239 }
Campbell Crowley5b27f022016-02-20 16:55:35 -0800240 if (data.PosEdge(kShiftLow)) {
Brian Silverman17f503e2015-08-02 18:17:18 -0700241 is_high_gear_ = false;
242 }
Campbell Crowley5b27f022016-02-20 16:55:35 -0800243 if (data.PosEdge(kShiftHigh)) {
Brian Silverman17f503e2015-08-02 18:17:18 -0700244 is_high_gear_ = true;
245 }
246 }
247
248 void SetGoal(ClawGoal goal) {
249 goal_angle_ = goal.angle;
250 separation_angle_ = goal.separation;
251 moving_for_shot_ = false;
252 velocity_compensation_ = 0.0;
253 intake_power_ = 0.0;
254 }
255
256 void SetGoal(ShotGoal goal) {
257 goal_angle_ = goal.claw.angle;
258 shot_separation_angle_ = goal.claw.separation;
259 separation_angle_ = kGrabSeparation;
260 moving_for_shot_ = true;
261 shot_power_ = goal.shot_power;
262 velocity_compensation_ = goal.velocity_compensation;
263 intake_power_ = goal.intake_power;
264 }
265
266 void HandleTeleop(const ::aos::input::driver_station::Data &data) {
267 if (!data.GetControlBit(ControlBit::kEnabled)) {
268 action_queue_.CancelAllActions();
269 LOG(DEBUG, "Canceling\n");
270 }
271 if (data.IsPressed(kRollersIn) || data.IsPressed(kRollersOut)) {
272 intake_power_ = 0.0;
273 separation_angle_ = kGrabSeparation;
274 moving_for_shot_ = false;
275 }
276
277 static const double kAdjustClawGoalDeadband = 0.08;
278 double claw_goal_adjust = data.GetAxis(kAdjustClawGoal);
279 if (OLD_DS || ::std::abs(claw_goal_adjust) < kAdjustClawGoalDeadband) {
280 claw_goal_adjust = 0;
281 } else {
282 claw_goal_adjust = (claw_goal_adjust -
283 ((claw_goal_adjust < 0) ? -kAdjustClawGoalDeadband
284 : kAdjustClawGoalDeadband)) *
285 0.035;
286 }
287 double claw_separation_adjust = data.GetAxis(kAdjustClawSeparation);
288 if (OLD_DS ||
289 ::std::abs(claw_separation_adjust) < kAdjustClawGoalDeadband) {
290 claw_separation_adjust = 0;
291 } else {
292 claw_separation_adjust =
293 (claw_separation_adjust -
294 ((claw_separation_adjust < 0) ? -kAdjustClawGoalDeadband
295 : kAdjustClawGoalDeadband)) *
296 -0.035;
297 }
298
299#if OLD_DS
300 if (data.IsPressed(kFenderShot)) {
301#else
302 if (data.GetAxis(kFlipRobot) > 0.9) {
303#endif
304 claw_goal_adjust += claw_separation_adjust;
305 claw_goal_adjust *= -1;
306
307 if (data.IsPressed(kIntakeOpenPosition)) {
308 action_queue_.CancelAllActions();
309 LOG(DEBUG, "Canceling\n");
310 SetGoal(kFlippedIntakeOpenGoal);
311 } else if (data.IsPressed(kIntakePosition)) {
312 action_queue_.CancelAllActions();
313 LOG(DEBUG, "Canceling\n");
314 SetGoal(kFlippedIntakeGoal);
315 } else if (data.IsPressed(kVerticalTuck)) {
316 action_queue_.CancelAllActions();
317 LOG(DEBUG, "Canceling\n");
318 SetGoal(kVerticalTuckGoal);
319 } else if (data.IsPressed(kTuck)) {
320 action_queue_.CancelAllActions();
321 LOG(DEBUG, "Canceling\n");
322 SetGoal(kFlippedTuckGoal);
323 } else if (data.PosEdge(kLongShot)) {
324 action_queue_.CancelAllActions();
325 LOG(DEBUG, "Canceling\n");
326 SetGoal(kFlippedLongShotGoal);
327 } else if (data.PosEdge(kCloseShot)) {
328 action_queue_.CancelAllActions();
329 LOG(DEBUG, "Canceling\n");
330 SetGoal(kFlippedMediumShotGoal);
331 } else if (data.PosEdge(kFenderShot)) {
332 action_queue_.CancelAllActions();
333 LOG(DEBUG, "Canceling\n");
334 SetGoal(kFlippedShortShotGoal);
335 } else if (data.PosEdge(kHumanPlayerShot)) {
336 action_queue_.CancelAllActions();
337 LOG(DEBUG, "Canceling\n");
338 SetGoal(kFlippedHumanShotGoal);
339 } else if (data.PosEdge(kUserLeft)) {
340 action_queue_.CancelAllActions();
341 LOG(DEBUG, "Canceling\n");
342 SetGoal(kFlipped254PassGoal);
343 } else if (data.PosEdge(kUserRight)) {
344 action_queue_.CancelAllActions();
345 LOG(DEBUG, "Canceling\n");
346 SetGoal(kFlippedDemoShotGoal);
347 } else if (data.PosEdge(kTrussShot)) {
348 action_queue_.CancelAllActions();
349 LOG(DEBUG, "Canceling\n");
350 SetGoal(kFlippedTrussShotGoal);
351 }
352 } else {
353 if (data.IsPressed(kIntakeOpenPosition)) {
354 action_queue_.CancelAllActions();
355 LOG(DEBUG, "Canceling\n");
356 SetGoal(kIntakeOpenGoal);
357 } else if (data.IsPressed(kIntakePosition)) {
358 action_queue_.CancelAllActions();
359 LOG(DEBUG, "Canceling\n");
360 SetGoal(kIntakeGoal);
361 } else if (data.IsPressed(kVerticalTuck)) {
362 action_queue_.CancelAllActions();
363 LOG(DEBUG, "Canceling\n");
364 SetGoal(kVerticalTuckGoal);
365 } else if (data.IsPressed(kTuck)) {
366 action_queue_.CancelAllActions();
367 LOG(DEBUG, "Canceling\n");
368 SetGoal(kTuckGoal);
369 } else if (data.PosEdge(kLongShot)) {
370 action_queue_.CancelAllActions();
371 LOG(DEBUG, "Canceling\n");
372 SetGoal(kLongShotGoal);
373 } else if (data.PosEdge(kCloseShot)) {
374 action_queue_.CancelAllActions();
375 LOG(DEBUG, "Canceling\n");
376 SetGoal(kCloseShotGoal);
377 } else if (data.PosEdge(kFenderShot)) {
378 action_queue_.CancelAllActions();
379 LOG(DEBUG, "Canceling\n");
380 SetGoal(kFenderShotGoal);
381 } else if (data.PosEdge(kHumanPlayerShot)) {
382 action_queue_.CancelAllActions();
383 LOG(DEBUG, "Canceling\n");
384 SetGoal(kHumanShotGoal);
385 } else if (data.PosEdge(kUserLeft)) {
386 action_queue_.CancelAllActions();
387 LOG(DEBUG, "Canceling\n");
388 SetGoal(k254PassGoal);
389 } else if (data.PosEdge(kUserRight)) {
390 action_queue_.CancelAllActions();
391 LOG(DEBUG, "Canceling\n");
392 SetGoal(kDemoShotGoal);
393 } else if (data.PosEdge(kTrussShot)) {
394 action_queue_.CancelAllActions();
395 LOG(DEBUG, "Canceling\n");
396 SetGoal(kTrussShotGoal);
397 }
398 }
399
400 if (data.PosEdge(kFire)) {
401 action_queue_.EnqueueAction(actors::MakeShootAction());
402 } else if (data.NegEdge(kFire)) {
403 action_queue_.CancelCurrentAction();
404 }
405
406 action_queue_.Tick();
407 if (data.IsPressed(kUnload) || data.IsPressed(kReload)) {
408 action_queue_.CancelAllActions();
409 LOG(DEBUG, "Canceling\n");
410 intake_power_ = 0.0;
411 velocity_compensation_ = 0.0;
412 }
413
414 // Send out the claw and shooter goals if no actions are running.
415 if (!action_queue_.Running()) {
416 goal_angle_ += claw_goal_adjust;
417 separation_angle_ += claw_separation_adjust;
418
419 // If the action just ended, turn the intake off and stop velocity
420 // compensating.
421 if (was_running_) {
422 intake_power_ = 0.0;
423 velocity_compensation_ = 0.0;
424 }
425
Comran Morshed5323ecb2015-12-26 20:50:55 +0000426 ::frc971::control_loops::drivetrain_queue.status.FetchLatest();
Brian Silverman17f503e2015-08-02 18:17:18 -0700427 double goal_angle = goal_angle_;
Comran Morshed5323ecb2015-12-26 20:50:55 +0000428 if (::frc971::control_loops::drivetrain_queue.status.get()) {
Brian Silverman17f503e2015-08-02 18:17:18 -0700429 goal_angle += SpeedToAngleOffset(
Comran Morshed5323ecb2015-12-26 20:50:55 +0000430 ::frc971::control_loops::drivetrain_queue.status->robot_speed);
Brian Silverman17f503e2015-08-02 18:17:18 -0700431 } else {
432 LOG_INTERVAL(no_drivetrain_status_);
433 }
434
435 if (moving_for_shot_) {
436 auto &claw_status = control_loops::claw_queue.status;
437 claw_status.FetchLatest();
438 if (claw_status.get()) {
439 if (::std::abs(claw_status->bottom - goal_angle) < 0.2) {
440 moving_for_shot_ = false;
441 separation_angle_ = shot_separation_angle_;
442 }
443 }
444 }
445
446 double separation_angle = separation_angle_;
447
448 if (data.IsPressed(kCatch)) {
449 const double kCatchSeparation = 1.0;
450 goal_angle -= kCatchSeparation / 2.0;
451 separation_angle = kCatchSeparation;
452 }
453
454 bool intaking =
455 data.IsPressed(kRollersIn) || data.IsPressed(kIntakePosition) ||
456 data.IsPressed(kIntakeOpenPosition) || data.IsPressed(kCatch);
457 if (!control_loops::claw_queue.goal.MakeWithBuilder()
458 .bottom_angle(goal_angle)
459 .separation_angle(separation_angle)
460 .intake(intaking ? 12.0
461 : (data.IsPressed(kRollersOut) ? -12.0
462 : intake_power_))
463 .centering(intaking ? 12.0 : 0.0)
464 .Send()) {
465 LOG(WARNING, "sending claw goal failed\n");
466 }
467
468 if (!control_loops::shooter_queue.goal.MakeWithBuilder()
469 .shot_power(shot_power_)
470 .shot_requested(data.IsPressed(kFire))
471 .unload_requested(data.IsPressed(kUnload))
472 .load_requested(data.IsPressed(kReload))
473 .Send()) {
474 LOG(WARNING, "sending shooter goal failed\n");
475 }
476 }
477 was_running_ = action_queue_.Running();
478 }
479
480 double SpeedToAngleOffset(double speed) {
Brian Silvermanb601d892015-12-20 18:24:38 -0500481 const ::y2014::constants::Values &values = ::y2014::constants::GetValues();
Brian Silverman17f503e2015-08-02 18:17:18 -0700482 // scale speed to a [0.0-1.0] on something close to the max
483 // TODO(austin): Change the scale factor for different shots.
484 return (speed / values.drivetrain_max_speed) * velocity_compensation_;
485 }
486
487 private:
488 void StartAuto() {
489 LOG(INFO, "Starting auto mode\n");
490 ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(true).Send();
491 }
492
493 void StopAuto() {
494 LOG(INFO, "Stopping auto mode\n");
495 ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(false).Send();
496 }
497
498 bool is_high_gear_;
499 double shot_power_;
500 double goal_angle_;
501 double separation_angle_, shot_separation_angle_;
502 double velocity_compensation_;
Adam Snaidera3271fe2016-10-26 21:03:38 -0700503 // Distance, angle, and filtered goal for closed loop driving.
Adam Snaider418bd822016-11-26 14:49:23 -0800504 double distance_;
505 double angle_;
506 double filtered_goal_distance_;
Brian Silverman17f503e2015-08-02 18:17:18 -0700507 double intake_power_;
508 bool was_running_;
509 bool moving_for_shot_ = false;
510
511 bool auto_running_ = false;
Brian Silvermanb601d892015-12-20 18:24:38 -0500512
Brian Silverman17f503e2015-08-02 18:17:18 -0700513 ::aos::common::actions::ActionQueue action_queue_;
514
515 ::aos::util::SimpleLogInterval no_drivetrain_status_ =
516 ::aos::util::SimpleLogInterval(::aos::time::Time::InSeconds(0.2), WARNING,
517 "no drivetrain status");
518};
519
520} // namespace joysticks
521} // namespace input
Brian Silvermanb601d892015-12-20 18:24:38 -0500522} // namespace y2014
Brian Silverman17f503e2015-08-02 18:17:18 -0700523
524int main() {
Brian Silverman5090c432016-01-02 14:44:26 -0800525 ::aos::Init(-1);
Brian Silvermanb601d892015-12-20 18:24:38 -0500526 ::y2014::input::joysticks::Reader reader;
Brian Silverman17f503e2015-08-02 18:17:18 -0700527 reader.Run();
528 ::aos::Cleanup();
529}