Set retention roller current limits
This also lets us set the current limits of the retention roller
dynamically as if we have the note we want to slow down and apply ~2.0
amps while if we don't think we have it we want to be doing ~5.0 amps.
Signed-off-by: Maxwell Henderson <mxwhenderson@gmail.com>
Change-Id: I682d86fcfb20673e8d04ad57f70556784907e0d7
diff --git a/y2024/wpilib_interface.cc b/y2024/wpilib_interface.cc
index 2cd4672..2686651 100644
--- a/y2024/wpilib_interface.cc
+++ b/y2024/wpilib_interface.cc
@@ -659,6 +659,11 @@
output.turret_voltage());
talonfx_map.find("retention_roller")
->second->WriteVoltage(output.retention_roller_voltage());
+ if (output.has_retention_roller_stator_current_limit()) {
+ talonfx_map.find("retention_roller")
+ ->second->set_stator_current_limit(
+ output.retention_roller_stator_current_limit());
+ }
});
can_drivetrain_writer.set_talonfxs({right_front, right_back},