Log in

View Full Version : GetImage only works when dashboard running?


EnigmaSolution
01-02-2009, 13:01
(This is a cross-post from the official usfirst forum (http://forums.usfirst.org/showthread.php?t=11722), due to low traffic there. I came here soon after I realized that the First forums have low traffic, but unfortunately only after.)

As the title says, I'm having trouble with the vision part of WPILibrary. When I try to get an image from the camera, it times out unless the dashboard is running, receiving camera data.

Has anyone else had this problem? I'm using the GetImage function in the advanced robot framework with nothing but an indicator wired up via a branch inside the loop, and the fact that it works fine when the dashboard is active indicates that it isn't my setup, but something with the robot's interaction with the dashboard that is the culprit.

During competition we can't have the dashboard open, so this is a real problem.

Thanks for any input.

Greg McKaskle
01-02-2009, 13:10
Are you calling Start? The LV frameworks have a way to enable the imaging -- Basic has a local, Advanced has a global I think. Since the dashboard connection also causes the imaging loop to start, it will have the side-effect you are seeing I think.

Anyway, probe or look at the value of the control and I think you will be in business.

Note that depending on when you started, you may want to look at a newer version of the template. The original vision stuff, especially the Basic one was a bit too simple. There is now a subVI used to help call start and stop the right number of times to avoid internal reference counts from going out of control.

Greg McKaskle

EnigmaSolution
01-02-2009, 14:03
That was it! I wasn't running Start before trying to get my images. It makes sense now! Thanks for the help! :o