@Override protected void onStart() throws InterruptedException { super.onStart(); float power = 0.65f; // 2 GamePadMotors instances to drive the robot forward yGamePadMotorLeft = new GamePadMotor( this, gamepad1, robot.getLeftDrive(), GamePadMotor.Control.Y_BUTTON, power); yGamePadMotorRight = new GamePadMotor( this, gamepad1, robot.getRightDrive(), GamePadMotor.Control.Y_BUTTON, power); // 2 GamePadMotors instances to drive the robot backward aGamePadMotorLeft = new GamePadMotor( this, gamepad1, robot.getLeftDrive(), GamePadMotor.Control.A_BUTTON, -power); aGamePadMotorRight = new GamePadMotor( this, gamepad1, robot.getRightDrive(), GamePadMotor.Control.A_BUTTON, -power); // 2 GamePadMotors instances to spin the robot Left xGamePadMotorLeft = new GamePadMotor(this, gamepad1, robot.getLeftDrive(), GamePadMotor.Control.X_BUTTON, 0); xGamePadMotorRight = new GamePadMotor( this, gamepad1, robot.getRightDrive(), GamePadMotor.Control.X_BUTTON, power); // 2 GamePadMotors instances to spin the robot right bGamePadMotorLeft = new GamePadMotor( this, gamepad1, robot.getLeftDrive(), GamePadMotor.Control.B_BUTTON, power); bGamePadMotorRight = new GamePadMotor(this, gamepad1, robot.getRightDrive(), GamePadMotor.Control.B_BUTTON, 0); step = 1; // these are only used to set the encoder rightMotorToEncoder.startRunMode(DcMotorController.RunMode.RUN_USING_ENCODERS); leftMotorToEncoder.startRunMode(DcMotorController.RunMode.RUN_USING_ENCODERS); // rightMotorToEncoder.startRunMode(DcMotorController.RunMode.RUN_TO_POSITION); // leftMotorToEncoder.startRunMode(DcMotorController.RunMode.RUN_TO_POSITION); // rightMotorToEncoder.startRunMode(DcMotorController.RunMode.RUN_WITHOUT_ENCODERS); // leftMotorToEncoder.startRunMode(DcMotorController.RunMode.RUN_WITHOUT_ENCODERS); // getTelemetryUtil().setSortByTime(true); }
@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); }