diff --git a/wpilibc/src/main/native/cpp/DigitalOutput.cpp b/wpilibc/src/main/native/cpp/DigitalOutput.cpp index fc69e359da..9f65faf3fc 100644 --- a/wpilibc/src/main/native/cpp/DigitalOutput.cpp +++ b/wpilibc/src/main/native/cpp/DigitalOutput.cpp @@ -78,7 +78,7 @@ int DigitalOutput::GetChannel() const { void DigitalOutput::Pulse(units::second_t pulseLength) { int32_t status = 0; - HAL_Pulse(m_handle, pulseLength.to(), &status); + HAL_Pulse(m_handle, pulseLength.value(), &status); FRC_CheckErrorStatus(status, "Channel {}", m_channel); } diff --git a/wpilibc/src/main/native/cpp/counter/Tachometer.cpp b/wpilibc/src/main/native/cpp/counter/Tachometer.cpp index 90324f59c9..90688d2c38 100644 --- a/wpilibc/src/main/native/cpp/counter/Tachometer.cpp +++ b/wpilibc/src/main/native/cpp/counter/Tachometer.cpp @@ -44,7 +44,7 @@ Tachometer::~Tachometer() { units::hertz_t Tachometer::GetFrequency() const { auto period = GetPeriod(); - if (period.to() == 0) { + if (period.value() == 0) { return units::hertz_t{0.0}; } return 1 / period; @@ -66,7 +66,7 @@ void Tachometer::SetEdgesPerRevolution(int edges) { units::turns_per_second_t Tachometer::GetRevolutionsPerSecond() const { auto period = GetPeriod(); - if (period.to() == 0) { + if (period.value() == 0) { return units::turns_per_second_t{0.0}; } int edgesPerRevolution = GetEdgesPerRevolution(); @@ -74,7 +74,7 @@ units::turns_per_second_t Tachometer::GetRevolutionsPerSecond() const { return units::turns_per_second_t{0.0}; } auto rotationHz = ((1.0 / edgesPerRevolution) / period); - return units::turns_per_second_t{rotationHz.to()}; + return units::turns_per_second_t{rotationHz.value()}; } units::revolutions_per_minute_t Tachometer::GetRevolutionsPerMinute() const { @@ -103,7 +103,7 @@ void Tachometer::SetSamplesToAverage(int samples) { void Tachometer::SetMaxPeriod(units::second_t maxPeriod) { int32_t status = 0; - HAL_SetCounterMaxPeriod(m_handle, maxPeriod.to(), &status); + HAL_SetCounterMaxPeriod(m_handle, maxPeriod.value(), &status); FRC_CheckErrorStatus(status, "Channel {}", m_source->GetChannel()); } @@ -116,7 +116,7 @@ void Tachometer::SetUpdateWhenEmpty(bool updateWhenEmpty) { void Tachometer::InitSendable(wpi::SendableBuilder& builder) { builder.SetSmartDashboardType("Tachometer"); builder.AddDoubleProperty( - "RPS", [&] { return GetRevolutionsPerSecond().to(); }, nullptr); + "RPS", [&] { return GetRevolutionsPerSecond().value(); }, nullptr); builder.AddDoubleProperty( - "RPM", [&] { return GetRevolutionsPerMinute().to(); }, nullptr); + "RPM", [&] { return GetRevolutionsPerMinute().value(); }, nullptr); } diff --git a/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp b/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp index f2ab4cd59d..ad7173ae9b 100644 --- a/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/TrajectoryGeneratorTest.cpp @@ -52,6 +52,6 @@ TEST(TrajectoryGenerationTest, CurvatureOptimization) { TrajectoryConfig{12_fps, 12_fps_sq}); for (size_t i = 1; i < t.States().size() - 1; ++i) { - EXPECT_NE(0, t.States()[i].curvature.to()); + EXPECT_NE(0, t.States()[i].curvature.value()); } }