Package edu.wpi.first.units
Class Units
java.lang.Object
edu.wpi.first.units.Units
Contains a set of predefined units.

Field Summary
Modifier and TypeFieldDescriptionstatic final Current
The base unit of electrical current.static final Current
The base unit of electrical current.static final Temperature
The base SI unit of temperature, where a value of 0 roughly corresponds to the freezing point of water and a value of 100 corresponds to the boiling point.static final Distance
1/100 of aMeter
.static final Distance
1/100 of aMeter
.static final Angle
1/360 of a turn around a circle, or 1/57.3Radians
.static final Angle
1/360 of a turn around a circle, or 1/57.3Radians
.static final Temperature
The base imperial (American) unit of temperature, where a value of 32 roughly corresponds to the freezing point of water and a value of 212 corresponds to the boiling point.static final Distance
static final Distance
static final Mass
1/1000 of aKilogram
.static final Mass
1/1000 of aKilogram
.A unit of acceleration equivalent to the pull of gravity on an object at sea level on Earth.static final Power
A unit equal to 745.7Watts
.static final Distance
static final Distance
static final Energy
The base unit of energy.static final Energy
The base unit of energy.static final Temperature
The base unit of temperature, where a value of 0 corresponds with absolutely zero energy in the measured system.static final Mass
The base SI unit of mass.static final Mass
The base SI unit of mass.The base SI unit for moment of inertia.static final Energy
A unit equal to 1,000Joules
.static final Energy
A unit equal to 1,000Joules
.static final Distance
The base unit of distance.static final Distance
The base unit of distance.static final Time
Alias forMicroseconds
to make combined unit definitions read more smoothly.static final Time
1/1,000,000 of aSecond
.static final Current
A unit equal to 1/1000 of anAmp
.static final Current
A unit equal to 1/1000 of anAmp
.static final Energy
A unit equal to 1/1000 of aJoule
.static final Energy
A unit equal to 1/1000 of aJoule
.static final Distance
1/1000 of aMeter
.static final Distance
1/1000 of aMeter
.static final Time
Alias forMilliseconds
to make combined unit definitions read more smoothly.static final Time
1/1000 of aSecond
.static final Voltage
1/1000 of aVolt
.static final Voltage
1/1000 of aVolt
.static final Power
A unit equal to 1/1000 of aWatt
.static final Power
A unit equal to 1/1000 of aWatt
.static final Time
Alias forMinutes
to make combined unit definitions read more smoothly.static final Time
60Seconds
.static final Mass
1/16 of aPound
.static final Mass
1/16 of aPound
.static final Dimensionless
A dimensionless unit equal to to 1/100th of aValue
.static final Mass
A unit of mass equivalent to approximately 453Grams
.static final Mass
A unit of mass equivalent to approximately 453Grams
.static final Angle
The base SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference.static final Angle
The base SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference.static final Angle
A single turn of an object around an external axis.static final Angle
A single turn of an object around an external axis.A unit of angular velocity equivalent to spinning at a rate of oneRevolution
perSecond
.static final Angle
A single turn of an object around an internal axis.static final Angle
A single turn of an object around an internal axis.static final Time
Alias forSeconds
to make combined unit definitions read more smoothly.static final Time
The base unit of time.static final Dimensionless
A dimensionless unit that performs no scaling whatsoever.static final Voltage
The base unit of electric potential.static final Voltage
The base unit of electric potential.A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear velocity.A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear acceleration.A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular velocity.A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular acceleration.static final Power
The base unit of power.static final Power
The base unit of power. 
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Unit<U>>
UnitBuilder<U>Creates a new unit builder object based on a given input unit.static <U extends Unit<U>>
UCreates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).static <U extends Unit<U>>
UCreates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).static <U extends Unit<U>>
UCreates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds).static <U extends Unit<U>>
UCreates a unit equal to a millionth of the base unit, egMicroseconds = Micro(Units.Seconds, "Microseconds", 'us")
.static <U extends Unit<U>>
UCreates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).static <U extends Unit<U>>
UCreates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).

Field Details

Meters
The base unit of distance. 
Meter
The base unit of distance. 
Millimeters
1/1000 of aMeter
. 
Millimeter
1/1000 of aMeter
. 
Centimeters
1/100 of aMeter
. 
Centimeter
1/100 of aMeter
. 
Inches

Inch

Feet

Foot

Seconds
The base unit of time. 
Second
Alias forSeconds
to make combined unit definitions read more smoothly. 
Milliseconds
1/1000 of aSecond
. 
Millisecond
Alias forMilliseconds
to make combined unit definitions read more smoothly. 
Microseconds
1/1,000,000 of aSecond
. 
Microsecond
Alias forMicroseconds
to make combined unit definitions read more smoothly. 
Minutes
60Seconds
. 
Minute
Alias forMinutes
to make combined unit definitions read more smoothly. 
Radians
The base SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference. 
Radian
The base SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference. 
Revolutions
A single turn of an object around an external axis. Numerically equivalent toRotations
, but may be semantically more expressive in certain scenarios. 
Revolution
A single turn of an object around an external axis. Numerically equivalent to aRotation
, but may be semantically more expressive in certain scenarios. 
Rotations
A single turn of an object around an internal axis. Numerically equivalent toRevolutions
, but may be semantically more expressive in certain scenarios. 
Rotation
A single turn of an object around an internal axis. Numerically equivalent to aRevolution
, but may be semantically more expressive in certain scenarios. 
Degrees
1/360 of a turn around a circle, or 1/57.3Radians
. 
Degree
1/360 of a turn around a circle, or 1/57.3Radians
. 
MetersPerSecond

