TeamCode/src/main/java/org/firstinspires/ftc/teamcode/BaseRobot.java
/**
     * @param power:   the speed to drive at. Positive for right, negative for left.
     * @param inches:  the distance to drive.
     * @return Whether the target distance has been reached.
     */
@param power:   the speed to drive at. Positive for right, negative for left.
@param inches:  the distance to drive.
@return Whether the target distance has been reached.
@param power : the speed to drive at . Positive for right negative for left . @param inches : the distance to drive . @return Whether the target distance has been reached .
public boolean auto_horizontal(double power, double inches) {
        double TARGET_ENC = ConstantVariables.K_PPIN_DRIVE * inches * 1.414;
        telemetry.addData("Target_enc: ", TARGET_ENC);
        double front_speed = power;
        double back_speed = power;
        front_speed *= -1; 
        front_speed = Range.clip(front_speed, -1, 1);
        back_speed = Range.clip(back_speed, -1, 1);
        drive(front_speed, back_speed, front_speed, back_speed);
        drive(frontPower, backPower, frontPower, backPower);
        if (Math.abs(get_motor_enc(leftFrontDriveMotor)) >= TARGET_ENC || Math.abs(get_motor_enc(leftBackDriveMotor)) >= TARGET_ENC) {
            drive(0,0,0,0);
            return true;
        } else {
            return false;
        }
    }
public boolean auto_horizontal ( double power , double inches ) { double TARGET_ENC = ConstantVariables . K_PPIN_DRIVE * inches * 1.414 ; telemetry . addData ( "Target_enc: " , TARGET_ENC ) ; double front_speed = power ; double back_speed = power ; front_speed *= - 1 ; front_speed = Range . clip ( front_speed , - 1 , 1 ) ; back_speed = Range . clip ( back_speed , - 1 , 1 ) ; drive ( front_speed , back_speed , front_speed , back_speed ) ; if ( Math . abs ( get_motor_enc ( leftFrontDriveMotor ) ) >= TARGET_ENC || Math . abs ( get_motor_enc ( leftBackDriveMotor ) ) >= 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(leftFrontDriveMotor) + get_motor_enc(leftBackDriveMotor); //positive means front turned more, negative means back turned more //error /= ConstantVariables.K_DRIVE_ERROR_P; //front_speed -= error; //back_speed += error; //front motors turn opposite directions //        double frontPower = Range.clip(0 - power, -1.0, 1.0); //        double backPower = Range.clip(0 + power, -1.0, 1.0); // //        drive(frontPower, backPower, frontPower, backPower);