mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11: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,37 +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.
|
||||
|
||||
package edu.wpi.first.wpilibj.simulation;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import edu.wpi.first.hal.HAL;
|
||||
import edu.wpi.first.wpilibj.Servo;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class ServoSimTest {
|
||||
@Test
|
||||
void testServo() {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
try (Servo servo = new Servo(0)) {
|
||||
ServoSim sim = new ServoSim(servo);
|
||||
|
||||
servo.set(0);
|
||||
assertEquals(0, sim.getPosition());
|
||||
|
||||
servo.set(0.354);
|
||||
assertEquals(0.354, sim.getPosition());
|
||||
|
||||
servo.setAngle(10);
|
||||
assertEquals(10, sim.getAngle());
|
||||
|
||||
servo.setAngle(90);
|
||||
assertEquals(90, sim.getAngle());
|
||||
|
||||
servo.setAngle(170);
|
||||
assertEquals(170, sim.getAngle());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user