Gear comes down if gear and intake down is pressed, and calibrated shots.
Change-Id: I490cefa17ac518c13b1de00b4c0b508f1fcf27ed
diff --git a/y2017/joystick_reader.cc b/y2017/joystick_reader.cc
index 1a225d6..ff9c5f8 100644
--- a/y2017/joystick_reader.cc
+++ b/y2017/joystick_reader.cc
@@ -240,13 +240,17 @@
return;
}
- if (data.IsPressed(kIntakeDown)) {
- intake_goal_ = 0.235;
- }
if (data.IsPressed(kIntakeUp)) {
intake_goal_ = 0.0;
turret_goal_ = 0.0;
}
+ if (data.IsPressed(kIntakeDown)) {
+ intake_goal_ = 0.235;
+ // Don't go quite so far out since we have a gear mech out now.
+ if (data.IsPressed(kIntakeUp)) {
+ intake_goal_ = 0.160;
+ }
+ }
if (data.IsPressed(kVisionAlign)) {
@@ -258,6 +262,9 @@
if (data.PosEdge(kMiddleShot)) {
turret_goal_ = -M_PI;
}
+ if (data.PosEdge(kCloseShot)) {
+ turret_goal_ = -M_PI;
+ }
if (data.PosEdge(kFarShot)) {
turret_goal_ = 0.0;
}
@@ -275,16 +282,16 @@
data.IsPressed(kFire)) {
switch (last_shot_distance_) {
case ShotDistance::CLOSE_SHOT:
- hood_goal_ = 0.285;
- shooter_velocity_ = 335.0;
+ hood_goal_ = 0.30;
+ shooter_velocity_ = 322.0;
break;
case ShotDistance::MIDDLE_SHOT:
- hood_goal_ = 0.63;
- shooter_velocity_ = 384.0;
+ hood_goal_ = 0.43 - 0.00;
+ shooter_velocity_ = 361.0;
break;
case ShotDistance::FAR_SHOT:
- hood_goal_ = 0.63;
- shooter_velocity_ = 378.0;
+ hood_goal_ = 0.43 - 0.01;
+ shooter_velocity_ = 365.0;
break;
}
} else {