mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[cmd3] Make Mechanism an interface (#8303)
Since there is no longer a requirement for Subsystems/Mechanisms to be registered to the command scheduler via a register() call, Mechanism can be changed to an interface instead to allow for more flexible inheritance structures. Specifically, this would allow compatibility with CTRE swerve (which previously required implementing Subsystem so that it could extend CTRE's base class).
This commit is contained in:
@@ -11,7 +11,7 @@ import org.wpilib.hardware.motor.PWMSparkMax;
|
||||
import org.wpilib.hardware.rotation.Encoder;
|
||||
import org.wpilib.util.sendable.SendableRegistry;
|
||||
|
||||
public class DriveSubsystem extends Mechanism {
|
||||
public class DriveSubsystem implements Mechanism {
|
||||
// The motors on the left side of the drive.
|
||||
private final PWMSparkMax leftLeader = new PWMSparkMax(DriveConstants.kLeftMotor1Port);
|
||||
private final PWMSparkMax leftFollower = new PWMSparkMax(DriveConstants.kLeftMotor2Port);
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.wpilib.hardware.pneumatic.DoubleSolenoid;
|
||||
import org.wpilib.hardware.pneumatic.PneumaticsModuleType;
|
||||
|
||||
/** A hatch mechanism actuated by a single {@link org.wpilib.hardware.pneumatic.DoubleSolenoid}. */
|
||||
public class HatchSubsystem extends Mechanism {
|
||||
public class HatchSubsystem implements Mechanism {
|
||||
private final DoubleSolenoid hatchSolenoid =
|
||||
new DoubleSolenoid(
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user