Make spline drivetrain code not move once stopped
This year we don't want to have the robot twitching at the ends of
splines. Ideally this might be configurable, but this exact code is
likely not long for this world.
Change-Id: Ibf2186a8507fe8bf8fbb9710f36fa5f3e1168c01
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/control_loops/drivetrain/splinedrivetrain.cc b/frc971/control_loops/drivetrain/splinedrivetrain.cc
index dbabfb1..f052a9e 100644
--- a/frc971/control_loops/drivetrain/splinedrivetrain.cc
+++ b/frc971/control_loops/drivetrain/splinedrivetrain.cc
@@ -206,6 +206,10 @@
}
output->left_voltage = next_U_(0);
output->right_voltage = next_U_(1);
+ if (IsAtEnd()) {
+ output->left_voltage = 0.0;
+ output->right_voltage = 0.0;
+ }
}
void SplineDrivetrain::PopulateStatus(