Make lack of a feeder talon non-fatal
9971 doesn't have it installed, and if it was broken, we still want to
be able to run a match.
Change-Id: Ibda349726a342bfd556136e18fa27691e1d02465
diff --git a/y2020/wpilib_interface.cc b/y2020/wpilib_interface.cc
index 1cf54a2..14f6ac9 100644
--- a/y2020/wpilib_interface.cc
+++ b/y2020/wpilib_interface.cc
@@ -364,14 +364,24 @@
void set_feeder_falcon(
::std::unique_ptr<::ctre::phoenix::motorcontrol::can::TalonFX> t) {
feeder_falcon_ = ::std::move(t);
- CHECK_EQ(ctre::phoenix::OKAY,
- feeder_falcon_->ConfigSupplyCurrentLimit(
- {true, Values::kFeederSupplyCurrentLimit(),
- Values::kFeederSupplyCurrentLimit(), 0}));
- CHECK_EQ(ctre::phoenix::OKAY,
- feeder_falcon_->ConfigStatorCurrentLimit(
- {true, Values::kFeederStatorCurrentLimit(),
- Values::kFeederStatorCurrentLimit(), 0}));
+ {
+ auto result = feeder_falcon_->ConfigSupplyCurrentLimit(
+ {true, Values::kFeederSupplyCurrentLimit(),
+ Values::kFeederSupplyCurrentLimit(), 0});
+ if (result != ctre::phoenix::OKAY) {
+ LOG(WARNING) << "Failed to configure feeder supply current limit: "
+ << result;
+ }
+ }
+ {
+ auto result = feeder_falcon_->ConfigStatorCurrentLimit(
+ {true, Values::kFeederStatorCurrentLimit(),
+ Values::kFeederStatorCurrentLimit(), 0});
+ if (result != ctre::phoenix::OKAY) {
+ LOG(WARNING) << "Failed to configure feeder stator current limit: "
+ << result;
+ }
+ }
}
void set_washing_machine_control_panel_victor(