TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriverOpMode.java
/**
     * Joystick Driving Controls
     * Left bumper for slow motion
     * Left trigger to enable field mode, right trigger to enable robot-oriented mode
     */
Joystick Driving Controls
Left bumper for slow motion
Left trigger to enable field mode, right trigger to enable robot-oriented mode
Joystick Driving Controls Left bumper for slow motion Left trigger to enable field mode right trigger to enable robot - oriented mode
private void handleMovement() {
        double turn = gamepad1.right_stick_x/2;
        double power = Math.hypot(gamepad1.left_stick_x, -gamepad1.left_stick_y);
        double moveAngle = Math.atan2(-gamepad1.left_stick_y, gamepad1.left_stick_x) - Math.PI/4;
        if (fieldMode) {
            moveAngle += -currPose.getHeading() - fieldHeadingOffset + fieldModeSign*Math.PI/2;
        }
        turn = turn / 4;
        if (gamepad1.left_bumper) { 
            power = power/3;
            turn = turn/3;
        }
        robotHardware.mecanumDriveTest(power, moveAngle, turn, 0);
        if (gamepad1.left_trigger > 0) {
            fieldMode = true;
            fieldHeadingOffset = currPose.getHeading();
        } else if (gamepad1.right_trigger > 0) {
            fieldMode = false;  
        }
    }
private void handleMovement ( ) { double turn = gamepad1 . right_stick_x / 2 ; double power = Math . hypot ( gamepad1 . left_stick_x , - gamepad1 . left_stick_y ) ; double moveAngle = Math . atan2 ( - gamepad1 . left_stick_y , gamepad1 . left_stick_x ) - Math . PI / 4 ; if ( fieldMode ) { moveAngle += - currPose . getHeading ( ) - fieldHeadingOffset + fieldModeSign * Math . PI / 2 ; } turn = turn / 4 ; if ( gamepad1 . left_bumper ) { power = power / 3 ; turn = turn / 3 ; } robotHardware . mecanumDriveTest ( power , moveAngle , turn , 0 ) ; if ( gamepad1 . left_trigger > 0 ) { fieldMode = true ; fieldHeadingOffset = currPose . getHeading ( ) ; } else if ( gamepad1 . right_trigger > 0 ) { fieldMode = false ; } }
Joystick Driving Controls
 Left bumper for slow motion
 Left trigger to enable field mode, right trigger to enable robot-oriented mode
Joystick Driving Controls Left bumper for slow motion Left trigger to enable field mode right trigger to enable robot - oriented mode
//power = power; // further bring it down // toggle field mode on/off. // Driver 1: left trigger - enable; right trigger - disable //good luck driving