mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Remove unit suffixes from variable names (#7529)
* Move units into API docs instead because suffixes make user code verbose and hard to read * Rename trackWidth to trackwidth * Make ultrasonic classes use meters instead of a mix of m, cm, mm, ft, and inches
This commit is contained in:
@@ -88,12 +88,12 @@ class ElevatorSimulationTest {
|
||||
// advance 75 timesteps
|
||||
SimHooks.stepTiming(1.5);
|
||||
|
||||
assertEquals(Constants.kSetpointMeters, m_encoderSim.getDistance(), 0.05);
|
||||
assertEquals(Constants.kSetpoint, m_encoderSim.getDistance(), 0.05);
|
||||
|
||||
// advance 25 timesteps to see setpoint is held.
|
||||
SimHooks.stepTiming(0.5);
|
||||
|
||||
assertEquals(Constants.kSetpointMeters, m_encoderSim.getDistance(), 0.05);
|
||||
assertEquals(Constants.kSetpoint, m_encoderSim.getDistance(), 0.05);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -115,12 +115,12 @@ class ElevatorSimulationTest {
|
||||
// advance 75 timesteps
|
||||
SimHooks.stepTiming(1.5);
|
||||
|
||||
assertEquals(Constants.kSetpointMeters, m_encoderSim.getDistance(), 0.05);
|
||||
assertEquals(Constants.kSetpoint, m_encoderSim.getDistance(), 0.05);
|
||||
|
||||
// advance 25 timesteps to see setpoint is held.
|
||||
SimHooks.stepTiming(0.5);
|
||||
|
||||
assertEquals(Constants.kSetpointMeters, m_encoderSim.getDistance(), 0.05);
|
||||
assertEquals(Constants.kSetpoint, m_encoderSim.getDistance(), 0.05);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ class PotentiometerPIDTest {
|
||||
kCarriageMassKg,
|
||||
kElevatorDrumRadius,
|
||||
0.0,
|
||||
Robot.kFullHeightMeters,
|
||||
Robot.kFullHeight,
|
||||
true,
|
||||
0);
|
||||
m_analogSim = new AnalogInputSim(Robot.kPotChannel);
|
||||
@@ -74,7 +74,7 @@ class PotentiometerPIDTest {
|
||||
*/
|
||||
m_analogSim.setVoltage(
|
||||
RobotController.getVoltage5V()
|
||||
* (m_elevatorSim.getPositionMeters() / Robot.kFullHeightMeters));
|
||||
* (m_elevatorSim.getPosition() / Robot.kFullHeight));
|
||||
});
|
||||
|
||||
m_thread.start();
|
||||
@@ -113,7 +113,7 @@ class PotentiometerPIDTest {
|
||||
// advance 50 timesteps
|
||||
SimHooks.stepTiming(1);
|
||||
|
||||
assertEquals(Robot.kSetpointsMeters[0], m_elevatorSim.getPositionMeters(), 0.1);
|
||||
assertEquals(Robot.kSetpoints[0], m_elevatorSim.getPosition(), 0.1);
|
||||
}
|
||||
|
||||
// second setpoint
|
||||
@@ -125,7 +125,7 @@ class PotentiometerPIDTest {
|
||||
// advance 50 timesteps
|
||||
SimHooks.stepTiming(1);
|
||||
|
||||
assertEquals(Robot.kSetpointsMeters[1], m_elevatorSim.getPositionMeters(), 0.1);
|
||||
assertEquals(Robot.kSetpoints[1], m_elevatorSim.getPosition(), 0.1);
|
||||
}
|
||||
|
||||
// we need to unpress the button
|
||||
@@ -146,7 +146,7 @@ class PotentiometerPIDTest {
|
||||
// advance 50 timesteps
|
||||
SimHooks.stepTiming(1);
|
||||
|
||||
assertEquals(Robot.kSetpointsMeters[2], m_elevatorSim.getPositionMeters(), 0.1);
|
||||
assertEquals(Robot.kSetpoints[2], m_elevatorSim.getPosition(), 0.1);
|
||||
}
|
||||
|
||||
// we need to unpress the button
|
||||
@@ -167,7 +167,7 @@ class PotentiometerPIDTest {
|
||||
// advance 60 timesteps
|
||||
SimHooks.stepTiming(1.2);
|
||||
|
||||
assertEquals(Robot.kSetpointsMeters[0], m_elevatorSim.getPositionMeters(), 0.1);
|
||||
assertEquals(Robot.kSetpoints[0], m_elevatorSim.getPosition(), 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user