Why does my code freeze and I have to give It a tug to work

We have been trying to fix our code to be consistent and us not giving it a tug for a while we have had this issue since the start of the season but we haven’t found anything that helps we have asked lots of other kids that do robotics but nothing helped if anyone can help please help also if you need I can show a vide

what does that even mean ?

post the code and give us an accurate description of the problem.


Ok I will put a video to

He means you have to give it a push

Yeah and how do you fix it to not have to do that

When do you have to push it to make it work? I had a problem that could be what you are describing although you were pretty vague. My robot would sometimes stop in autonomous driving forward and not do anything. The problem was that I was slowing down the robot’s drive speed as it got closer to the target and it sometimes go so slow that the motors didn’t move the robot. I fixed this by adding a if less than a certain rpm, it equals a certain rpm. Hope this helps and if this is not the issue, can you please describe it some more.

It sounds like you have a command that is not able to complete. For example driving a certain distance or moving a motor a certain amount. Using the set timeout command for the motor or drivetrain may help.
Is it getting stuck at the same command in your code every time? Posting your code and a video would help.

Sorry I fixed that it over corrects when it try’s to correct itself when it does t need to it just corrects way to much

Ok I will send a video and my code for you guys to see

oh yeah, I used to have that problem too. Never figured out how to fix it but it got me in the habit of massaging my robot before I let it run it’s autonomous. By massaging I mean pushing the robot forward, pushing the robot backward, with a focus on the motor that’s causing you the issue.

As a means of ignoring the problem I also had a timeout, so that whenever the code freezes for too long it just moves on to the next line. I think calvc01 has the right idea, try making sure your command is not impossible, like for example making a clawbot arm turn for 600 degrees when the arm will collide with the robot at 200.

Don’t make it impossible like what cookie blitz said. If it’s refusing to move, is there anything caught, are the motors burnt out, is it the gear ratio, tires (like omni’s and regular tractions, tractions need short wheelbase), or is it weight? All questions you should ask yourself.