TeamCode/src/main/java/org/firstinspires/ftc/teamcode/BaseRobot.java
/**
     * @param power:   the speed to drive at. Negative for reverse.
     * @param inches:  the distance to drive.
     * @return Whether the target distance has been reached.
     */
@param power:   the speed to drive at. Negative for reverse.
@param inches:  the distance to drive.
@return Whether the target distance has been reached.
@param power : the speed to drive at . Negative for reverse . @param inches : the distance to drive . @return Whether the target distance has been reached .
public boolean auto_drive(double power, double inches) {
        double TARGET_ENC = ConstantVariables.K_PPIN_DRIVE * inches * 1.414;
        telemetry.addData("Target_enc: ", TARGET_ENC);
        double left_speed = power;
        double right_speed = power;
        left_speed *= -1; 
        left_speed = Range.clip(left_speed, -1, 1);
        right_speed = Range.clip(right_speed, -1, 1);
        drive(left_speed, left_speed, right_speed, right_speed);
        if (Math.abs(get_motor_enc(leftFrontDriveMotor)) >= TARGET_ENC || Math.abs(get_motor_enc(rightFrontDriveMotor)) >= TARGET_ENC) {
            drive(0,0,0,0);
            return true;
        } else {
            return false;
        }
    }
public boolean auto_drive ( double power , double inches ) { double TARGET_ENC = ConstantVariables . K_PPIN_DRIVE * inches * 1.414 ; telemetry . addData ( "Target_enc: " , TARGET_ENC ) ; double left_speed = power ; double right_speed = power ; left_speed *= - 1 ; left_speed = Range . clip ( left_speed , - 1 , 1 ) ; right_speed = Range . clip ( right_speed , - 1 , 1 ) ; drive ( left_speed , left_speed , right_speed , right_speed ) ; if ( Math . abs ( get_motor_enc ( leftFrontDriveMotor ) ) >= TARGET_ENC || Math . abs ( get_motor_enc ( rightFrontDriveMotor ) ) >= TARGET_ENC ) { drive ( 0 , 0 , 0 , 0 ) ; return true ; } else { return false ; } }
@param power:   the speed to drive at.
@param power : the speed to drive at .
//double error = get_motor_enc(rightFrontDriveMotor) + get_motor_enc(leftFrontDriveMotor); //positive means right turned more, negative means left turned more //error /= ConstantVariables.K_DRIVE_ERROR_P; //left_speed += error; //right_speed -= error; //left motors turn opposite directions