Camera Slowing code down?

So, i have the camera running the following code:

if(FindColor(GREEN, &par)){
printf("Particle Found");
}

Fairly simple, and works. however running this causes the code to slow down to around 1 execution every 3 seconds. (obviously Incredibly slow)

Im Using the IterativeRobot class to run the robot
yes, i have started the camera task.
the robot is running v11 of the CRIO image, and WPI is 3.0

I’ve tried:
Running the camera in a seperate task

  • this causes the camera tasks to run at full speed, but the rest of the robot code runs at the incredibly slow speed.

let me know any ideas of whats going wrong

We are having similar issues. http://www.chiefdelphi.com/forums/showthread.php?t=73447

The first thing you should try is dropping the camera image to 160x120 pixels. That should speed it up a bit, but its still dreadfully slow.

Thats already the resolution.
i fear i may have to create a new task for the rest of the robot code as well,
but then it may be faster to just use the SimpleRobot class. :confused:

anybody have any other ideas?

Ok I got it.
When the documentation says the Wait(5); function waits for 5 milliseconds, it means seconds. (this happens with the timer->Get() too btw) take out this line.

ah, thank you wpilib. :rolleyes:

Update 2 changed the default to seconds (and was noted in the release notes). Looking at the documentation from C++ update 3, I don’t see any references to milliseconds. If you are looking at the latest documentation and see something that is wrong, you should post on the FIRST forums so that it can be corrected.