[wpimath] Replace Speeds with Velocities (#8479)

I left "free speed" alone since that's the technical term for it. In
general, velocity is a vector quantity, and speed is a magnitude (i.e.,
a strictly positive value).

This PR also replaces the speed verbiage in MotorController with duty
cycle.

Fixes #8423.
This commit is contained in:
Tyler Veness
2026-03-06 14:19:15 -08:00
committed by GitHub
parent 1e39f39128
commit 9bd9656871
594 changed files with 8073 additions and 7875 deletions

View File

@@ -13,7 +13,6 @@
#include "wpi/math/system/Models.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/time.hpp"
#define EXPECT_NEAR_UNITS(val1, val2, eps) \
@@ -31,9 +30,9 @@ TEST(ElevatorSimTest, StateSpaceSim) {
for (size_t i = 0; i < 100; ++i) {
controller.SetSetpoint(2.0);
auto nextVoltage = controller.Calculate(encoderSim.GetDistance());
motor.Set(nextVoltage / wpi::RobotController::GetInputVoltage());
motor.SetDutyCycle(nextVoltage / wpi::RobotController::GetInputVoltage());
wpi::math::Vectord<1> u{motor.Get() *
wpi::math::Vectord<1> u{motor.GetDutyCycle() *
wpi::RobotController::GetInputVoltage()};
sim.SetInput(u);
sim.Update(20_ms);