Hey all, I’m the student programmer who wrote this code along with mentors. Unfortunately, I’m away at college right now so I can’t be around to help.
I just wanted to add the following to the discussion, based on my knowledge of the code:
The code for operating the turret is called within the thread that houses steering and driving, so its entirely possible some lack of feedback is causing this thread to crash. The camera control is on its own thread, but there’s no real way to check if this is thread is in flight at the moment, due to the way the multithreading environment is laid out in the code. What you can do is change lines 1981-1984 in the code, which currently looks like:
if ( bPressed_SnapshotButton )
{
m_bRequestSnapshot = true;
}
to something that will take images all the time. You can tie this to the timer code that’s already implemented, or for a quick (and quite ugly) solution you can have the camera take images as fast as it can (about 30 fps), with
if ( CameraInitialized )
{
m_bRequestSnapshot = true;
}
and then check the drive via ftp for the image files it drops.
Another thing I would suggest is to check the log file. To do this, uncomment line 56:
//#define USE_LOG_FILE
Then, use ftp to examine the log file on the run for “Start Competition” line, the “Alliance Selection” lines, and the “Loaded Steering Config:” lines. This should give you a hint as to where the code is crashing. Also, make sure no errors come up.
I would consider some of the other suggestions here as well, definitely double check electronics. Its entirely possible something died somewhere along the line.
Anyway, I’m posting here in the hopes that this information will be of help to everyone that’s helping the team. Thanks to everyone who’s posted advice.
I’ll try to keep tabs on this thread and supply any other information if requested.
Thanks,
Bryan Cheng