Fix incorrect high/low gear in joystick
Change-Id: I77710d2935a3e0a1d8a97da9ccbc21fa171ab31d
diff --git a/y2014/joystick_reader.cc b/y2014/joystick_reader.cc
index 137856f..d2d1375 100644
--- a/y2014/joystick_reader.cc
+++ b/y2014/joystick_reader.cc
@@ -35,7 +35,7 @@
const ButtonLocation kDriveControlLoopEnable1(1, 7),
kDriveControlLoopEnable2(1, 11);
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);
@@ -241,10 +241,10 @@
.Send()) {
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;
}
}