mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Added support for Falcons, and the ability to disable the CANCoders
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user