本文整理汇总了Java中edu.wpi.first.wpilibj.command.WaitCommand类的典型用法代码示例。如果您正苦于以下问题:Java WaitCommand类的具体用法?Java WaitCommand怎么用?Java WaitCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WaitCommand类属于edu.wpi.first.wpilibj.command包,在下文中一共展示了WaitCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CenterGearAutonomous
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public CenterGearAutonomous() {
double centerGearAutoSpeed = Preferences.getInstance().getDouble(RobotMap.centerGearAutoSpeed, 0.0);
double centerGearAutoDistance = Preferences.getInstance().getDouble(RobotMap.centerGearAutoDistance, 0.0);
double autoWaitTime = Preferences.getInstance().getDouble(RobotMap.autoWaitTime, 0.0);
double wiggleForward = Preferences.getInstance().getDouble(RobotMap.wiggleForward, 0.0);
addSequential(new DriveStraightAuto(centerGearAutoDistance, centerGearAutoSpeed));
addSequential(new TurnAngle(3));
addSequential(new TurnAngle(-6));
addSequential(new TurnAngle(3));
addSequential(new DriveStraightAuto(wiggleForward, centerGearAutoSpeed));
addSequential(new WaitCommand(autoWaitTime));
addParallel(new DownManipulator());
addParallel(new ReverseManipulatorMotors());
// addSequential(new WaitCommand(autoWaitTime));
addSequential(new DriveStraightAuto(centerGearAutoDistance / 2, -centerGearAutoSpeed));
addSequential(new WaitCommand(autoWaitTime / 2));
addSequential(new DriveStraightAuto(centerGearAutoDistance / 3, centerGearAutoSpeed));
addSequential(new ManipulatorMotorOff());
addSequential(new UpManipulator());
}
示例2: VisionAlignment
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public VisionAlignment() {
table = NetworkTable.getTable("Vision");
double dist = table.getNumber("est_distance", 0);
double incr = 0.5;
int reps = (int) (dist / incr);
for(int i = 0; i<reps; i++) {
addSequential(new VisionGyroAlign(), 1.5);
addSequential(new WaitCommand(0.7));
addSequential(new DriveForwardDistance(-.2,-.2, -incr/1.5, -incr/1.5, true));
addSequential(new WaitCommand(0.5));
}
}
示例3: PaperWeightAuto
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public PaperWeightAuto() {
// Add Commands here:
// e.g. addSequential(new Command1());
// addSequential(new Command2());
// these will run in order.
// To run multiple commands at the same time,
// use addParallel()
// e.g. addParallel(new Command1());
// addSequential(new Command2());
// Command1 and Command2 will run in parallel.
// A command group will require all of the subsystems that each member
// would require.
// e.g. if Command1 requires chassis, and Command2 requires arm,
// a CommandGroup containing them would require both the chassis and the
// arm.
addSequential(new WaitCommand(15));
}
示例4: FreeFire
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public FreeFire(boolean menzieShot) {
//addSequential(new WaitForLock());
//addSequential(new AutonomousTrack());
if (menzieShot) {
addSequential(new MenzieAlign(false));
} else {
addSequential(new HorizontalAlign(false));
}
addSequential(new MoveShootingWheel(Robot.shootingWheel.CONSTANT_SPEED));
addSequential(new VerticalAlign(false));
addSequential(new WaitCommand(0.25));
addSequential(new FireShooter());
addSequential(new MoveShootingWheel(0));
}
示例5: ChevalDeFriseCommand
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public ChevalDeFriseCommand() { //boolean shoot
// addParallel(new DriveStraightCommand(60,.5));
// addSequential(new GetRotation());
// addSequential(new Pitch(60, .7, 5));
addSequential(new DriveStraightCommandAndStop(60, .7 , 20));
addSequential(new WaitCommand(.5));
addSequential(new DefenseBusterSetpointCommand(Robot.defenseBuster.MAX_VALUE));
addSequential(new WaitCommand(.45));
addSequential(new DriveStraightCommand(30,.8));
addSequential(new DefenseBusterSetpointCommand(Robot.defenseBuster.MIN_VALUE));
addSequential(new DriveStraightCommand(75,.8));
// Do vision if shooting.
//finishAuto(shoot);
//addSequential(new DriveStraightCommand(30,.9));
requires(Robot.chassis);
requires(Robot.defenseBuster);
//this.shoot = shoot;
}
示例6: SingleTote
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public SingleTote() {
addSequential(new DoubleAutoCollect());
addParallel(new DoubleAutoRaiseToteToFirstLevel());
addSequential(new DoubleAutoTurnToAutoZone());
addSequential(new WaitCommand(0.5));
addSequential(new DoubleAutoDriveToAutoZone());
// Add Commands here:
// e.g. addSequential(new Command1());
// addSequential(new Command2());
// these will run in order.
// To run multiple commands at the same time,
// use addParallel()
// e.g. addParallel(new Command1());
// addSequential(new Command2());
// Command1 and Command2 will run in parallel.
// A command group will require all of the subsystems that each member
// would require.
// e.g. if Command1 requires chassis, and Command2 requires arm,
// a CommandGroup containing them would require both the chassis and the
// arm.
}
示例7: SimpleAutonomous
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public SimpleAutonomous() {
// Add Commands here:
// e.g. addSequential(new Command1());
// addSequential(new Command2());
// these will run in order.
// To run multiple commands at the same time,
// use addParallel()
// e.g. addParallel(new Command1());
// addSequential(new Command2());
// Command1 and Command2 will run in parallel.
// A command group will require all of the subsystems that each member
// would require.
// e.g. if Command1 requires chassis, and Command2 requires arm,
// a CommandGroup containing them would require both the chassis and the
// arm.
addSequential(new WaitCommand(1.0));
addSequential(new ResetGyroCommand(Math.PI));
addSequential(new DriveTimeCommand(3.75, 0.167, 0.5, 0.0, -1.0));
addSequential(new WaitCommand(3.0));
addSequential(new BunnyLaunch(), 1.0);
}
示例8: CalibrateWinch
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public CalibrateWinch() {
// Calibrates Encoder
addSequential(new ResetShooterEncoder());
addSequential(new CalibrateShooterEncoderTop());
// Shoots the Ball
addSequential(new ShootBall());
addSequential(new WaitCommand(.1));
// Unlatches for when we pull back down
addSequential(new UnlatchTheLatch());
// Pulls the winch back up, and calibrates it as the bottom
addSequential(new PullBackShooter());
addSequential(new CalibrateShooterEncoderBottom());
addSequential(new WaitCommand(.1));
// Latches
addSequential(new LatchTheLatch());
addSequential(new WaitCommand(.5));
// Calibrates then Unwinds
addSequential(new UnwindWinch());
}
示例9: ShootAndCalibrate
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public ShootAndCalibrate() {
// Shoots the Ball
addSequential(new ShootBall());
addSequential(new WaitCommand(.5));
// Calibrates Encoder
addSequential(new ResetShooterEncoder());
addSequential(new CalibrateShooterEncoderTop());
// Unlatches for when we pull back down
addSequential(new UnlatchTheLatch());
// Pulls the winch back up
addSequential(new PullBackShooter());
addSequential(new WaitCommand(.1));
// Latches
addSequential(new LatchTheLatch());
addSequential(new WaitCommand(.1));
// Calibrates then Unwinds
addSequential(new CalibrateShooterEncoderBottom());
addSequential(new UnwindWinch());
}
示例10: DriveAndShoot
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public DriveAndShoot(){
addParallel(_waitAndDetect());
addSequential(new Shift(true));
addSequential(new WaitCommand(0.25));
addSequential(new DriveForward(1, 2800));
addSequential(new Conditional(new WaitCommand(.01), new WaitCommand(3)) { //may lower wait time on the waitcommand
protected boolean condition() {
return foundHotTarget;
}
});
addSequential(new SetArmPosition(1));
addParallel(new PreFire());
addSequential(new SetArmPosition(2));
addSequential(new WaitCommand(1));
addSequential(new Launch());
addSequential(new Reset());
}
示例11: DriveAndShoot2Ball
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public DriveAndShoot2Ball() {
addSequential(new Shift(true));
addSequential(new SetLatched(true));
addSequential(new SetArmPosition(2,false));
addParallel(new SpinRoller((float) -0.6));
addSequential(new WaitCommand(0.3));
addParallel(_waitAndLetRoll());
addSequential(new DriveForward(1, 4200));
addSequential(new WaitCommand(1.0));
addSequential(new WaitForChildren());
// addSequential(new );
addSequential(new Launch());
addParallel(_waitAndIntake());
addSequential(new Reset());
addParallel(new PreFire());
addSequential(new WaitCommand(0.5));
addSequential(new SpinRoller(0));
addSequential(new SetArmPosition(0, false));
addSequential(new WaitCommand(0.5));
addSequential(new SetArmPosition(2, false));
addSequential(new WaitCommand(1.0));
addSequential(new Launch());
addSequential(new Reset());
}
示例12: initialize
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
protected void initialize() {
if(condition()) {
_running = _ifTrue;
} else {
_running = _ifFalse;
}
if(_running != null) {
if(_running.getCommand() instanceof WaitCommand) {
_running.getCommand().start();
} else {
_running._initialize();
_running.initialize();
}
}
_firstRun = true;
}
示例13: TestNets
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public TestNets() {
addSequential(new Output("Starting Net Test"));
addSequential(new SetState(Subsystems.nets, State.CLOSED, Nets.CLOSE_SPEED));
addSequential(new SetState(Subsystems.nets.leftNet, State.OPEN, Nets.OPEN_SPEED));
addSequential(new WaitCommand(3.0d));
addSequential(new SetState(Subsystems.nets.rightNet, State.OPEN, Nets.OPEN_SPEED));
addSequential(new WaitCommand(3.0d));
addSequential(new SetState(Subsystems.nets.rightNet, State.CLOSED, Nets.CLOSE_SPEED));
addSequential(new WaitCommand(3.0d));
addSequential(new SetState(Subsystems.nets.leftNet, State.CLOSED, Nets.CLOSE_SPEED));
addSequential(new WaitCommand(3.0d));
addSequential(new SetState(Subsystems.nets, State.OPEN, Nets.OPEN_SPEED));
addSequential(new WaitCommand(3.0d));
addSequential(new SetState(Subsystems.nets, State.CLOSED, Nets.CLOSE_SPEED));
addSequential(new Output("Net Test Complete"));
}
示例14: DriveBox
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public DriveBox() {
requires(Subsystems.driveTrain);
addSequential(new DriveAtSpeed(0.3d),1.0d);
addSequential(new WaitCommand(0.2));
addSequential(new TurnRelativeAngle(90));
addSequential(new WaitCommand(0.2));
addSequential(new DriveAtSpeed(0.3d),1.0d);
addSequential(new WaitCommand(0.2));
addSequential(new TurnRelativeAngle(90));
addSequential(new WaitCommand(0.2));
addSequential(new DriveAtSpeed(0.3d),1.0d);
addSequential(new WaitCommand(0.2));
addSequential(new TurnRelativeAngle(90));
addSequential(new WaitCommand(0.2));
addSequential(new DriveAtSpeed(0.3d),1.0d);
addSequential(new WaitCommand(0.2));
addSequential(new TurnRelativeAngle(90));
addSequential(new WaitCommand(0.2));
}
示例15: AutonomousCommand
import edu.wpi.first.wpilibj.command.WaitCommand; //导入依赖的package包/类
public AutonomousCommand() {
setTimeout(15);
// Calibrates the shooter by moving it all the way down
addSequential(new AutonomousCalibrate());
// Sets the angle to Autonomous, so it can shoot
addSequential(new AutonomousSetAngle());
// Speeds up the shooter motors
addParallel(new AutonomousSpeedUp()); // Initially spins up shooter motors
// Waits for the motors to spin up or it to "timeout", and
// waits for the angle to get to the setpoint
addSequential(new WaitOrShoot(5));
// Waits an extra second for good measure
addSequential(new WaitCommand(1));
// Shoots the frisbees
addSequential(new AutonomousShootFrisbees(0.2, 1));
// Spins down the motors
addSequential(new AutonomousSpeedDown());
// Do a dance
addSequential(new AutonomousDance());
}