mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user