Skip to content

Commit 2b16a0a

Browse files
Fixed rotation PID in swerve drive example.
Signed-off-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
1 parent 6467155 commit 2b16a0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/simple_robot/src/main/java/frc/robot/subsystems/SwerveSubsystem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import static edu.wpi.first.units.Units.Amps;
55
import static edu.wpi.first.units.Units.Inches;
6+
import static edu.wpi.first.units.Units.Radians;
67

78
import com.ctre.phoenix6.hardware.CANcoder;
89
import com.ctre.phoenix6.hardware.Pigeon2;
@@ -49,7 +50,7 @@ public SwerveModule createModule(SparkMax drive, SparkMax azimuth, CANcoder abso
4950
.withTelemetry("driveMotor", SmartMotorControllerConfig.TelemetryVerbosity.HIGH);
5051
SmartMotorControllerConfig azimuthCfg = new SmartMotorControllerConfig(this)
5152
.withClosedLoopController(50, 0, 4)
52-
.withContinuousWrapping()
53+
.withContinuousWrapping(Radians.of(-Math.PI), Radians.of(Math.PI))
5354
.withGearing(azimuthGearing)
5455
.withStatorCurrentLimit(Amps.of(20))
5556
.withTelemetry("angleMotor", SmartMotorControllerConfig.TelemetryVerbosity.HIGH);

0 commit comments

Comments
 (0)