Added support for Falcons, and the ability to disable the CANCoders

This commit is contained in:
thenetworkgrinch
2023-02-16 21:21:26 -06:00
parent e8f6ca3659
commit c747645bcc
118 changed files with 2706 additions and 370 deletions

View File

@@ -46,6 +46,18 @@ public class SwerveMath
return (Math.PI * wheelDiameter) / (driveGearRatio * pulsePerRotation);
}
/**
* Normalize an angle to be within 0 to 360.
*
* @param angle Angle in degrees.
* @return Normalized angle in degrees.
*/
public static double normalizeAngle(double angle)
{
Rotation2d angleRotation = Rotation2d.fromDegrees(angle);
return new Rotation2d(angleRotation.getCos(), angleRotation.getSin()).getDegrees();
}
/**
* Algebraically apply a deadband using a piece wise function.
*