Robot Core Documentation
Loading...
Searching...
No Matches
edu.wpi.first.units.Units Class Reference

Static Public Member Functions

static< U extends Unit< U > U Milli (Unit< U > baseUnit, String name, String symbol)
 
static< U extends Unit< U > U Milli (Unit< U > baseUnit)
 

Static Public Attributes

static final Unit AnonymousBaseUnit = new Dimensionless(1, "<?>", "<?>")
 
static final Distance Meters = BaseUnits.Distance
 
static final Distance Meter = Meters
 
static final Distance Millimeters = Milli(Meters, "Millimeter", "mm")
 
static final Distance Millimeter = Millimeters
 
static final Distance Centimeters
 
static final Distance Centimeter = Centimeters
 
static final Distance Inches
 
static final Distance Inch = Inches
 
static final Distance Feet
 
static final Distance Foot = Feet
 
static final Time Seconds = BaseUnits.Time
 
static final Time Second = Seconds
 
static final Time Milliseconds = Milli(Seconds)
 
static final Time Millisecond = Milliseconds
 
static final Time Microseconds = Micro(Seconds)
 
static final Time Microsecond = Microseconds
 
static final Time Minutes
 
static final Time Minute = Minutes
 
static final Angle Radians = BaseUnits.Angle
 
static final Angle Radian = Radians
 
static final Angle Revolutions = new Angle(2 * Math.PI, "Revolution", "R")
 
static final Angle Revolution = Revolutions
 
static final Angle Rotations = new Angle(2 * Math.PI, "Rotation", "R")
 
static final Angle Rotation = Rotations
 
static final Angle Degrees
 
static final Angle Degree = Degrees
 
static final Velocity< DistanceMetersPerSecond = Meters.per(Second)
 
static final Velocity< DistanceFeetPerSecond = Feet.per(Second)
 
static final Velocity< DistanceInchesPerSecond = Inches.per(Second)
 
static final Velocity< AngleRevolutionsPerSecond = Revolutions.per(Second)
 
static final Velocity< AngleRotationsPerSecond = Rotations.per(Second)
 
static final Velocity< AngleRPM = Rotations.per(Minute)
 
static final Velocity< AngleRadiansPerSecond = Radians.per(Second)
 
static final Velocity< AngleDegreesPerSecond = Degrees.per(Second)
 
static final Velocity< Velocity< Distance > > MetersPerSecondPerSecond
 
static final Velocity< Velocity< Distance > > Gs
 
static final Mass Kilograms = BaseUnits.Mass
 
static final Mass Kilogram = Kilograms
 
static final Mass Grams = Milli(Kilograms, "Gram", "g")
 
static final Mass Gram = Grams
 
static final Mass Pounds
 
static final Mass Pound = Pounds
 
static final Mass Ounces
 
static final Mass Ounce = Ounces
 
static final Dimensionless Value = BaseUnits.Value
 
static final Dimensionless Percent
 
static final Voltage Volts = BaseUnits.Voltage
 
static final Voltage Volt = Volts
 
static final Voltage Millivolts = Milli(Volts)
 
static final Voltage Millivolt = Millivolts
 
static final Current Amps = BaseUnits.Current
 
static final Current Amp = Amps
 
static final Current Milliamps = Milli(Amps)
 
static final Current Milliamp = Milliamps
 
static final Energy Joules = BaseUnits.Energy
 
static final Energy Joule = Joules
 
static final Energy Millijoules = Milli(Joules)
 
static final Energy Millijoule = Millijoules
 
static final Energy Kilojoules = Kilo(Joules)
 
static final Energy Kilojoule = Kilojoules
 
static final Power Watts = BaseUnits.Power
 
static final Power Watt = Watts
 
static final Power Milliwatts = Milli(Watts)
 
static final Power Milliwatt = Milliwatts
 
static final Power Horsepower
 
static final Temperature Kelvin = BaseUnits.Temperature
 
static final Temperature Celsius
 
static final Temperature Fahrenheit
 
static final Per< Voltage, Velocity< Distance > > VoltsPerMeterPerSecond
 
