[wpiutil] Deprecate wpi::math constants in favor of wpi::numbers (#3383)

The constants were moved from std::math to std::numbers before
ratification in C++20.
This commit is contained in:
Tyler Veness
2021-05-26 00:09:36 -07:00
committed by GitHub
parent 393bf23c0c
commit a238cec12b
73 changed files with 322 additions and 284 deletions

View File

@@ -16,7 +16,7 @@
#include <units/angular_velocity.h>
#include <units/length.h>
#include <units/velocity.h>
#include <wpi/math>
#include <wpi/numbers>
/**
* Represents a differential drive style drivetrain.
@@ -29,9 +29,9 @@ class Drivetrain {
// distance traveled for one rotation of the wheel divided by the encoder
// resolution.
m_leftEncoder.SetDistancePerPulse(
2 * wpi::math::pi * kWheelRadius.to<double>() / kEncoderResolution);
2 * wpi::numbers::pi * kWheelRadius.to<double>() / kEncoderResolution);
m_rightEncoder.SetDistancePerPulse(
2 * wpi::math::pi * kWheelRadius.to<double>() / kEncoderResolution);
2 * wpi::numbers::pi * kWheelRadius.to<double>() / kEncoderResolution);
m_leftEncoder.Reset();
m_rightEncoder.Reset();
@@ -40,7 +40,7 @@ class Drivetrain {
static constexpr units::meters_per_second_t kMaxSpeed =
3.0_mps; // 3 meters per second
static constexpr units::radians_per_second_t kMaxAngularSpeed{
wpi::math::pi}; // 1/2 rotation per second
wpi::numbers::pi}; // 1/2 rotation per second
void SetSpeeds(const frc::DifferentialDriveWheelSpeeds& speeds);
void Drive(units::meters_per_second_t xSpeed,