@@ -128,8 +128,6 @@ public ModuleIOTalonFX(int module) {
128128 constants .DriveMotorInverted
129129 ? InvertedValue .Clockwise_Positive
130130 : InvertedValue .CounterClockwise_Positive ;
131- tryUntilOk (5 , () -> driveTalon .getConfigurator ().apply (driveConfig , 0.25 ));
132- tryUntilOk (5 , () -> driveTalon .setPosition (0.0 , 0.25 ));
133131
134132 // Configure turn motor
135133 var turnConfig = new TalonFXConfiguration ();
@@ -147,7 +145,6 @@ public ModuleIOTalonFX(int module) {
147145 constants .SteerMotorInverted
148146 ? InvertedValue .Clockwise_Positive
149147 : InvertedValue .CounterClockwise_Positive ;
150- tryUntilOk (5 , () -> turnTalon .getConfigurator ().apply (turnConfig , 0.25 ));
151148
152149 // Configure CANCoder
153150 CANcoderConfiguration cancoderConfig = constants .EncoderInitialConfigs ;
@@ -156,7 +153,6 @@ public ModuleIOTalonFX(int module) {
156153 constants .EncoderInverted
157154 ? SensorDirectionValue .Clockwise_Positive
158155 : SensorDirectionValue .CounterClockwise_Positive ;
159- cancoder .getConfigurator ().apply (cancoderConfig );
160156
161157 // Set motor Closed Loop Output type and CANCoder feedback type based on Phoenix Pro status
162158 switch (Constants .getPhoenixPro ()) {
@@ -170,6 +166,12 @@ public ModuleIOTalonFX(int module) {
170166 constants .SteerMotorClosedLoopOutput = ClosedLoopOutputType .Voltage ;
171167 }
172168
169+ // Finally, apply the configs to the motor controllers
170+ tryUntilOk (5 , () -> driveTalon .getConfigurator ().apply (driveConfig , 0.25 ));
171+ tryUntilOk (5 , () -> driveTalon .setPosition (0.0 , 0.25 ));
172+ tryUntilOk (5 , () -> turnTalon .getConfigurator ().apply (turnConfig , 0.25 ));
173+ cancoder .getConfigurator ().apply (cancoderConfig );
174+
173175 // Create timestamp queue
174176 timestampQueue = PhoenixOdometryThread .getInstance ().makeTimestampQueue ();
175177
0 commit comments