static final Per< Voltage, Velocity< Velocity< Distance > > > VoltsPerMeterPerSecondSquared
 
static final Per< Voltage, Velocity< Angle > > VoltsPerRadianPerSecond
 
static final Per< Voltage, Velocity< Velocity< Angle > > > VoltsPerRadianPerSecondSquared
 

Detailed Description

Contains a set of predefined units.

Member Function Documentation

◆ Milli() [1/2]

static< U extends Unit< U > U edu.wpi.first.units.Units.Milli ( Unit< U > baseUnit)
static

Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).

Parameters
<U>the type of the unit
baseUnitthe unit being derived from. This does not have to be the base unit of measure
Returns
the milli-unit

◆ Milli() [2/2]

static< U extends Unit< U > U edu.wpi.first.units.Units.Milli ( Unit< U > baseUnit,
String name,
String symbol )
static

Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds).

Parameters
<U>the type of the unit
baseUnitthe unit being derived from. This does not have to be the base unit of measure
namethe name of the new derived unit
symbolthe symbol of the new derived unit
Returns
the milli-unit

Member Data Documentation

◆ Amp

final Current edu.wpi.first.units.Units.Amp = Amps
static

The base unit of electrical current.

◆ Amps

final Current edu.wpi.first.units.Units.Amps = BaseUnits.Current
static

The base unit of electrical current.

◆ AnonymousBaseUnit

final Unit edu.wpi.first.units.Units.AnonymousBaseUnit = new Dimensionless(1, "<?>", "<?>")
static

Used as an internal placeholder value when a specific unit type cannot be determined. Do not use this directly.

◆ Celsius

final Temperature edu.wpi.first.units.Units.Celsius
static
Initial value:
=
derive(Kelvin).offset(+273.15).named("Celsius").symbol("°C").make()
static final Temperature Kelvin
Definition Units.java:334

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.

◆ Centimeter

final Distance edu.wpi.first.units.Units.Centimeter = Centimeters
static

1/100 of a Meter.

◆ Centimeters

final Distance edu.wpi.first.units.Units.Centimeters
static
Initial value:
=
derive(Meters).splitInto(100).named("Centimeter").symbol("cm").make()

1/100 of a Meter.

◆ Degree

final Angle edu.wpi.first.units.Units.Degree = Degrees
static

1/360 of a turn around a circle, or 1/57.3 Radians.

◆ Degrees

final Angle edu.wpi.first.units.Units.Degrees
static
Initial value:
=
derive(Revolutions).splitInto(360).named("Degree").symbol("°").make()
static final Angle Revolutions
Definition Units.java:101

1/360 of a turn around a circle, or 1/57.3 Radians.

◆ DegreesPerSecond

final Velocity<Angle> edu.wpi.first.units.Units.DegreesPerSecond = Degrees.per(Second)
static

A unit of angular velocity equivalent to spinning at a rate of one Degree per Second.

◆ Fahrenheit

final Temperature edu.wpi.first.units.Units.Fahrenheit
static
Initial value:
=
derive(Celsius)
.mappingInputRange(0, 100)
.toOutputRange(32, 212)
.named("Fahrenheit")
.symbol("°F")
.make()
static final Temperature Celsius
Definition Units.java:341

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.

◆ Feet

final Distance edu.wpi.first.units.Units.Feet
static
Initial value:
=
derive(Inches).aggregate(12).named("Foot").symbol("ft").make()
static final Distance Inches
Definition Units.java:45

304.8/1000 of a Meter, or 12 Inches.

◆ FeetPerSecond

final Velocity<Distance> edu.wpi.first.units.Units.FeetPerSecond = Feet.per(Second)
static

A unit of linear velocity equivalent to travelling at a rate one Foot per Second.

◆ Foot

final Distance edu.wpi.first.units.Units.Foot = Feet
static

304.8/1000 of a Meter, or 12 Inches.

◆ Gram

final Mass edu.wpi.first.units.Units.Gram = Grams
static

1/1000 of a Kilogram.

◆ Grams

