![]() |
Camera does not search in autonomous mode after reset
We encountered a problem for the first time today at the regional. It only happens in autonomous mode. Take the robot to the playing field, plug in the backup battery, power on the main battery, press reset on the controller, the camera does not initialize.
I've read other people have encountered the same problem but have not seen anyone have an actual fix. The camera code is correctly called from autonomous mode and works if the robot is put into user mode then back into autonomous mode (which you obvisously cannot do on the field). We even did this in the pits and left the robot powered on till it was put on the playing field. It worked that time. We have since found a spot in the code which is called in autonomous mode right before the inner while loop. We are going to try to reset the camera intialization variable there and test it during the finals. The behavior is the same as if a controller reset does not call the program's static initializers in autonomous mode! |
Re: Camera does not search in autonomous mode after reset
Quote:
|
Re: Camera does not search in autonomous mode after reset
We would completely unplug our batteries also. We could reproduce the problems in the pits by setting our OI to autonomous. During the matches today the camera did initialize so resetting the variable I mentioned does work.
|
Re: Camera does not search in autonomous mode after reset
Quote:
You know that section in the User_Autonomous_Code function, right before the "while (autonomous_mode)" loop (and right after all of the PWM values are reset)? Our team had been experiencing problems with that, and so (in my hacking nature...) I had put the Initialize_Camera function in that section. I don't know why, but it helped, and now the camera always initializes when Autonomous mode starts (or is invoked). also, while you are executing the Autonomous loop, are you sure you are calling the function "Camera_Handler()"? |
Re: Camera does not search in autonomous mode after reset
Quote:
Code:
tracking_initialized = 0;Quote:
The behavior I described as if the static initializers are not being called under certain conditions is also happening in the recent thread The 8.2 (or 8.3) Battery Voltage Bug. |
Re: Camera does not search in autonomous mode after reset
Come to think of it, we had "intermittent" camera initialization problems from day one. Most of the time we assumed it was from a low backup battery so we were constantly swapping those in and out. Camera initialization always failed for autonomous mode when the competition port was connected. We struggled a long time with assuming we were not starting up the robot the same way every time. It was not until Friday night at the regional when we were finally able to consistently reproduce the problem in the pits. That was when we decided to try a non-static initializer.
And I no longer have access to the robot to write a test to prove the static initialization conditions. The static initializater for camera initialization is in Kevin's bells and whistles camera code. |
Re: Camera does not search in autonomous mode after reset
Quote:
Quote:
Oy, amazing how repeated testing of a bot at home can show things to be surprising robust, but fail completely at competition like clockwork... |
Re: Camera does not search in autonomous mode after reset
It seems that the problem can manifest itself as a messed up state machine - where there is the large switch() statement with CASE_ONE through CASE_WHATEVER, the state becomes set to zero accidentally so it falls through every time and does nothing.
|
Re: Camera does not search in autonomous mode after reset
Quote:
I distinctly recall a similar problem in our custom code last year, with the robot acting completely bezerk on the field, yet in the pit with the dongle, it worked perfectly. I had heard a rumor about the Arena Controller forcing some king of sync with the OI and RC; is there anything to justify this rumor? It might explain a lot of the "it worked perfectly until I put it on the field" problems. Would this issue be reproducable on a 2004/2005 RC, since it seems to be a problem with IFI's default code? Just some ideas... :) |
Re: Camera does not search in autonomous mode after reset
Quote:
|
Re: Camera does not search in autonomous mode after reset
Quote:
|
Re: Camera does not search in autonomous mode after reset
Quote:
Quote:
Today I developed a test plan involving: using the default frc_camera_2 code, adding camera tracking to autonomous, and instrumenting the camera and tracking initialization variables to show their state on OI lights. My team contact is on the other coast for 2 weeks so I may not be able to arrange test time for a while. Unfortunately our regional is over and we are done for the year. :( Our strategy was heavily weighted towards scoring during autonomous. All the pieces were in place but the camera never worked during autonomous. |
Re: Camera does not search in autonomous mode after reset
Quote:
|
Re: Camera does not search in autonomous mode after reset
Quote:
|
Re: Camera does not search in autonomous mode after reset
Quote:
all of the other lights on the OI. We will label it the "totally screwed" light. It is best to know this condition as early as possible. Sounds like the default action for the switch statement to me... |
Re: Camera does not search in autonomous mode after reset
For the record, I was talking specifically about the camera communications state machine - when I inserted a default to catch the improper 'zero' state, it printed out errors galore.
|
Re: Camera does not search in autonomous mode after reset
Quote:
For all the high school programmers watching out there, creating robust software systems is an important consideration in software design, even in a resource limited machine. I have programmed on much smaller systems than the IFI. Just because you think certain conditions should not happen does not mean that they never will. Quote:
|
Re: Camera does not search in autonomous mode after reset
Quote:
Congratulations on 2nd place. Your alliance buddy Corvalis is one of our neighbors. |
| All times are GMT -5. The time now is 11:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi