diff --git a/ftc2024-autonome.java b/ftc2024-autonome.java index b666e07..7aa45fc 100644 --- a/ftc2024-autonome.java +++ b/ftc2024-autonome.java @@ -32,11 +32,34 @@ public class ftc2024_autonome extends LinearOpMode { private DcMotor lm; private IMU imu; private ElapsedTime runtime = new ElapsedTime(); + YawPitchRollAngles robotOrientation; public double time_for_dist(double speed, double dist){ return (double) (dist/speed); } + + /* + * @param double angle2go => degrees + */ + public double runPid(double angle2go){ + robotOrientation = imu.getRobotYawPitchRollAngles(); + angle2go = (angle2go*180)/Math.PI + double yaw = robotOrientation.getYaw(AngleUnit.RADIANS); + double lastPos; + // command -1.0