mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Remove Servo Classes (#8270)
SystemCore doesn't directly support Servos. It would be possible to still use a Servo Power Module, but those are fairly rare, and we should probably use a different class for that case, so users don't attempt to hook a servo directly up to systemcore. That will depend on what happens with the rules in 2027. Rev Servo Hubs are a current working replacement for systemcore users.
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "frc/simulation/ServoSim.h" // NOLINT(build/include_order)
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <hal/HAL.h>
|
||||
|
||||
#include "frc/Servo.h"
|
||||
|
||||
namespace frc::sim {
|
||||
TEST(ServoSimTest, TestServo) {
|
||||
frc::Servo servo{0};
|
||||
frc::sim::ServoSim sim{servo};
|
||||
|
||||
servo.Set(0);
|
||||
EXPECT_EQ(0, sim.GetPosition());
|
||||
|
||||
servo.Set(0.354);
|
||||
EXPECT_EQ(0.354, sim.GetPosition());
|
||||
|
||||
servo.SetAngle(10);
|
||||
EXPECT_EQ(10, sim.GetAngle());
|
||||
|
||||
servo.SetAngle(90);
|
||||
EXPECT_EQ(90, sim.GetAngle());
|
||||
|
||||
servo.SetAngle(170);
|
||||
EXPECT_EQ(170, sim.GetAngle());
|
||||
}
|
||||
} // namespace frc::sim
|
||||
Reference in New Issue
Block a user