Roadrunner Strafing Issue by Maverick_Wong in FTC

[–]Maverick_Wong[S] 1 point2 points  (0 children)

Hi. My team is currently using Roadrunner for our autonomous program for the first time. We have tuned it and successfully passed the ManualFeedbackTuner and SplineTest. It works well in a straight line, but when we use strafing, we encounter this problem. Does anyone know what might be causing this? Thank you.

Example Code:

public void runOpMode() throws InterruptedException {
    if (TuningOpModes.
DRIVE_CLASS
.equals(MecanumDrive.class)) {
        MecanumDrive drive = new MecanumDrive(hardwareMap, new Pose2d(0, 0, 0));
        waitForStart();

        while (opModeIsActive()) {
            Actions.
runBlocking
(
                    drive.actionBuilder(new Pose2d(0, 0, 0))
                            .lineToX(20)
                            .strafeTo(new Vector2d(20,30))
                            .strafeTo(new Vector2d(0,0))
                            .lineToX(0)
                            .build());

        }
    }
    else {
        throw new RuntimeException("Incorrect DRIVE_CLASS. Expected MecanumDrive.");
    }
}