View Single Post
  #7   Spotlight this post!  
Unread 06-04-2006, 02:59
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Fix for CMU cam initalization code 131 error.

Quote:
Originally Posted by Mark McLeod
It looks like you found a good solution to your problem.
I agree it looks like the specific problem you're seeing is probably because the PIC sends out commands before the camera has time to complete it's power-up sequence.
We also use a generic startup delay in our main loop of a few milliseconds, so the code doesn't attempt to do any sensor I/O or even pay attention to the regular OI communication packet until everything's had a chance to settle.
I had the same problem with WPILib (which is used in EasyC). So WPILib won't send any camera commands until two seconds after power on. This isn't a serious problem since that's the time that the robot is sitting on the field before the match starts. Also, users can initialize everything else before starting the camera and that can often burn up the 2 seconds anyway, then it would start right away.

The library also receives in RAW mode, but always sends commands in ASCII. It didn't seem like a worthwhile optimization, since 99% of what the camera was doing was receiving T-packets, and those were received in binary. That way there was no ambiguity when interrupting the camera and sending commands to it.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute