On our first attempt to run our auto code we were not successful. The bot did nothing. We also noticed that the signal light went solid orange. My first thought was that the code must be buggy, so I stripped autonomous down until it just included the signal light code, but had the same problem. I know it isn’t periodic tasks causing the problem , because teleop work like a dream.
My second day thought was that perhaps I had accidentally changed a fundamental piece of the structure, so I can tried making a new project and using the stock frc code… Same problem.
I then thought I may have changed something in the wpi library somehow, so I used the frc disk and repair installed all of the frc components listed, built a new project, and loaded the stock code, and still a solid signal light.
I thought the same thing, but this is the txt block in the base FRC code for autonomous:
“This code sets the toggle rate used by the Periodic Tasks VI. For autonomous mode we slowly flash the USER1 LED on the cRIO. Look at the Periodic Tasks VI to see how this global value is used.”
A 500 numeric value is written to the LED Toggle Rate Global variable.
So, I had an opportunity to work with the practice bot this afternoon, and after taking what I learned here I tried to figure out the problem. Knowing that the light didn’t matter I used the code we wrote and deployed it from the development machine and attempted to run while tethered so we could monitor some the code for debugging… and it worked as expected.
I thought the problem was solved, until we tried it again… and nothing… the Autonomous program appeared to execute, but a probe on the enum of the state machine read not initiated.
Not sure why it worked the first time, and not the second, I shut everything down and tried again. It did the same thing; worked the first time, but not the second.
I then decided to try building the code, and deploy to run as a start-up item, and it works every time without fail.
My theory: You have some sort of counter that tells certain parts to run at certain times that don’t get reset when you run the second time. Don’t know what your code looks like but this is what I have seed happen before.
I have been running robot main, which is why I don’t understand it. In the autonomous vi I have a state machine, when the enumerated selector was probed it listed as uninitialized on the times it did not work.