We found an interesting problem today, that we can’t find a way to get around it. We would like to “code” around it but not sure how.
We have our camera tracking ok, and everything works great.
However, if we lose the backup battery and we powered down the robot. Our code goes through the camera initialization again, waiting about 3 seconds before it comes online (normal)…however it locks up the robot controller from executing code because the camera could not be found on power up. We studied this today when we put a simple PrintF statement in a while 1 loop in OperatorControl function that says: “Hi, I am in the OperatorControl Loop”. This was only printed to the screen once, and none of our code would execute any more. We did not get a code error LED, and we seemed to have all green lights on the robot controller.
If we had a good battery, and the camera was found on power up or during the initialization, then it would startup ok and track data. We could then unplug the TTL port “live”, folks don’t try this at home…but we had to do this to see what would happen…and we also unplugged the backup battery to kill the camera totally. Our code kept executing just fine after killing the RS-232 and power source to the camera live without powering down.
We are thinking about the what ifs. What if our camera becomes damaged by a poof ball and doesn’t work, the next time it powers up with a "Initialize Camera " function call, it’s going to LOCK UP, and we are going to be a sitting DUCK.
We could not see ANY WAY to code around this. Can we check for the camera somehow and not execute the Initialize if we don’t find the camera present so our robot will continue to initialize and execute the rest of our code?
Can anyone else replicate this?
Get your camera tracking working FIRST…good battery, put a printF statement in the main loop so you can see that your controller is executing on every loop.
Next, power down your robot. Unplug your camera TTL and backup battery, leave your code alone.
Now power up your robot and observe if your printF statement is still working. What we see is after the 3 seconds, the printF will print one time, and that’s all she wrote…no more looping…seems locked up.