TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DRSS_NewBlueAutonomous.java
/**
     * Turns the robot according to distance left and right to move both motors. This has much more
     * inaccuracy than turn(int gyroTurn) and is harder to use as well. The method is kept in for
     * legacy reasons, but should not be used if possible. Being unfinalized code, it is
     * disorganized and difficult to read at points.
     *
     * @param lTarget The distance in encoder counts to move the left motor
     * @param rTarget The distance in encoder counts to move the right motor
     */
Turns the robot according to distance left and right to move both motors. This has much more
inaccuracy than turn(int gyroTurn) and is harder to use as well. The method is kept in for
legacy reasons, but should not be used if possible. Being unfinalized code, it is
disorganized and difficult to read at points.

@param lTarget The distance in encoder counts to move the left motor
@param rTarget The distance in encoder counts to move the right motor
Turns the robot according to distance left and right to move both motors . This has much more inaccuracy than turn ( int gyroTurn ) and is harder to use as well . The method is kept in for legacy reasons but should not be used if possible . Being unfinalized code it is disorganized and difficult to read at points . @param lTarget The distance in encoder counts to move the left motor @param rTarget The distance in encoder counts to move the right motor
@Deprecated
    private void turn(int lTarget, int rTarget){
        boolean lAchieved = false;
        boolean rAchieved = false;
        double lPower = Range.clip(-0.05 * ((leftMotor.getCurrentPosition() - lTarget)),
                -0.6, 0.6);
        double rPower = Range.clip(-0.05 * ((rightMotor.getCurrentPosition() - rTarget)),
                -0.6, 0.6);
        telemetry.addData("lPower", lPower);
        telemetry.addData("rPower", rPower);
        if(!estimateEquals(leftMotor.getCurrentPosition(), lTarget, 100)){
            leftMotor.setPower(lPower);
            /*If the left motor is not within 100 encoder counts of the target, run it at the power
             * calculated earlier
             */
        } else{
            leftMotor.setPower(0.0);
            lAchieved = true;
            /*If the left motor is within 100 encoder counts of the target, stop it and declare
             * that the left side has reached its target.
             */
        }
        if(!estimateEquals(rightMotor.getCurrentPosition(), rTarget, 100)){
            rightMotor.setPower(rPower);
            /*If the right motor is not within 100 encoder counts of the target, run it at the power
             * calculated earlier
             */
        } else{
            rightMotor.setPower(0.0);
            rAchieved = true;
            /*If the right motor is within 100 encoder counts of the target, stop it and declare
             * that the left side has reached its target.
             */
        }
        if(lAchieved && rAchieved){
            currentStep++;
            resetRequested = true;
            /* If both motors have reached their target, increment the current step by one and
             * request a reset.
             */
        }
    }
@ Deprecated private void turn ( int lTarget , int rTarget ) { boolean lAchieved = false ; boolean rAchieved = false ; double lPower = Range . clip ( - 0.05 * ( ( leftMotor . getCurrentPosition ( ) - lTarget ) ) , - 0.6 , 0.6 ) ; double rPower = Range . clip ( - 0.05 * ( ( rightMotor . getCurrentPosition ( ) - rTarget ) ) , - 0.6 , 0.6 ) ; telemetry . addData ( "lPower" , lPower ) ; telemetry . addData ( "rPower" , rPower ) ; if ( ! estimateEquals ( leftMotor . getCurrentPosition ( ) , lTarget , 100 ) ) { leftMotor . setPower ( lPower ) ; /*If the left motor is not within 100 encoder counts of the target, run it at the power
             * calculated earlier
             */ } else { leftMotor . setPower ( 0.0 ) ; lAchieved = true ; /*If the left motor is within 100 encoder counts of the target, stop it and declare
             * that the left side has reached its target.
             */ } if ( ! estimateEquals ( rightMotor . getCurrentPosition ( ) , rTarget , 100 ) ) { rightMotor . setPower ( rPower ) ; /*If the right motor is not within 100 encoder counts of the target, run it at the power
             * calculated earlier
             */ } else { rightMotor . setPower ( 0.0 ) ; rAchieved = true ; /*If the right motor is within 100 encoder counts of the target, stop it and declare
             * that the left side has reached its target.
             */ } if ( lAchieved && rAchieved ) { currentStep ++ ; resetRequested = true ; /* If both motors have reached their target, increment the current step by one and
             * request a reset.
             */ } }
Turns the robot according to distance left and right to move both motors.
Turns the robot according to distance left and right to move both motors .
//Declare booleans stating if the left or right sides have reached their target. //Calculate the left power via a rough method of proportional control. //Calculate the right power via a rough method of proportional control. //Send data to the robot controller.