Retract the intake at auto start
Otherwise depending on how the last auto was run, we may keep it out and
risk hitting it on things.
Change-Id: Ie72538d1a84468ac15faa7d9f11b2666beb26177
diff --git a/y2020/actors/autonomous_actor.cc b/y2020/actors/autonomous_actor.cc
index 022998d..d78f7fc 100644
--- a/y2020/actors/autonomous_actor.cc
+++ b/y2020/actors/autonomous_actor.cc
@@ -147,13 +147,12 @@
spline1.Start();
if (!spline1.WaitForSplineDistanceRemaining(0.02)) return;
- set_intake_goal(-0.89);
- set_roller_voltage(0.0);
- SendSuperstructureGoal();
+ RetractIntake();
}
}
void AutonomousActor::AutoNavBounce() {
+ RetractIntake();
SplineHandle spline1 = PlanSpline(
[this](aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
*builder) {
@@ -203,6 +202,7 @@
}
void AutonomousActor::AutoNavBarrel() {
+ RetractIntake();
SplineHandle spline1 = PlanSpline(
[this](aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
*builder) {
@@ -222,6 +222,7 @@
}
void AutonomousActor::AutoNavSlalom() {
+ RetractIntake();
SplineHandle spline1 = PlanSpline(
[this](aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
*builder) {
@@ -241,6 +242,7 @@
}
void AutonomousActor::SplineAuto() {
+ RetractIntake();
SplineHandle spline1 = PlanSpline(
[this](aos::Sender<frc971::control_loops::drivetrain::SplineGoal>::Builder
*builder) {
@@ -325,5 +327,12 @@
}
}
+
+void AutonomousActor::RetractIntake() {
+ set_intake_goal(-0.89);
+ set_roller_voltage(0.0);
+ SendSuperstructureGoal();
+}
+
} // namespace actors
} // namespace y2020
diff --git a/y2020/actors/autonomous_actor.h b/y2020/actors/autonomous_actor.h
index 00a46fd..b22ab36 100644
--- a/y2020/actors/autonomous_actor.h
+++ b/y2020/actors/autonomous_actor.h
@@ -35,6 +35,7 @@
}
void SendSuperstructureGoal();
+ void RetractIntake();
void SplineAuto();
void SendStartingPosition(double x, double y, double theta);
void SendStartingPosition(const frc971::MultiSpline *const spline);