Camera Instance Problem

We are working on trying to get the Camera to work in Windriver C++ I have gone through and it seems our problem is different then others.

DS Version: 2010.01.06.00 (which is update 2 I can see the Gyro Dial on dashboard)
cRIO Image: C-2010_v19

I have included #include “Vision/AxisCamera.h” at the beginning of code.
Followed the instructions on page 58 of 2-2010FRCControl%20System-Getting%20Started-Rev-0.7.pdf

Our problem is when we make an instance of AxisCamera using the following code we get communication to the driver station but says “No Robot Code”. If I comment out the GetInstance() line it everything runs perfect.


		//printf("Getting camera instance
");
		AxisCamera &camera = AxisCamera::GetInstance();
		//printf("Setting camera parameters
");
		//camera.WriteResolution(AxisCamera::kResolution_320x240);
		//camera.WriteCompression(20);
		//camera.WriteBrightness(0);
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();

Note: I have no other vision code in the code except for what is shown and the include statement at beginning.
We have updated Windriver to “C/C++ Team Update 4.2 2/8/2010”

check the council out it should give you some indication as to whats going on.

you might also want to give the camera some time to boot before you try doing anything with it (once you get this code working that is)

Unresolved Symbols List:
AxisCamera::GetInstance()

is the message I’m getting. . I have tried to put a Wait in front of the GetInstance and everything I try I get the same results. . .

attached is the actual error window

cameraError.png


cameraError.png

Unresolved symbol means (in this case) that the code implementing the function call (AxisCamera::GetInstance()) is missing (from the WPILib library).

Is this with the most recent WPILib C++ update (02-08)?
We have this problem too, it seems the latest update has some issues in this regard.

See this thread on the official usfirst.org forums for the problem report and description, as well as a workaround, and hopefully an announcement of an updated release in the near future:
http://forums.usfirst.org/showthread.php?t=14573

Called NI and they were unaware of any new Library errors . . . They wanted me to change to Labview and download the Labview default code on while I was on Hold. . . .
Did that and everything worked great. .

So there is forsure yet another error in the WPI Default Code/Library by the sounds of things and comments from other teams

Seriously considering just switching back to Labview. . . . We did Labview last year but grew to like Windriver in the off season.

Those working on the issue seem to think it’s a compiler (or perhaps linker) bug that is being brought out by the particular contents of the library. There are workarounds (as mentioned in the thread you linked to), and there will likely be an update that makes the bug stop surfacing.

That’s odd, considering I took the stock WR suite and built the stock WPILib sources (to produce the workaround lib image linked above).

Do you have more details on said bug?

Any idea when the new library will come out?
I removed all of our code that uses DriverStationLCD and we still had the problem.

I am having that problem too. I installed the update (4.2) to fix my DashboardLCD which worked great but it broke the camera. I removed the camera references and I am good.

I updated the thread we were on so I was hoping that Brad might have seen it.

Right now with all the camera problems it is “dead to me” so I am good. :slight_smile:

I am planning on using Gyro directions for targetting. More reliable.

If the camera ever gets fixed I may go back but I am working very hard not to.

did you try rebuilding? [right click project]>Rebuild