Ejemplo n.º 1
0
 public void teleopInit() {
   // This makes sure that the autonomous stops running when
   // teleop starts running. If you want the autonomous to
   // continue until interrupted by another command, remove
   // this line or comment it out.
   if (autonomousCommand != null) autonomousCommand.cancel();
   teleCommand.start();
 }
Ejemplo n.º 2
0
 public void teleopInit() {
   START_TIME = System.currentTimeMillis();
   if (autonomousCommand != null && autonomousCommand.isRunning()) {
     autonomousCommand.cancel();
   }
   if (driveChooser.getSelected() != null) {
     ((Command) driveChooser.getSelected()).start();
   }
   intakeArm.initDefaultCommand();
   intakeWheel.initDefaultCommand();
   liftClimb.initDefaultCommand();
   climbPiston.initDefaultCommand();
 }
Ejemplo n.º 3
0
 /** This function is called periodically during operator control */
 public void teleopPeriodic() {
   Scheduler.getInstance().run();
   Object color = ledChooser.getSelected();
   if (color != null && color instanceof Command) {
     funCommand = (Command) color;
     funCommand.start();
   }
   Object lights = vlChooser.getSelected();
   if (lights != null && lights instanceof Command) {
     vlCommand = (Command) lights;
     vlCommand.start();
   }
   log();
 }
Ejemplo n.º 4
0
  /**
   * This autonomous (along with the chooser code above) shows how to select between different
   * autonomous modes using the dashboard. The sendable chooser code works with the Java
   * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and
   * uncomment the getString code to get the auto name from the text box below the Gyro
   *
   * <p>You can add additional auto modes by adding additional commands to the chooser code above
   * (like the commented example) or additional comparisons to the switch structure below with
   * additional strings & commands.
   */
  public void autonomousInit() {
    //	autonForward = (Command) driveForward.getSelected();
    // defenseCross = (Command) defenseChooser.getSelected();
    // positionAndGoal = (Command) positionChooser.getSelected();

    autoCommand = new DriveForwardAuton();
    /*
     * String autoSelected = SmartDashboard.getString("Auto Selector",
     * "Default"); switch(autoSelected) { case "My Auto": autonomousCommand
     * = new MyAutoCommand(); break; case "Default Auto": default:
     * autonomousCommand = new ExampleCommand(); break; }
     */

    // schedule the autonomous command (example)

    //	finalAuton.addSequential(autonForward, 2);
    // finalAuton.addSequential(defenseCross, 7);
    ///	finalAuton.addSequential(positionAndGoal, 6);

    /*if (autonForward != null)
    		{
    			finalAuton.start();
    		}
    */
    autoCommand.start();
  }
Ejemplo n.º 5
0
  @Override
  public void autonomousInit() {
    // try {
    // Robot.drive.gyro.reset();
    // } catch (Exception ex) {
    // ex.printStackTrace();
    // }

    // if (chooser.getSelected() != null) {
    autonomousCommand = new HighSpeedAuto();
    autonomousCommand.start();
    System.out.println("Running an auto...");
    System.out.println(autonomousCommand.toString());
    // }

  }
Ejemplo n.º 6
0
 public void teleopInit() {
   watchdog = Watchdog.getInstance();
   if (auto) {
     autonomousCommand.cancel();
   }
   Catapult.getInstance().initialize();
 }
Ejemplo n.º 7
0
  public void autonomousInit() {
    // schedule the autonomous command (example)

    autonomousCommand = (Command) autoChooser.getSelected();
    if (autonomousCommand != null) {
      autonomousCommand.start();
    }
  }
  public void autonomousInit() {
    // schedule the autonomous command
    Robot.drivetrain.resetEncoders();
    Robot.purpleSensor.zeroHeading();

    autonomousCommand.start();
    drivetrain.disableResetButton();
  }
