Fix incorrect high/low gear in joystick
Change-Id: I77710d2935a3e0a1d8a97da9ccbc21fa171ab31d
diff --git a/y2012/joystick_reader.cc b/y2012/joystick_reader.cc
index b1af0bb..b977672 100644
--- a/y2012/joystick_reader.cc
+++ b/y2012/joystick_reader.cc
@@ -27,7 +27,7 @@
namespace joysticks {
const JoystickAxis kSteeringWheel(1, 1), kDriveThrottle(2, 2);
-const ButtonLocation kShiftHigh(2, 1), kShiftLow(2, 3);
+const ButtonLocation kShiftHigh(2, 3), kShiftLow(2, 1);
const ButtonLocation kQuickTurn(1, 5);
const ButtonLocation kCatch(3, 10);
@@ -93,10 +93,10 @@
void HandleDrivetrain(const ::aos::input::driver_station::Data &data) {
const double wheel = -data.GetAxis(kSteeringWheel);
const double throttle = -data.GetAxis(kDriveThrottle);
- if (data.PosEdge(kShiftHigh)) {
+ if (data.PosEdge(kShiftLow)) {
is_high_gear_ = false;
}
- if (data.PosEdge(kShiftLow)) {
+ if (data.PosEdge(kShiftHigh)) {
is_high_gear_ = true;
}
if (!drivetrain_queue.goal.MakeWithBuilder()