final Mass edu.wpi.first.units.Units.Grams = Milli(Kilograms, "Gram", "g")
static

1/1000 of a Kilogram.

◆ Gs

final Velocity<Velocity<Distance> > edu.wpi.first.units.Units.Gs
static
Initial value:
=
derive(MetersPerSecondPerSecond).aggregate(9.80665).named("G").symbol("G").make()
static final Velocity< Velocity< Distance > > MetersPerSecondPerSecond
Definition Units.java:182

A unit of acceleration equivalent to the pull of gravity on an object at sea level on Earth.

◆ Horsepower

final Power edu.wpi.first.units.Units.Horsepower
static
Initial value:
=
derive(Watts).aggregate(745.7).named("Horsepower").symbol("HP").make()
static final Power Watts
Definition Units.java:306

A unit equal to 745.7 Watts. May be useful when dealing with high-power gearboxes and motors.

◆ Inch

final Distance edu.wpi.first.units.Units.Inch = Inches
static

25.4/1000 of a Meter and 1/12 of a Foot.

◆ Inches

final Distance edu.wpi.first.units.Units.Inches
static
Initial value:
=
derive(Millimeters).aggregate(25.4).named("Inch").symbol("in").make()
static final Distance Millimeters
Definition Units.java:32

25.4/1000 of a Meter and 1/12 of a Foot.

◆ InchesPerSecond

final Velocity<Distance> edu.wpi.first.units.Units.InchesPerSecond = Inches.per(Second)
static

A unit of linear velocity equivalent to travelling at a rate of one Inch per Second.

◆ Joule

final Energy edu.wpi.first.units.Units.Joule = Joules
static

The base unit of energy.

◆ Joules

final Energy edu.wpi.first.units.Units.Joules = BaseUnits.Energy
static

The base unit of energy.

◆ Kelvin

final Temperature edu.wpi.first.units.Units.Kelvin = BaseUnits.Temperature
static

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.

◆ Kilogram

final Mass edu.wpi.first.units.Units.Kilogram = Kilograms
static

The base SI unit of mass.

◆ Kilograms

final Mass edu.wpi.first.units.Units.Kilograms = BaseUnits.Mass
static

The base SI unit of mass.

◆ Kilojoule

final Energy edu.wpi.first.units.Units.Kilojoule = Kilojoules
static

A unit equal to 1,000 Joules. Useful when dealing with higher-level robot energy usage.

◆ Kilojoules

final Energy edu.wpi.first.units.Units.Kilojoules = Kilo(Joules)
static

A unit equal to 1,000 Joules. Useful when dealing with higher-level robot energy usage.

◆ Meter

final Distance edu.wpi.first.units.Units.Meter = Meters
static

The base unit of distance.

◆ Meters

final Distance edu.wpi.first.units.Units.Meters = BaseUnits.Distance
static

The base unit of distance.

◆ MetersPerSecond

final Velocity<Distance> edu.wpi.first.units.Units.MetersPerSecond = Meters.per(Second)
static

The standard SI unit of linear velocity, equivalent to travelling at a rate of one Meter per Second.

◆ MetersPerSecondPerSecond

final Velocity<Velocity<Distance> > edu.wpi.first.units.Units.MetersPerSecondPerSecond
static
Initial value:
=
MetersPerSecond.per(Second)
static final Time Second
Definition Units.java:63

The standard SI unit of linear acceleration, equivalent to accelerating at a rate of one Meter per Second every second.

◆ Microsecond

final Time edu.wpi.first.units.Units.Microsecond = Microseconds
static

Alias for Microseconds to make combined unit definitions read more smoothly.

◆ Microseconds

final Time edu.wpi.first.units.Units.Microseconds = Micro(Seconds)
static

1/1,000,000 of a Second.

◆ Milliamp

final Current edu.wpi.first.units.Units.Milliamp = Milliamps
static

A unit equal to 1/1000 of an Amp. Useful when dealing with low-current applications like LED drivers or low-power circuits.

◆ Milliamps

final Current edu.wpi.first.units.Units.Milliamps = Milli(Amps)
static

