Quote:
Originally Posted by pfreivald
I don't know if this is useful at this point, but after struggling with watchdog issues throughout the build season, we corrected it by putting a 5 ms wait statement in our main loop. That cured the problem instantly, and it didn't come back.
(I'm not at all a programmer, but I know that's what they did, so I thought I'd share it here. Good luck teams!)
Patrick
|
I'll expand upon what we did :-)
We were experiencing system level watchdog "not fed" errors. For awhile we couldn't figure out what exactly was happening except that it had to do with the camera feed on the dashboard. It turned out that we were starving the background task/thread that was responsible for serving the dashboard with the camera image packets by hogging CPU time with our main task/thread (the thread that OperatorControl() runs within). This affected our communication between our driver station and cRIO, effectively timing-out the watchdog that monitored communication.
The fix was to suspend the main thread for 5/100 of a second, thus giving other threads (ie, the camera feed thread) more time to execute.
Code:
void OperatorControl() {
while(IsOperatorControl()) {
... do you own work ..
.. then at the end of the loop, suspend the task ..
Wait(0.05f);
}
}