Can’t get my robot to respond to this auton code consistently. Sometimes it makes the turn and moves forward, other times it makes the turn and stays there…not moving
Any feedback is greatly appreciated
Thank you.
Why do you need the wait until block? It should just wait automatically.
That might be because of the “wait until block”, as the robot will not perform the next task (driving forward) until those conditions are met. So if the robot happens to not turn to 97 accurately, it will not move forward. You can check this by printing the robot’s heading after turning, or something after the “wait until” block to see if the brain actually runs that part of the code.
Your “When started” block is also missing…
“Turn to heading 97 degrees” as you have it configured will block, it will not move onto the wait block until it is finished, however, it will probably not leave the robot with a heading of exactly 97 degrees. This is generic code that works better for some robots than others, if it ends up with a robot heading of 100 degrees then the wait until block will never be true and the code will never be able to execute subsequent blocks.
The wait until block is not necessary in this code, just remove it.