A unit equal to 1/1000 of an Amp. Useful when dealing with low-current applications like LED drivers or low-power circuits.

◆ Millijoule

final Energy edu.wpi.first.units.Units.Millijoule = Millijoules
static

A unit equal to 1/1000 of a Joule. Useful when dealing with lower-power applications.

◆ Millijoules

final Energy edu.wpi.first.units.Units.Millijoules = Milli(Joules)
static

A unit equal to 1/1000 of a Joule. Useful when dealing with lower-power applications.

◆ Millimeter

final Distance edu.wpi.first.units.Units.Millimeter = Millimeters
static

1/1000 of a Meter.

◆ Millimeters

final Distance edu.wpi.first.units.Units.Millimeters = Milli(Meters, "Millimeter", "mm")
static

1/1000 of a Meter.

◆ Millisecond

final Time edu.wpi.first.units.Units.Millisecond = Milliseconds
static

Alias for Milliseconds to make combined unit definitions read more smoothly.

◆ Milliseconds

final Time edu.wpi.first.units.Units.Milliseconds = Milli(Seconds)
static

1/1000 of a Second.

◆ Millivolt

final Voltage edu.wpi.first.units.Units.Millivolt = Millivolts
static

1/1000 of a Volt. Useful when dealing with low-voltage applications like LED drivers or low-power circuits.

◆ Millivolts

final Voltage edu.wpi.first.units.Units.Millivolts = Milli(Volts)
static

1/1000 of a Volt. Useful when dealing with low-voltage applications like LED drivers or low-power circuits.

◆ Milliwatt

final Power edu.wpi.first.units.Units.Milliwatt = Milliwatts
static

A unit equal to 1/1000 of a Watt. Useful when dealing with lower-power applications.

◆ Milliwatts

final Power edu.wpi.first.units.Units.Milliwatts = Milli(Watts)
static

A unit equal to 1/1000 of a Watt. Useful when dealing with lower-power applications.

◆ Minute

final Time edu.wpi.first.units.Units.Minute = Minutes
static

Alias for Minutes to make combined unit definitions read more smoothly.

◆ Minutes

final Time edu.wpi.first.units.Units.Minutes
static
Initial value:
=
derive(Seconds).aggregate(60).named("Minute").symbol("min").make()

60 Seconds.

◆ Ounce

final Mass edu.wpi.first.units.Units.Ounce = Ounces
static

1/16 of a Pound.

◆ Ounces

final Mass edu.wpi.first.units.Units.Ounces
static
Initial value:
=
derive(Pounds).splitInto(16).named("Ounce").symbol("oz.").make()
static final Mass Pounds
Definition Units.java:209

1/16 of a Pound.

◆ Percent

final Dimensionless edu.wpi.first.units.Units.Percent
static
Initial value:
=
derive(Value).splitInto(100).named("Percent").symbol("%").make()
static final Dimensionless Value
Definition Units.java:228

A dimensionless unit equal to to 1/100th of a Value. A measurement of
Percent.of(42)
would be equivalent to Value.of(0.42).

◆ Pound

final Mass edu.wpi.first.units.Units.Pound = Pounds
static

A unit of mass equivalent to approximately 453 Grams. 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 one G.

◆ Pounds

final Mass edu.wpi.first.units.Units.Pounds
static
Initial value:
=
derive(Grams).aggregate(453.592).named("Pound").symbol("lb.").make()
static final Mass Grams
Definition Units.java:199

A unit of mass equivalent to approximately 453 Grams. 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 one G.

◆ Radian

final Angle edu.wpi.first.units.Units.Radian = Radians
static

The base SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference.

◆ Radians

final Angle edu.wpi.first.units.Units.Radians = BaseUnits.Angle
static

The base SI unit of angle, represented by the distance that the radius of a unit circle can wrap around its circumference.

◆ RadiansPerSecond

final Velocity<Angle> edu.wpi.first.units.Units.RadiansPerSecond = Radians.per(Second)
static

The standard SI unit of angular velocity, equivalent to spinning at a rate of one Radian per Second.

