mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Improve command decorator names (#1945)
This commit is contained in:
@@ -50,7 +50,7 @@ public class RobotContainer {
|
||||
// speed)
|
||||
.withTimeout(kAutoTimeoutSeconds)
|
||||
// When the command ends, turn off the shooter and the feeder
|
||||
.whenFinished(() -> {
|
||||
.andThen(() -> {
|
||||
m_shooter.disable();
|
||||
m_shooter.stopFeeder();
|
||||
});
|
||||
|
||||
@@ -52,7 +52,8 @@ public class RobotContainer {
|
||||
// Reset the encoders before starting
|
||||
.beforeStarting(m_robotDrive::resetEncoders)
|
||||
// End the command when the robot's driven distance exceeds the desired value
|
||||
.interruptOn(() -> m_robotDrive.getAverageEncoderDistance() >= kAutoDriveDistanceInches);
|
||||
.withInterrupt(() -> m_robotDrive.getAverageEncoderDistance()
|
||||
>= kAutoDriveDistanceInches);
|
||||
|
||||
// A complex auto routine that drives forward, drops a hatch, and then drives backward.
|
||||
private final Command m_complexAuto = new ComplexAutoCommand(m_robotDrive, m_hatchSubsystem);
|
||||
@@ -78,7 +79,7 @@ public class RobotContainer {
|
||||
new RunCommand(() -> m_robotDrive.arcadeDrive(
|
||||
m_driverController.getY(GenericHID.Hand.kLeft),
|
||||
m_driverController.getX(GenericHID.Hand.kRight)),
|
||||
m_robotDrive)
|
||||
m_robotDrive)
|
||||
);
|
||||
|
||||
// Add commands to the autonomous command chooser
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ComplexAutoCommand extends SequentialCommandGroup {
|
||||
// Reset the encoders before starting
|
||||
.beforeStarting(driveSubsystem::resetEncoders)
|
||||
// End the command when the robot's driven distance exceeds the desired value
|
||||
.interruptOn(
|
||||
.withInterrupt(
|
||||
() -> driveSubsystem.getAverageEncoderDistance() >= kAutoDriveDistanceInches),
|
||||
|
||||
// Release the hatch
|
||||
@@ -53,7 +53,7 @@ public class ComplexAutoCommand extends SequentialCommandGroup {
|
||||
driveSubsystem
|
||||
)
|
||||
.beforeStarting(driveSubsystem::resetEncoders)
|
||||
.interruptOn(
|
||||
.withInterrupt(
|
||||
() -> driveSubsystem.getAverageEncoderDistance() <= -kAutoBackupDistanceInches)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user