Package com.ctre.phoenix
Class Util
java.lang.Object
com.ctre.phoenix.Util
public class Util extends Object
Class with basic utility methods
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
Modifier and Type Method Description static double
cap(double value, double peak)
Caps the valuestatic double
scaleNativeUnitsToRotations(double scalar, long nativePos)
Scales native units to rotationsstatic double
scaleNativeUnitsToRpm(double scalar, long nativeVel)
Scales Native units to velocitystatic int
scaleRotationsToNativeUnits(double scalar, double fullRotations)
Scales rotations to native unitsstatic int
scaleVelocityToNativeUnits(double scalar, double rpm)
Scales velocity to native units
-
Constructor Details
-
Method Details
-
cap
Caps the value- Parameters:
value
- Value to cappeak
- Maximum/-Minimum value can be- Returns:
- Capped value
-
scaleRotationsToNativeUnits
Scales rotations to native units- Parameters:
scalar
- Value to scale byfullRotations
- Number of rotations to scale by- Returns:
- Scaled units
-
scaleVelocityToNativeUnits
Scales velocity to native units- Parameters:
scalar
- Value to scale byrpm
- Velocity in rotations per minute- Returns:
- Scaled velocity
-
scaleNativeUnitsToRotations
Scales native units to rotations- Parameters:
scalar
- Value to scale bynativePos
- Native position units- Returns:
- Scaled units
-
scaleNativeUnitsToRpm
Scales Native units to velocity- Parameters:
scalar
- Value to scale bynativeVel
- Native velocity units- Returns:
- Scaled units
-