Fix drivetrain randomly freezing
Omar noticed that there was a neutral command fighting the control
command. Neither of us know why, so we are no longer doing anything
with neutral... We ran 100 reboots without the diag server and 100 with
and it worked in both cases.
He's going to file an internal ticket to debug it on Monday. This
should get us through the rest of the season.
Change-Id: Ib922501cfe2cd1ce4d6933054920b6a63b2420e8
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2023/wpilib_interface.cc b/y2023/wpilib_interface.cc
index a1a60ba..f88e120 100644
--- a/y2023/wpilib_interface.cc
+++ b/y2023/wpilib_interface.cc
@@ -786,7 +786,9 @@
void Stop() override {
AOS_LOG(WARNING, "Superstructure CAN output too old.\n");
- ctre::phoenixpro::controls::NeutralOut stop_command;
+ ctre::phoenixpro::controls::DutyCycleOut stop_command(0.0);
+ stop_command.UpdateFreqHz = 0_Hz;
+ stop_command.EnableFOC = true;
roller_falcon_->talon()->SetControl(stop_command);
}
@@ -893,7 +895,10 @@
void Stop() override {
AOS_LOG(WARNING, "drivetrain output too old\n");
- ctre::phoenixpro::controls::NeutralOut stop_command;
+ ctre::phoenixpro::controls::DutyCycleOut stop_command(0.0);
+ stop_command.UpdateFreqHz = 0_Hz;
+ stop_command.EnableFOC = true;
+
for (auto falcon :
{right_front_.get(), right_back_.get(), right_under_.get(),
left_front_.get(), left_back_.get(), left_under_.get()}) {