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 CurrentUnit
The base unit of electrical current.static final CurrentUnit
The base unit of electrical current.static final TemperatureUnit
The standard 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 DistanceUnit
1/100 of aMeter
.static final DistanceUnit
1/100 of aMeter
.static final AngleUnit
1/360 of a turn around a circle, or 1/57.3Radians
.static final AngleUnit
1/360 of a turn around a circle, or 1/57.3Radians
.static final AngularVelocityUnit
static final AngularAccelerationUnit
static final TemperatureUnit
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 DistanceUnit
static final LinearVelocityUnit
static final LinearAccelerationUnit
static final DistanceUnit
static final MassUnit
1/1000 of aKilogram
.static final MassUnit
1/1000 of aKilogram
.static final LinearAccelerationUnit
A unit of acceleration equivalent to the pull of gravity on an object at sea level on Earth.static final FrequencyUnit
The standard SI unit of frequency, equivalent to a periodic signal repeating once everySecond
.static final PowerUnit
A unit equal to 745.7Watts
.static final DistanceUnit
static final DistanceUnit
static final LinearVelocityUnit
static final EnergyUnit
The base unit of energy.static final EnergyUnit
The base unit of energy.static final TemperatureUnit
The base unit of temperature, where a value of 0 corresponds with absolutely zero energy in the measured system.static final MassUnit
The standard SI unit of mass.static final LinearMomentumUnit
The standard SI unit for linear momentum, equivalent to a oneKilogram
mass moving at oneMetersPerSecond
.static final AngularMomentumUnit
The standard SI unit for angular momentum.static final MassUnit
The standard SI unit of mass.static final MomentOfInertiaUnit
The standard SI unit for moment of inertia.static final EnergyUnit
A unit equal to 1,000Joules
.static final EnergyUnit
A unit equal to 1,000Joules
.static final ResistanceUnit
A unit equal to 1,000Ohms
.static final ResistanceUnit
A unit equal to 1,000Ohms
.static final DistanceUnit
The base unit of distance.static final DistanceUnit
The base unit of distance.static final LinearVelocityUnit
static final LinearAccelerationUnit
static final TimeUnit
Alias forMicroseconds
to make combined unit definitions read more smoothly.static final TimeUnit
1/1,000,000 of aSecond
.static final CurrentUnit
A unit equal to 1/1000 of anAmp
.static final CurrentUnit
A unit equal to 1/1000 of anAmp
.static final FrequencyUnit
1/1000th of aHertz
.static final EnergyUnit
A unit equal to 1/1000 of aJoule
.static final EnergyUnit
A unit equal to 1/1000 of aJoule
.static final DistanceUnit
1/1000 of aMeter
.static final DistanceUnit
1/1000 of aMeter
.static final ResistanceUnit
A unit equal to 1/1000 of aOhm
.static final ResistanceUnit
A unit equal to 1/1000 of aOhm
.static final TimeUnit
Alias forMilliseconds
to make combined unit definitions read more smoothly.static final TimeUnit
1/1000 of aSecond
.static final VoltageUnit
1/1000 of aVolt
.static final VoltageUnit
1/1000 of aVolt
.static final PowerUnit
A unit equal to 1/1000 of aWatt
.static final PowerUnit
A unit equal to 1/1000 of aWatt
.static final TimeUnit
Alias forMinutes
to make combined unit definitions read more smoothly.static final TimeUnit
60Seconds
.static final ForceUnit
The standard unit of force, equivalent to the standard force of gravity applied to a oneKilogram
mass.static final TorqueUnit
The standard SI unit for torque.static final TorqueUnit
The standard SI unit for torque.static final ForceUnit
The standard unit of force, equivalent to accelerating a mass of oneKilogram
at a rate of onemeter per second per second
.static final ResistanceUnit
The base unit of resistance.static final ResistanceUnit
The base unit of resistance.static final MassUnit
1/16 of aPound
.static final ForceUnit
1/16th ofPoundsForce
, equivalent to the standard force of gravity applied to a oneOunce
mass.static final TorqueUnit
The equivalent of oneounce of force
applied to an object oneInch
away from its center of rotation.static final TorqueUnit
The equivalent of oneounce of force
applied to an object oneInch
away from its center of rotation.static final MassUnit
1/16 of aPound
.static final ForceUnit
1/16th ofPoundsForce
, equivalent to the standard force of gravity applied to a oneOunce
mass.static final DimensionlessUnit
A dimensionless unit equal to to 1/100th of aValue
.static final MassUnit
A unit of mass equivalent to approximately 453Grams
.static final TorqueUnit
The equivalent of onepound of force
applied to an object oneFoot
away from its center of rotation.static final TorqueUnit
The equivalent of onepound of force
applied to an object oneFoot
away from its center of rotation.static final ForceUnit
The standard Imperial unit of force, equivalent to the standard force of gravity applied to a onePound
mass.static final TorqueUnit
The equivalent of onepound of force
applied to an object oneInch
away from its center of rotation.static final TorqueUnit
The equivalent of onepound of force
applied to an object oneInch
away from its center of rotation.static final MassUnit
A unit of mass equivalent to approximately 453Grams
.static final ForceUnit
The standard Imperial unit of force, equivalent to the standard force of gravity applied to a onePound
mass.static final AngleUnit
The standard SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference.static final AngleUnit
The standard SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference.static final AngularVelocityUnit
static final AngularAccelerationUnit
static final AngleUnit
A single turn of an object around an external axis.static final AngleUnit
A single turn of an object around an external axis.static final AngularVelocityUnit
A unit of angular velocity equivalent to spinning at a rate of oneRevolution
perSecond
.static final AngleUnit
A single turn of an object around an internal axis.static final AngleUnit
A single turn of an object around an internal axis.static final AngularVelocityUnit
static final AngularAccelerationUnit
static final AngularVelocityUnit
static final TimeUnit
Alias forSeconds
to make combined unit definitions read more smoothly.static final TimeUnit
The base unit of time.static final DimensionlessUnit
A dimensionless unit that performs no scaling whatsoever.static final VoltageUnit
The base unit of electric potential.static final VoltageUnit
The base unit of electric potential.static final PerUnit<VoltageUnit,
LinearVelocityUnit> A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear velocity.static final PerUnit<VoltageUnit,
LinearAccelerationUnit> A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear acceleration.static final PerUnit<VoltageUnit,
AngularVelocityUnit> A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular velocity.static final PerUnit<VoltageUnit,
AngularAccelerationUnit> A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular acceleration.static final PowerUnit
The base unit of power.static final PowerUnit
The base unit of power. -
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Unit>
UnitBuilder<U>derive
(U unit) Creates a new unit builder object based on a given input unit.static <U extends Unit>
UKilo
(U baseUnit) Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).static <U extends Unit>
UCreates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams).static <U extends Unit>
UMicro
(U baseUnit) Creates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds).static <U extends Unit>
UCreates a unit equal to a millionth of the base unit, egMicroseconds = Micro(Units.Seconds, "Microseconds", 'us")
.static <U extends Unit>
UMilli
(U baseUnit) Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).static <U extends Unit>
UCreates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).
-
Field Details
-
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)
. -
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 standard SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference. -
Radian
The standard 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
-
Hertz
The standard SI unit of frequency, equivalent to a periodic signal repeating once everySecond
. -
Millihertz
1/1000th of aHertz
. -
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 standard SI unit of mass. -
Kilogram
The standard SI unit of mass. -
Grams
1/1000 of aKilogram
. -
Gram
1/1000 of aKilogram
. -
Pounds
A unit of mass equivalent to approximately 453Grams
. This is not equivalent to pounds-force, which is the amount of force required to accelerate an object with one pound of mass at a rate of oneG
.- See Also:
-
Pound
A unit of mass equivalent to approximately 453Grams
. This is not equivalent to pounds-force, which is the amount of force required to accelerate an object with one pound of mass at a rate of oneG
.- See Also:
-
Ounces
1/16 of aPound
. -
Ounce
1/16 of aPound
. -
Newtons
The standard unit of force, equivalent to accelerating a mass of oneKilogram
at a rate of onemeter per second per second
. -
Newton
The standard unit of force, equivalent to the standard force of gravity applied to a oneKilogram
mass. -
PoundsForce
The standard Imperial unit of force, equivalent to the standard force of gravity applied to a onePound
mass. -
PoundForce
The standard Imperial unit of force, equivalent to the standard force of gravity applied to a onePound
mass. -
OuncesForce
1/16th ofPoundsForce
, equivalent to the standard force of gravity applied to a oneOunce
mass. -
OunceForce
1/16th ofPoundsForce
, equivalent to the standard force of gravity applied to a oneOunce
mass. -
NewtonMeters
The standard SI unit for torque. -
NewtonMeter
The standard SI unit for torque. -
PoundFeet
The equivalent of onepound of force
applied to an object oneFoot
away from its center of rotation. -
PoundFoot
The equivalent of onepound of force
applied to an object oneFoot
away from its center of rotation. -
PoundInches
The equivalent of onepound of force
applied to an object oneInch
away from its center of rotation. -
PoundInch
The equivalent of onepound of force
applied to an object oneInch
away from its center of rotation. -
OunceInches
The equivalent of oneounce of force
applied to an object oneInch
away from its center of rotation. -
OunceInch
The equivalent of oneounce of force
applied to an object oneInch
away from its center of rotation. -
KilogramMetersPerSecond
The standard SI unit for linear momentum, equivalent to a oneKilogram
mass moving at oneMetersPerSecond
. -
KilogramMetersSquaredPerSecond
The standard SI unit for angular momentum. -
KilogramSquareMeters
The standard SI unit for moment of inertia. -
Volts
The base unit of electric potential. -
Volt
The base unit of electric potential. -
Millivolts
1/1000 of aVolt
. Useful when dealing with low-voltage applications like LED drivers or low-power circuits. -
Millivolt
1/1000 of aVolt
. Useful when dealing with low-voltage applications like LED drivers or low-power 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 low-current applications like LED drivers or low-power circuits. -
Milliamp
A unit equal to 1/1000 of anAmp
. Useful when dealing with low-current applications like LED drivers or low-power circuits. -
Ohms
-
Ohm
-
KiloOhms
A unit equal to 1,000Ohms
. -
KiloOhm
A unit equal to 1,000Ohms
. -
MilliOhms
A unit equal to 1/1000 of aOhm
. -
MilliOhm
A unit equal to 1/1000 of aOhm
. -
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 lower-power applications. -
Millijoule
A unit equal to 1/1000 of aJoule
. Useful when dealing with lower-power applications. -
Kilojoules
A unit equal to 1,000Joules
. Useful when dealing with higher-level robot energy usage. -
Kilojoule
A unit equal to 1,000Joules
. Useful when dealing with higher-level robot energy usage. -
Watts
-
Watt
-
Milliwatts
A unit equal to 1/1000 of aWatt
. Useful when dealing with lower-power applications. -
Milliwatt
A unit equal to 1/1000 of aWatt
. Useful when dealing with lower-power applications. -
Horsepower
A unit equal to 745.7Watts
. May be useful when dealing with high-power 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 standard 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 milli-unit
-
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 milli-unit
-
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 micro-unit
-
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 micro-unit
-
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 kilo-unit
-
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 kilo-unit
-
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
-