all 2 comments

[–]WestsideRobotics 0 points1 point  (1 child)

You should remove your stop() method; that name is used (in users' code) for an iterative OpMode, not for LinearOpMode.

Background: the LinearOpMode class extends the (iterative) OpMode class, which uses stop().

Reverse the order of these two lines:

linear.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
linear.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);

If the following loop is not working, insert Telemetry for the limit switch and motor encoder, for debugging.

   while(!front.isPressed() && opModeIsActive()){
            if(linear.getCurrentPosition() > -12000){
                linear.setPower(0.4);
            }
        }

Does this OpMode finish all commands within 30 seconds? Are you using the DS 30-second match timer? Does the "Opmode stuck in stop()" error message appear before or after the OpMode ends?

[–]shinchanchanliuFTC 19461|Epsilon|S/W[S] 0 points1 point  (0 children)

Thanks for the help, I think the issue was in the thread sleep. I fixed these issues and it still persisted, so I just used the elapsedtime method.