mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpimath] Deduplicate angle modulus functions (#2998)
frc::NormalizeAngle(), units::math::NormalizeAngle(), and frc::GetModulusError() were replaced with frc::InputModulus() and frc::AngleModulus(). They were placed in wpimath/src/main/native/include/frc/MathUtil.h for C++ and wpimath/src/main/java/edu/wpi/first/wpiutil/math/MathUtil.java for Java.
This commit is contained in:
@@ -2976,17 +2976,6 @@ TEST_F(UnitMath, abs) {
|
||||
EXPECT_EQ(meter_t(10.0), abs(meter_t(10.0)));
|
||||
}
|
||||
|
||||
TEST_F(UnitMath, normalize) {
|
||||
EXPECT_EQ(NormalizeAngle(radian_t(5 * wpi::math::pi)),
|
||||
radian_t(wpi::math::pi));
|
||||
EXPECT_EQ(NormalizeAngle(radian_t(-5 * wpi::math::pi)),
|
||||
radian_t(wpi::math::pi));
|
||||
EXPECT_EQ(NormalizeAngle(radian_t(wpi::math::pi / 2)),
|
||||
radian_t(wpi::math::pi / 2));
|
||||
EXPECT_EQ(NormalizeAngle(radian_t(-wpi::math::pi / 2)),
|
||||
radian_t(-wpi::math::pi / 2));
|
||||
}
|
||||
|
||||
// Constexpr
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1800
|
||||
TEST_F(Constexpr, construction) {
|
||||
|
||||
Reference in New Issue
Block a user