Autonomous Not Running

Our robot seems to have a problem with running our autonomous during a competition. I have coded it using blocks, and when running it strictly off of the timed run on the controller it works. However, when our controller is hooked up to the field brain it will flinch and then not run the rest or any of the code. We had our first competition last weekend and of the 3 fields running, it ran once out of our 9 matches. I made no changes to the code during the competition, and I do have all of it placed in a competition template. Any clues as to where to go from here?

We ran into this problem so we figured out we had to change the first block from when started to when autonomous

Thats not our issue. We have it in when autonomous currently. We have also made three separate competition templates with the same code under when autonomous and none have worked. But thank you for the suggestion!

Do you guys use an inertial sensor?

If you could send screenshots of your code, it would make it easier to help you.

2 Likes

CompCode -.pdf (1.8 MB)
Here is the PDF of our code.

We do not use any sensors on our robot.

Are your controller firmware and Vexcode V5 software up to date? This happened to us once and our controller firmware wasn’t updated.

Also, if it only worked once at a competition, maybe the competition’s field running system was out of date or malfunctioning. If you test it on your own, does it work?

Sorry if this wasn’t very helpful. Hope you figure it out!

Everything is up to date on our end and we had been testing it on a field brain prior to the competition and it wasn’t working there either.

Today at practice we tried a different controller and brain and neither worked. My advisor and I then looked at the code and ran strictly the code and not the “myblock”. It seemed to work after that.

Does anyone know why that might be? Our advisor wasn’t sure why that would be the problem.

Thank you for the ideas though!

Huh. If the code itself worked but calling the function with it didn’t, it seems like a weird vex issue.

Maybe try defining a new function, putting the same code inside it, and running that one?
Or you could copy the code inside the function to the “When autonomous” block and run it from there.

I have made multiple functions and none of them have worked. For now I am just using the actual code instead of the blocks. Its the best I can do for now. Im not sure what else to try.

Try using the motor without a function, it will take more time but then you could figure out if it is a glitch or the function.

We did try to run it without the function and only the blocks that performed that task and it would work once and then not work the next time. I tested it a few times and while more consistent than it was before, it still does not run 100 percent of the time.

what actually happens when “it doesn’t run” ? Does the robot move at all ?
My guess is that the code just gets stuck on one of the “wait until front right is done” blocks.

4 Likes

It either does absolutely nothing or the robot twitches once and doesn’t move again. I don’t think the wait blocks are the problem though because while I was messing with it trying to figure it out, I was running simple code that just made it roll forward once and didn’t have any waiting in it, and that didn’t even run.

An update:

After running through our autonomous a bunch of times, we figured out the issue. It was our own mistake that was causing it to not work.

Apparently, if you start running the code before plugging in the controller to the brain, autonomous won’t work.

Lesson learned- start the program AFTER plugging in the remote.

Thank you all for your suggestions and trying to help. I appreciated it all!

2 Likes