FeetPerSecond

InchesPerSecond

RevolutionsPerSecond
A unit of angular velocity equivalent to spinning at a rate of oneRevolution
perSecond
. 
RotationsPerSecond

RPM

RadiansPerSecond

DegreesPerSecond

MetersPerSecondPerSecond

FeetPerSecondPerSecond

RotationsPerSecondPerSecond

RadiansPerSecondPerSecond

DegreesPerSecondPerSecond

Gs
A unit of acceleration equivalent to the pull of gravity on an object at sea level on Earth. 
Kilograms
The base SI unit of mass. 
Kilogram
The base SI unit of mass. 
Grams
1/1000 of aKilogram
. 
Gram
1/1000 of aKilogram
. 
Pounds

Pound

Ounces
1/16 of aPound
. 
Ounce
1/16 of aPound
. 
KilogramSquareMeters
The base SI unit for moment of inertia. 
Value
A dimensionless unit that performs no scaling whatsoever. 
Percent
A dimensionless unit equal to to 1/100th of aValue
. A measurement ofPercent.of(42)
would be equivalent toValue.of(0.42)
. 
Volts
The base unit of electric potential. 
Volt
The base unit of electric potential. 
Millivolts
1/1000 of aVolt
. Useful when dealing with lowvoltage applications like LED drivers or lowpower circuits. 
Millivolt
1/1000 of aVolt
. Useful when dealing with lowvoltage applications like LED drivers or lowpower circuits. 
Amps
The base unit of electrical current. 
Amp
The base unit of electrical current. 
Milliamps
A unit equal to 1/1000 of anAmp
. Useful when dealing with lowcurrent applications like LED drivers or lowpower circuits. 
Milliamp
A unit equal to 1/1000 of anAmp
. Useful when dealing with lowcurrent applications like LED drivers or lowpower circuits. 
Joules
The base unit of energy. 
Joule
The base unit of energy. 
Millijoules
A unit equal to 1/1000 of aJoule
. Useful when dealing with lowerpower applications. 
Millijoule
A unit equal to 1/1000 of aJoule
. Useful when dealing with lowerpower applications. 
Kilojoules
A unit equal to 1,000Joules
. Useful when dealing with higherlevel robot energy usage. 
Kilojoule
A unit equal to 1,000Joules
. Useful when dealing with higherlevel robot energy usage. 
Watts

Watt

Milliwatts
A unit equal to 1/1000 of aWatt
. Useful when dealing with lowerpower applications. 
Milliwatt
A unit equal to 1/1000 of aWatt
. Useful when dealing with lowerpower applications. 
Horsepower
A unit equal to 745.7Watts
. May be useful when dealing with highpower gearboxes and motors. 
Kelvin
The base unit of temperature, where a value of 0 corresponds with absolutely zero energy in the measured system. Not particularly useful for robots unless you're cooling motors with liquid helium. 
Celsius
The base SI unit of temperature, where a value of 0 roughly corresponds to the freezing point of water and a value of 100 corresponds to the boiling point. Electronics tend to exhibit degraded performance or damage above 90 degrees Celsius. 
Fahrenheit
The base imperial (American) unit of temperature, where a value of 32 roughly corresponds to the freezing point of water and a value of 212 corresponds to the boiling point. 
VoltsPerMeterPerSecond
A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear velocity. 
VoltsPerMeterPerSecondSquared
A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear acceleration. 
VoltsPerRadianPerSecond
A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular velocity. 
VoltsPerRadianPerSecondSquared
A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular acceleration.


Method Details

Milli
Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds). Type Parameters:
U
 the type of the unit Parameters:
baseUnit
 the unit being derived from. This does not have to be the base unit of measurename
 the name of the new derived unitsymbol
 the symbol of the new derived unit Returns:
 the milliunit

Milli
Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds). Type Parameters:
U
 the type of the unit Parameters:
baseUnit
 the unit being derived from. This does not have to be the base unit of measure Returns:
 the milliunit

Micro
Creates a unit equal to a millionth of the base unit, egMicroseconds = Micro(Units.Seconds, "Microseconds", 'us")
. Type Parameters:
U
 the type of the unit Parameters:
baseUnit
 the unit being derived from. This does not have to be the base unit of measurename
 the name of the new derived unitsymbol
 the symbol of the new derived unit Returns:
 the microunit

Micro
Creates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds). Type Parameters:
U
 the type of the unit Parameters:
baseUnit
 the unit being derived from. This does not have to be the base unit of measure Returns:
 the microunit

Kilo
Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams). Type Parameters:
U
 the type of the unit Parameters:
baseUnit
 the unit being derived from. This does not have to be the base unit of measurename
 the name of the new derived unitsymbol
 the symbol of the new derived unit Returns:
 the kilounit

Kilo
Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams). Type Parameters:
U
 the type of the unit Parameters:
baseUnit
 the unit being derived from. This does not have to be the base unit of measure Returns:
 the kilounit

derive
Creates a new unit builder object based on a given input unit. The builder can be used to fluently describe a new unit in terms of its relation to the base unit. Type Parameters:
U
 the dimension of the unit to derive Parameters:
unit
 the base unit from which to derive a new unit Returns:
 a builder object
