CTRE Cancoders not reporting degrees

This year my team has made the change from tank drive to swerve. We are running SDS Mk4i’s with Neo Vortexs, and CTRE CanCoders. But we are trying to set our encoder offset in our code but our code is set up to be in degrees but when we look in Phoenix Tuner X it only gives me a reading in revolutions and we cant find a way to change it. Is there a away to change it or other solution to make this work

You can use the WPILib units library to convert rotations to degrees.

double inDegrees = Units.rotationsToDegrees(rotations);

Or degrees to rotations

double inRotations = Units.degreesToRotations(degrees);

If we use that do we need to take into acount of the encoder resolution

I’m pretty sure CANcoders as well as most other FRC encoders nowadays use canonical units (rotations) by default, so you shouldn’t have to worry about encoder resolution.

Thank you guys for the help. Got a chance today to go in and get it working. Hope you guys have a great chritmas and great season

1 Like