◆ Revolution

final Angle edu.wpi.first.units.Units.Revolution = Revolutions
static

A single turn of an object around an external axis. Numerically equivalent to a Rotation, but may be semantically more expressive in certain scenarios.

◆ Revolutions

final Angle edu.wpi.first.units.Units.Revolutions = new Angle(2 * Math.PI, "Revolution", "R")
static

A single turn of an object around an external axis. Numerically equivalent to Rotations, but may be semantically more expressive in certain scenarios.

◆ RevolutionsPerSecond

final Velocity<Angle> edu.wpi.first.units.Units.RevolutionsPerSecond = Revolutions.per(Second)
static

A unit of angular velocity equivalent to spinning at a rate of one Revolution per Second.

◆ Rotation

final Angle edu.wpi.first.units.Units.Rotation = Rotations
static

A single turn of an object around an internal axis. Numerically equivalent to a Revolution, but may be semantically more expressive in certain scenarios.

◆ Rotations

final Angle edu.wpi.first.units.Units.Rotations = new Angle(2 * Math.PI, "Rotation", "R")
static

A single turn of an object around an internal axis. Numerically equivalent to Revolutions, but may be semantically more expressive in certain scenarios.

◆ RotationsPerSecond

final Velocity<Angle> edu.wpi.first.units.Units.RotationsPerSecond = Rotations.per(Second)
static

A unit of angular velocity equivalent to spinning at a rate of one Rotation per Second.

◆ RPM

final Velocity<Angle> edu.wpi.first.units.Units.RPM = Rotations.per(Minute)
static

A unit of angular velocity equivalent to spinning at a rate of one Rotation per Minute. Motor spec sheets often list maximum speeds in terms of RPM.

◆ Second

final Time edu.wpi.first.units.Units.Second = Seconds
static

Alias for Seconds to make combined unit definitions read more smoothly.

◆ Seconds

final Time edu.wpi.first.units.Units.Seconds = BaseUnits.Time
static

The base unit of time.

◆ Value

final Dimensionless edu.wpi.first.units.Units.Value = BaseUnits.Value
static

A dimensionless unit that performs no scaling whatsoever.

◆ Volt

final Voltage edu.wpi.first.units.Units.Volt = Volts
static

The base unit of electric potential.

◆ Volts

final Voltage edu.wpi.first.units.Units.Volts = BaseUnits.Voltage
static

The base unit of electric potential.

◆ VoltsPerMeterPerSecond

final Per<Voltage, Velocity<Distance> > edu.wpi.first.units.Units.VoltsPerMeterPerSecond
static
Initial value:
=
Volts.per(MetersPerSecond)
static final Voltage Volts
Definition Units.java:239

A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear velocity.

◆ VoltsPerMeterPerSecondSquared

final Per<Voltage, Velocity<Velocity<Distance> > > edu.wpi.first.units.Units.VoltsPerMeterPerSecondSquared
static
Initial value:

A standard unit for measuring linear mechanisms' feedforward voltages based on a model of the system and a desired commanded linear acceleration.

◆ VoltsPerRadianPerSecond

final Per<Voltage, Velocity<Angle> > edu.wpi.first.units.Units.VoltsPerRadianPerSecond
static
Initial value:
=
Volts.per(RadiansPerSecond)

A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular velocity.

◆ VoltsPerRadianPerSecondSquared

final Per<Voltage, Velocity<Velocity<Angle> > > edu.wpi.first.units.Units.VoltsPerRadianPerSecondSquared
static
Initial value:
=
Volts.per(RadiansPerSecond.per(Second))

A standard unit for measuring angular mechanisms' feedforward voltages based on a model of the system and a desired commanded angular acceleration.

◆ Watt

final Power edu.wpi.first.units.Units.Watt = Watts
static

The base unit of power. Equivalent to one Joule per Second.

◆ Watts

final Power edu.wpi.first.units.Units.Watts = BaseUnits.Power
static

The base unit of power. Equivalent to one Joule per Second.


The documentation for this class was generated from the following file: