Added easy way to limit superstructure power.
Change-Id: I323385485fc739c3293b8664831b8fe070f178f3
diff --git a/y2016/wpilib/wpilib_interface.cc b/y2016/wpilib/wpilib_interface.cc
index c7c493a..1898951 100644
--- a/y2016/wpilib/wpilib_interface.cc
+++ b/y2016/wpilib/wpilib_interface.cc
@@ -60,6 +60,9 @@
namespace y2016 {
namespace wpilib {
+namespace {
+constexpr double kMaxBringupPower = 12.0;
+} // namespace
// TODO(Brian): Fix the interpretation of the result of GetRaw here and in the
// DMA stuff and then removing the * 2.0 in *_translate.
@@ -559,9 +562,15 @@
virtual void Write() override {
auto &queue = ::y2016::control_loops::superstructure_queue.output;
LOG_STRUCT(DEBUG, "will output", *queue);
- intake_talon_->Set(queue->voltage_intake / 12.0);
- shoulder_talon_->Set(::aos::Clip(-queue->voltage_shoulder, -6.0, 6.0) / 12.0);
- wrist_talon_->Set(::aos::Clip(queue->voltage_wrist, -6.0, 6.0) / 12.0);
+ intake_talon_->Set(::aos::Clip(queue->voltage_intake, -kMaxBringupPower,
+ kMaxBringupPower) /
+ 12.0);
+ shoulder_talon_->Set(::aos::Clip(-queue->voltage_shoulder,
+ -kMaxBringupPower, kMaxBringupPower) /
+ 12.0);
+ wrist_talon_->Set(
+ ::aos::Clip(queue->voltage_wrist, -kMaxBringupPower, kMaxBringupPower) /
+ 12.0);
top_rollers_talon_->Set(-queue->voltage_top_rollers / 12.0);
bottom_rollers_talon_->Set(-queue->voltage_bottom_rollers / 12.0);
}