package com.qualcomm.ftcrobotcontroller.opmodes.customCode;


import com.qualcomm.robotcore.hardware.DcMotor;

public class Robot {
    private DcMotor leftMotor;
    private DcMotor rightMotor;

    public Robot(DcMotor leftMotor, DcMotor rightMotor) {
        this.leftMotor = leftMotor;
        this.rightMotor = rightMotor;

        rightMotor.setDirection(DcMotor.Direction.REVERSE);
    }

    public void directDrive(double leftValue, double rightValue) {
        leftMotor.setPower(leftValue);
        rightMotor.setPower(rightValue);
    }
    
    public void move(double distance, double speed) {
        // This will be smarter with motor encoders.
        leftMotor.setPower(speed);
        rightmotor.setPower(speed);
    }
    
    public void rotate(double deg, double speed) {
        // This will be smarter and rotate exact degrees with motor encoders.
        if(deg < 0) {
            motorLeft.setPower(-speed);
            motorRight.setPower(speed);
        }
        if(deg > 0) {
            motorLeft.setPower(speed);
            motorRight.setPower(-speed);
        }
    }

    public void directDrive(double leftValue, double rightValue, boolean squareInputs) {
        if(squareInputs) {
            if(leftValue >= 0.0) {
                leftValue = (leftValue * leftValue);
            } else {
                leftValue = -(leftValue * leftValue);
            }
        }
        if(rightValue >= 0.0) {
            rightValue = (rightValue * rightValue);
        } else {
            rightValue = -(rightValue * rightValue);
        }

        directDrive(leftValue, rightValue);
    }
}

@@ -102,16 +102,74 @@
 DcMotor;
+%0Aimport com.qualcomm.robotcore.hardware.DcMotorController;
 %0A%0Apublic
@@ -375,25 +375,24 @@
 rightMotor;%0A
-%0A
         righ
@@ -439,16 +439,177 @@
 VERSE);%0A
+        leftMotor.setChannelMode(DcMotorController.RunMode.RUN_USING_ENCODERS);%0A        rightMotor.setChannelMode(DcMotorController.RunMode.RUN_USING_ENCODERS);%0A
     %7D%0A%0A 
@@ -987,30 +987,16 @@
 uble deg
-, double speed
 ) %7B%0A    
@@ -1081,133 +1081,33 @@
     
-if(deg %3C 0) %7B%0A            motorLeft.setPower(-speed);%0A            motorRight.setPower(speed);%0A        %7D%0A        if(deg %3E 0) %7B
+double power = deg / 180;
 %0A   
@@ -1183,26 +1183,16 @@
 speed);%0A
-        %7D%0A
     %7D%0A%0A 

Update robot smarts