Package tagalong.units
Enum Class VelocityUnits
- All Implemented Interfaces:
Serializable
,Comparable<VelocityUnits>
,Constable
Velocity units enum identifiers.
Used for configuration and robot setup instead of the WPILib Java units to
avoid reallocations and garbage collections in match.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDegrees per Second aka DegPS aka deg/secondDegrees per Hour aka deg/hourDegrees per Millisecond aka deg/millisecondDegrees per Minute aka deg/minuteDegrees per Second aka DegPS aka deg/secondFeet per Hour aka feet/hourFeet per Millisecond aka feet/millisecondFeet per Minute aka feet/minuteFeet per Second aka FPS aka feet/secondInches per Hour aka inch/hourInches per Millisecond aka feet/millisecondInches per Minute aka inch/minuteInches per Second aka inch/secondMeter per Hour aka meter/hourMeter per Millisecond aka meter/millisecondMeter per Minute aka meter/minuteMeter per Second aka MPS aka meter/secondMeter per Second aka MPS aka meter/secondRadians per Hour aka radians/hourRadians per Millisecond aka radians/millisecondRadians per Minute aka radians/minuteRadians per Second aka radians/secondRadians per Second aka RadPS aka radians/secondRotations per Hour aka rotations/hourRotations per Millisecond aka rotations/MillisecondRotations per Minute aka RPM aka rotations/minuteRotations per Second aka RPS aka rotations/secondRotations per Second aka RPS aka rotations/secondRotations per Second aka RPS aka rotations/second -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DistanceUnits
The distance portion of the velocity unitfinal TimeUnits
The time portion of the velocity unit -
Method Summary
Modifier and TypeMethodDescriptiondouble
convertX
(double x, VelocityUnits targetUnit) Convert from base class' unit to the targetUnit typestatic VelocityUnits
Returns the enum constant of this class with the specified name.static VelocityUnits[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MPS
Meter per Second aka MPS aka meter/second -
ROTPS
Rotations per Second aka RPS aka rotations/second -
RPS
Rotations per Second aka RPS aka rotations/second -
RADPS
Radians per Second aka RadPS aka radians/second -
DEGPS
Degrees per Second aka DegPS aka deg/second -
METERS_PER_MILLISECOND
Meter per Millisecond aka meter/millisecond -
METERS_PER_SECOND
Meter per Second aka MPS aka meter/second -
METERS_PER_MINUTE
Meter per Minute aka meter/minute -
METERS_PER_HOUR
Meter per Hour aka meter/hour -
FEET_PER_MILLISECOND
Feet per Millisecond aka feet/millisecond -
FEET_PER_SECOND
Feet per Second aka FPS aka feet/second -
FEET_PER_MINUTE
Feet per Minute aka feet/minute -
FEET_PER_HOUR
Feet per Hour aka feet/hour -
INCHES_PER_MILLISECOND
Inches per Millisecond aka feet/millisecond -
INCHES_PER_SECOND
Inches per Second aka inch/second -
INCHES_PER_MINUTE
Inches per Minute aka inch/minute -
INCHES_PER_HOUR
Inches per Hour aka inch/hour -
ROTATIONS_PER_MILLISECOND
Rotations per Millisecond aka rotations/Millisecond -
ROTATIONS_PER_SECOND
Rotations per Second aka RPS aka rotations/second -
ROTATIONS_PER_MINUTE
Rotations per Minute aka RPM aka rotations/minute -
ROTATIONS_PER_HOUR
Rotations per Hour aka rotations/hour -
RADIANS_PER_MILLISECOND
Radians per Millisecond aka radians/millisecond -
RADIANS_PER_SECOND
Radians per Second aka radians/second -
RADIANS_PER_MINUTE
Radians per Minute aka radians/minute -
RADIANS_PER_HOUR
Radians per Hour aka radians/hour -
DEGREES_PER_MILLISECOND
Degrees per Millisecond aka deg/millisecond -
DEGREES_PER_SECOND
Degrees per Second aka DegPS aka deg/second -
DEGREES_PER_MINUTE
Degrees per Minute aka deg/minute -
DEGREES_PER_HOUR
Degrees per Hour aka deg/hour
-
-
Field Details
-
distanceUnit
The distance portion of the velocity unit -
timeUnit
The time portion of the velocity unit
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
convertX
Convert from base class' unit to the targetUnit type- Parameters:
x
- double value to be convertedtargetUnit
- target unit- Returns:
- x converted to the target units
-