Ejemplo n.º 9
0
  /** This function is called at the beginning of autonomous. */
  public void autonomousInit() {
    Log.log("Autonomous has begun!");

    // Cancel the currently-running autonomous command
    cancelAutonomous();

    // Run the current autonomous command
    autonomousCommand = new BasicAutonomous();
    autonomousCommand.start();
  }
Ejemplo n.º 10
0
  /**
   * This autonomous (along with the chooser code above) shows how to select between different
   * autonomous modes using the dashboard. The sendable chooser code works with the Java
   * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and
   * uncomment the getString code to get the auto name from the text box below the Gyro
   *
   * <p>You can add additional auto modes by adding additional commands to the chooser code above
   * (like the commented example) or additional comparisons to the switch structure below with
   * additional strings & commands.
   */
  public void autonomousInit() {
    autonomousCommand = (Command) chooser.getSelected();

    String autoSelected = SmartDashboard.getString("Auto Selector", "Default");
    switch (autoSelected) {
      case "Auto1":
        autonomousCommand = new autonomous1();
        break;
    }

    // schedule the autonomous command (example)
    if (autonomousCommand != null) autonomousCommand.start();
  }
Ejemplo n.º 11
0
  /**
   * This autonomous (along with the chooser code above) shows how to select between different
   * autonomous modes using the dashboard. The sendable chooser code works with the Java
   * SmartDashboard. If you prefer the LabVIEW Dashboard, remove all of the chooser code and
   * uncomment the getString code to get the auto name from the text box below the Gyro
   *
   * <p>You can add additional auto modes by adding additional commands to the chooser code above
   * (like the commented example) or additional comparisons to the switch structure below with
   * additional strings and commands.
   */
  public void autonomousInit() {
    autonomousCommand = (Command) chooser.getSelected();

    /* String autoSelected = SmartDashboard.getString("Auto Selector", "Default");
    switch(autoSelected) {
    case "My Auto":
    	autonomousCommand = new MyAutoCommand();
    	break;
    case "Default Auto":
    default:
    	autonomousCommand = new ExampleCommand();
    	break;
    } */

    // schedule the autonomous command (example)
    if (autonomousCommand != null) autonomousCommand.start();
  }
Ejemplo n.º 12
0
 public void autonomousInit() {
   // schedule the autonomous command (example)
   if (autonomousCommand != null) autonomousCommand.start();
 }
 // Called repeatedly when this Command is scheduled to run
 protected void execute() {
   if (!button.get()) command.start();
 }
Ejemplo n.º 14
0
 public void autonomousInit() {
   // schedule the autonomous command (example)
   Catapult.getInstance().initialize();
   autonomousCommand.start();
 }
Ejemplo n.º 15
0
 public void testInit() {
   if (autonomousCommand != null) {
     autonomousCommand.cancel();
   }
 }
Ejemplo n.º 16
0
 public void autonomousInit() {
   // schedule the autonomous command
   if (autonomousCommand != null) {
     autonomousCommand.start();
   }
 }
Ejemplo n.º 17
0
 public void autonomousInit() {
   // schedule the autonomous command (example)
   Robot.driveTrain.set = true;
   if (autonomousCommand != null) autonomousCommand.start();
 }
 public void run() {
   command.cancel();
 }
Ejemplo n.º 19
0
 public void autonomousInit() {
   // schedule the autonomous command (example)
   Scheduler.getInstance().add(autonomousCommand);
   autonomousCommand.start();
 }
 // Called when another command which requires one or more of the same
 // subsystems is scheduled to run
 protected void interrupted() {
   command.cancel();
 }
 // Make this return true when this Command no longer needs to run execute()
 protected boolean isFinished() {
   return !command.isRunning();
 }
Ejemplo n.º 22
0
 /** Cancel the currently-running autonomous command, if applicable. */
 private void cancelAutonomous() {
   if (autonomousCommand != null) {
     autonomousCommand.cancel();
     autonomousCommand = null;
   }
 }