Log in

View Full Version : Reinstall of dashboard doesn't fix camera image streaming


ellisk
19-01-2010, 17:44
I'm trying to get the camera to stream images to the dashboard. Currently, this is what happens:

The code (in C++) looks like this:

printf("in operator control\n");
GetWatchdog().SetEnabled(false);
AxisCamera &camera = AxisCamera::getInstance();
camera.writeResolution(k320x240);
camera.writeBrightness(0);
printf("Done with camera\n");
Wait(3.0);
printf("done waiting\n");

which is at the top of Operator Control. The IP address of the dashboard machine is 10.15.40.5. I have updated the cRIO and also installed the LabView and dashboard updates, as well as the missing DLL.

When I run the code, I get, in the console:

in operator control
task 0x1de16ff0 (FRC_cameraTask) deleted: errno=0 (0) status=0 (0)
Done with camera
done waiting


After looking at the thread at http://www.chiefdelphi.com/forums/showthread.php?t=79935&page=3&highlight=camera I uninstalled and then reinstalled the driver station update. This did not resolve my problem.

I can ping the camera from the cRIO's command prompt and I set up the camera using the "Setup Axis Camera" tool.

When I run the program and look at the dashboard, all that I see for the camera is a white screen.

Does anyone have any ideas why it isn't working?

Thanks.

ellisk
19-01-2010, 18:35
I got it working. The problem, I think, was that I wasn't giving the camera enough time to boot up. A Wait() at the start, or just waiting for the cRIO a while after booting, fixes this.

Greg McKaskle
20-01-2010, 08:04
Ah. I saw this with a C team last year. If the cRIO boots faster than the camera, you can have the cRIO start pestering the camera for images. The camera is still in the process of booting, and has to spend time processing the images and returning errors. Doing this, meant that the camera wasn't finished booting for ~90 seconds. The solution is to slow down the camera task, especially in the error case. If you don't receive an image from the camera, or on a specific error, sleep for 250 or 500 ms before asking again.

Ideally this would be put into WPILib.

Greg McKaskle