Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Camera Slowing code down? (http://www.chiefdelphi.com/forums/showthread.php?t=73490)

Maxpower57 02-02-2009 19:03

Camera Slowing code down?
 
So, i have the camera running the following code:
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

EricWilliams 02-02-2009 19:09

Re: Camera Slowing code down?
 
We are having similar issues. http://www.chiefdelphi.com/forums/sh...ad.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.

Maxpower57 02-02-2009 19:11

Re: Camera Slowing code down?
 
Quote:

Originally Posted by Ewilliams2006 (Post 813007)
We are having similar issues. http://www.chiefdelphi.com/forums/sh...ad.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?

Maxpower57 02-02-2009 20:00

Re: Camera Slowing code down?
 
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:

Joe Ross 02-02-2009 20:57

Re: Camera Slowing code down?
 
Quote:

Originally Posted by Maxpower57 (Post 813032)
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.

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.


All times are GMT -5. The time now is 02:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi