Created a variable to get the direction of the left joystick using the atan of the negative of left stick y and positive left stick x (direction variable). (edit: I don't know why the "/ Math.pi *180" is there. I removed it). (another edit: "gamepad1.left_stick_y" is actually "-gamepad1..." because we need to negative y value of the joystick)
Created a variable to get the magnitude of the left joystick.
Created a variable to get the x value of the right joystick to rotate the robot (rotation).
Created if statement to adjust the magnitude variable if it is greater than square root of 2 (Gabriel told me about this because there was a funny interaction or situation and the if statement fixed it and limited the magnitude to the square root of 2)
Completed the "if statement" that detects movement in the joystick and translates that into motor power that will move the robot in the direction of the joystick position when it is moved.
If the power of the motors are determined with sin(direction +or- pi/4 [this is dependent on which wheel it is]) * magnitude. it also takes the rotation variable (right stick x value) into account when determining the power. (rotation will only really work with the field-orientated-movement).
Else statement is to stop the robot when no joystick inputs are detected.
added the field-orientated-movement variable (fom) to get the angle of the robot since the start and then use that value and subtract it from the direction variable to make the robot move in the direction of the joystick in relation to its starting angle (or the position of the field)
Tuesday: