示例#1
0
  /**
   * Implement this method to define the code to run when the Init button is pressed on the Driver
   * station.
   */
  @Override
  protected void onInit() {

    robot = PushBot.newConfig(hardwareMap, getTelemetryUtil());

    getTelemetryUtil().addData("Init", getClass().getSimpleName() + " initialized.");
    getTelemetryUtil().sendTelemetry();
  }
示例#2
0
  @Override
  protected void onStart() throws InterruptedException {
    super.onStart();

    // set up tank drive operation to use the gamepad joysticks
    tankDrive = new GamePadTankDrive(this, gamepad1, robot.getLeftDrive(), robot.getRightDrive());
    tankDrive.startRunMode(DcMotorController.RunMode.RUN_WITHOUT_ENCODERS);

    // set up arm motor operation using the gamepad's left joystick
    armMotorStick =
        new GamePadMotor(this, gamepad2, robot.getLeftArm(), GamePadMotor.Control.LEFT_STICK_Y);

    // operate the claw with left/right buttons
    claw =
        new GamePadClaw(
            this,
            gamepad2,
            robot.getLeftHand(),
            robot.getRightHand(),
            GamePadServo.Control.X_B,
            0.5);
  }