[wpilib] Replace unit .to<double>() with .value() (#8548)

This is consistent with the rest of the library. I left instances alone
which intended a specific typecast.
This commit is contained in:
Tyler Veness
2026-01-12 19:10:10 -08:00
committed by GitHub
parent 00fa8361dd
commit 7e1260b003
4 changed files with 13 additions and 13 deletions

View File

@@ -99,7 +99,7 @@ void ExpansionHubMotor::SetPercentagePower(double power) {
void ExpansionHubMotor::SetVoltage(wpi::units::volt_t voltage) {
m_modePublisher.Set(kVoltageMode);
m_setpointPublisher.Set(voltage.to<double>());
m_setpointPublisher.Set(voltage.value());
}
void ExpansionHubMotor::SetPositionSetpoint(double setpoint) {

View File

@@ -76,7 +76,7 @@ void ExpansionHubServo::SetAngle(wpi::units::degree_t angle) {
}
void ExpansionHubServo::SetPulseWidth(wpi::units::microsecond_t pulseWidth) {
m_pulseWidthPublisher.Set(pulseWidth.to<double>());
m_pulseWidthPublisher.Set(pulseWidth.value());
}
void ExpansionHubServo::SetEnabled(bool enabled) {
@@ -84,7 +84,7 @@ void ExpansionHubServo::SetEnabled(bool enabled) {
}
void ExpansionHubServo::SetFramePeriod(wpi::units::microsecond_t framePeriod) {
m_framePeriodPublisher.Set(framePeriod.to<double>());
m_framePeriodPublisher.Set(framePeriod.value());
}
wpi::units::microsecond_t ExpansionHubServo::GetFullRangeScaleFactor() {