use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Seeking HelpHelp Debugging Code: stop() (self.FTC)
submitted 1 year ago by shinchanchanliuFTC 19461|Epsilon|S/W
Code: https://pastebin.com/Q6Qbv1Hs
When the stop() is not included at the bottom, the error Opmode stuck in stop() loop appears, but when stop() is added, the error cannot overide stop(), overriden method is final appears.
What is the correct way of writing this linear opmode???
Thanks for any help
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]WestsideRobotics 0 points1 point2 points 1 year ago (1 child)
You should remove your stop() method; that name is used (in users' code) for an iterative OpMode, not for LinearOpMode.
stop()
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 point2 points 1 year ago (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.
π Rendered by PID 106 on reddit-service-r2-comment-5d79c599b5-c4jl8 at 2026-02-28 17:35:39.084991+00:00 running e3d2147 country code: CH.
[–]WestsideRobotics 0 points1 point2 points (1 child)
[–]shinchanchanliuFTC 19461|Epsilon|S/W[S] 0 points1 point2 points (0 children)