Let neutral mode be set in talonfx
This becomes useful when we need a motor to be on coast mode for testing
or bringup
Signed-off-by: Maxwell Henderson <mxwhenderson@gmail.com>
Change-Id: Iad4fc08cbf5e3eedb110e77437e5c43fe1c2941f
diff --git a/frc971/wpilib/talonfx.cc b/frc971/wpilib/talonfx.cc
index 5e77618..7959f2f 100644
--- a/frc971/wpilib/talonfx.cc
+++ b/frc971/wpilib/talonfx.cc
@@ -8,6 +8,7 @@
double stator_current_limit, double supply_current_limit)
: talon_(device_id, canbus),
device_id_(device_id),
+ neutral_mode_(ctre::phoenix6::signals::NeutralModeValue::Brake),
inverted_(inverted),
device_temp_(talon_.GetDeviceTemp()),
supply_voltage_(talon_.GetSupplyVoltage()),
@@ -63,7 +64,7 @@
current_limits.SupplyCurrentLimitEnable = true;
ctre::phoenix6::configs::MotorOutputConfigs output_configs;
- output_configs.NeutralMode = ctre::phoenix6::signals::NeutralModeValue::Brake;
+ output_configs.NeutralMode = neutral_mode_;
output_configs.DutyCycleNeutralDeadband = 0;
output_configs.Inverted = inverted_;