Package com.flarerobotics.lib.control
Class RotationalKinematics
java.lang.Object
com.flarerobotics.lib.control.RotationalKinematics
Utility class for basic kinematics related to wheel rotations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.units.measure.Distance
distanceTravelledByWheel
(edu.wpi.first.units.measure.Distance diameter, double reduction, double revs) Returns the distance travelled by wheel, given the reduction and revolutions.static double
motorRevsFromDistanceTravelledByWheel
(edu.wpi.first.units.measure.Distance wheelDiameter, edu.wpi.first.units.measure.Distance travelled, double reduction) Returns the number of motor revolutions, given the reduction and distance travelled.
-
Method Details
-
distanceTravelledByWheel
public static edu.wpi.first.units.measure.Distance distanceTravelledByWheel(edu.wpi.first.units.measure.Distance diameter, double reduction, double revs) Returns the distance travelled by wheel, given the reduction and revolutions.- Parameters:
diameter
- The diameter of the wheel.reduction
- The reduction from the motor to the wheel.revs
- The number of motor revolutions made.- Returns:
- The distance.
-
motorRevsFromDistanceTravelledByWheel
public static double motorRevsFromDistanceTravelledByWheel(edu.wpi.first.units.measure.Distance wheelDiameter, edu.wpi.first.units.measure.Distance travelled, double reduction) Returns the number of motor revolutions, given the reduction and distance travelled.- Parameters:
wheelDiameter
- The diameter of the wheel.travelled
- The distance travelled.reduction
- The reudction from the motor to the wheel.- Returns:
- The motor revolutions.
-