Expose drivetrain voltage limit.
The drivetrain control loop was assuming it could always use 12 volts.
That's not always a good idea (there are cases where we want to limit to
like 4 volts so we can tolerate stalling the drivetrain for extended
periods). Make it configurable over the goal queue!
Change-Id: Ia13542d0ce0523dae31f30e10ae44c1872e06d1e
diff --git a/frc971/control_loops/drivetrain/ssdrivetrain.h b/frc971/control_loops/drivetrain/ssdrivetrain.h
index ce12b19..db255d7 100644
--- a/frc971/control_loops/drivetrain/ssdrivetrain.h
+++ b/frc971/control_loops/drivetrain/ssdrivetrain.h
@@ -48,6 +48,9 @@
double last_gyro_to_wheel_offset_ = 0;
+ constexpr static double kMaxVoltage = 12.0;
+ double max_voltage_ = kMaxVoltage;
+
// Reprsents +/- full power on each motor in U-space, aka the square from
// (-12, -12) to (12, 12).
const ::aos::controls::HVPolytope<2, 4, 4> U_poly_;