Fix incorrect high/low gear in joystick
Change-Id: I77710d2935a3e0a1d8a97da9ccbc21fa171ab31d
diff --git a/y2014_bot3/joystick_reader.cc b/y2014_bot3/joystick_reader.cc
index 3e6e3e2..6dfcbb4 100644
--- a/y2014_bot3/joystick_reader.cc
+++ b/y2014_bot3/joystick_reader.cc
@@ -30,7 +30,7 @@
// Joystick & button addresses.
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 kFrontRollersIn(3, 8);
@@ -75,11 +75,11 @@
LOG(WARNING, "sending stick values failed\n");
}
- if (data.PosEdge(kShiftHigh)) {
+ if (data.PosEdge(kShiftLow)) {
is_high_gear_ = false;
}
- if (data.PosEdge(kShiftLow)) {
+ if (data.PosEdge(kShiftHigh)) {
is_high_gear_ = true;
}
}