Skip to content

Commit

Permalink
Rename ProfiledServo to ServoEx
Browse files Browse the repository at this point in the history
  • Loading branch information
bubner committed Dec 10, 2024
1 parent 5817da8 commit 7ab3168
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package au.edu.sa.mbhs.studentrobotics.bunyipslib
import au.edu.sa.mbhs.studentrobotics.bunyipslib.hardware.IMUEx
import au.edu.sa.mbhs.studentrobotics.bunyipslib.hardware.InvertibleTouchSensor
import au.edu.sa.mbhs.studentrobotics.bunyipslib.hardware.Motor
import au.edu.sa.mbhs.studentrobotics.bunyipslib.hardware.ProfiledServo
import au.edu.sa.mbhs.studentrobotics.bunyipslib.hardware.ServoEx
import au.edu.sa.mbhs.studentrobotics.bunyipslib.hardware.SimpleRotator
import au.edu.sa.mbhs.studentrobotics.bunyipslib.util.Storage
import com.acmerobotics.roadrunner.ftc.LazyImu
Expand Down Expand Up @@ -123,10 +123,10 @@ abstract class RobotConfig {
val imu = hardwareMap.get(IMU::class.java, name)
return IMUEx(imu) as T
}
// ProfiledServo is the equivalent of Motor in the sense that it is a full extension and can be fetched too
if (ProfiledServo::class.java.isAssignableFrom(device)) {
// ServoEx is the equivalent of Motor in the sense that it is a full extension and can be fetched too
if (ServoEx::class.java.isAssignableFrom(device)) {
val servo = hardwareMap.get(Servo::class.java, name)
return ProfiledServo(servo) as T
return ServoEx(servo) as T
}
// SimpleRotator is a CRServo and DcMotorSimple drop-in replacement
if (SimpleRotator::class.java.isAssignableFrom(device)) {
Expand All @@ -150,7 +150,7 @@ abstract class RobotConfig {
* lifetime of the OpMode. These errors will also be reported to telemetry.
*
* @param name name of device saved in the configuration file
* @param device the class of the item to configure, `Motor.class`, `ProfiledServo.class`, `RawEncoder.class`, etc.
* @param device the class of the item to configure, `Motor.class`, `ServoEx.class`, `RawEncoder.class`, etc.
* @param onSuccess a Runnable to run if the device is successfully configured, useful for setting up motor configs
* without having to check for null explicitly.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author Lucas Bubner, 2024
* @since 5.1.0
*/
public class ProfiledServo extends ServoImpl implements PwmControl {
public class ServoEx extends ServoImpl implements PwmControl {
@Nullable
private TrapezoidProfile.Constraints constraints;
private TrapezoidProfile.State setpoint = new TrapezoidProfile.State();
Expand All @@ -41,11 +41,11 @@ public class ProfiledServo extends ServoImpl implements PwmControl {
private long lastUpdate;

/**
* Wrap a Servo to use with the ProfiledServo class.
* Wrap a Servo to use with the ServoEx class.
*
* @param servo the Servo from hardwareMap to use.
*/
public ProfiledServo(@NonNull Servo servo) {
public ServoEx(@NonNull Servo servo) {
super(servo.getController(), servo.getPortNumber(), servo.getDirection());
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public void disableConstraints() {
* range. If PWM power is enabled for the servo, the servo will attempt to move to
* the indicated position.
* <p>
* <b>Important ProfiledServo Note:</b> Since this class requires continuous update with a motion profile,
* <b>Important ServoEx Note:</b> Since this class requires continuous update with a motion profile,
* it is important that this method is being called periodically if one is being used; this is similar
* to how {@code setPower} has to be called periodically in {@link Motor} to update system controllers.
*
Expand Down

0 comments on commit 7ab3168

Please sign in to comment.