I’ve been having this problem since the beginning of the season, and I cannot pin down what is causing it. Around 1/2 of the time we enable the robot (whether wired or wireless, running from laptop or cRIO), the code will not run for around 8 or 9 seconds. I have checked through every VI for any errors, mismatched Refnums, misplaced loops or waits, etc… Nothing! If anyone has had this problem and could point me in the right direction, I would be eternally grateful.
the same thing happens to us. It only happens the first time you run the code, so it is nothing to worry about. And I think it is 8 to 9 seconds from communication, and not 8 to 9 seconds of deploying, so regardless it would be fine during competition.
Are you perhaps enabling the gyro somewhere other than in the Begin vi? It takes a while to calibrate when first initialized.
I will test this theory tonight. What makes me worried is that we also have a recurring “The loop containing the Robot Drive code is not running fast enough” error, making me think there is something else in the code slowing it down.
We’re running with the second robot right now, and there is no Gyro on it. I had all of the gyro code in disable structures because of this. So I think we can eliminate that for now.
If you aren’t making progress, attach code for people to look at. In your case, attach the whole thing.
Greg Mckaskle
I had the same problem. All i did is start a new robot project and copied the code part by part to see what was causing the problem. I could not find anything. but the start up lag i had disappeared. Maybe i had deleted something necessary to the code by accident in the first code. Try it if you have the time.
I discovered that it is about 10 second from when the robot gets communication with the DS, and we just happened to be hitting “enable” right when we got communication. This made it look like the actual code was lagging, but if I wait 10 seconds after getting comm, there is no problem when I enable.
I am still having some problems with the robot “spazzing” on enable. About 1/4 of the times I enable, a solenoid will fire or the turret will turn, then become still. I have set values for these in Begin so they should do nothing. Thoughts?
Thanks for the update. The delay before and during Begin makes more sense and is actually expected.
To help with the spazzing, you may want to add a set to disable as well. If you swap from tele to disabled to auto, the old value will still be in effect until auto sets it. You may also want to search for the name of the refnum to help find everywhere it is being set, such as periodic tasks.
Greg McKaskle