Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Axis camera setup problem (http://www.chiefdelphi.com/forums/showthread.php?t=89649)

gyroscopeRaptor 20-01-2011 13:23

Axis camera setup problem
 
Team was setting up camera today. We have it configured through the cRIO. When browsing to the camera's IP address while it is connected via ethernet, the camera displays on the page. Then, when we switch to the driver account, we connect it through the cRIO and it displays a white screen on the camera area of the driver panel. cRIO is formatted for c++.

How do we make it actually display video on the driver panel?

mikets 20-01-2011 13:33

Re: Axis camera setup problem
 
Did you include the DashboardDataFormat.cpp/.h code from the examples? You need to include them and it has a function sendVisionData() (or something similar, this is from my memory) that you need to call in your robot loop so it will send the camera data to the dashboard app.

basicxman 20-01-2011 13:36

Re: Axis camera setup problem
 
Quote:

Originally Posted by gyroscopeRaptor (Post 1004304)
How do we make it actually display video on the driver panel?

If you take a look at the 2010 Camera Tracking example included in your WindRiver installation, you'll see some camera code.

You basically need to do a few things,
Code:

// In your constructor
AxisCamera &camera = AxisCamera::GetInstance();
camera.WriteResolution(CAMERA_RESOLUTION);
camera.WriteCompression(CAMERA_COMPRESSION);
camera.WriteBrightness(CAMERA_BRIGHTNESS);
camera.WriteMaxFPS(CAMERA_MAX_FPS);
camera.WriteExposureControl(CAMERA_EXPOSURE);
camera.WriteWhiteBalance(CAMERA_WHITE_BALANCE);

// When you want to display a new image.
if (camera.IsFreshImage()) {
  HSLImage *image = camera.GetImage();
}

You can find more sample code at https://github.com/MMRambotics/RetroreflectiveTracking.

gyroscopeRaptor 20-01-2011 14:16

Re: Axis camera setup problem
 
Would these solutions work for the new axis M1011 camera?

EdenA 24-01-2011 03:33

Re: Axis camera setup problem
 
Quote:

Originally Posted by gyroscopeRaptor (Post 1004343)
Would these solutions work for the new axis M1011 camera?

From my experience with the new camera, WPI lib does not have support this year to change the parameters in the code (WPI lib is that bad this year). that means, you need to adjust the camera parameters by using the camera's web interface, and you won't be able to modify them during the match. In fact, the only way I've been able to stream images with the new camera without causing some sort of cataclysmic crash is by contenting myself with just one line of code:

Code:

AxisCamera &camera = AxisCamera::GetInstance();

Greg McKaskle 24-01-2011 07:48

Re: Axis camera setup problem
 
I suspect the problem is related to changing parameters while a MJPG stream is underway. There is apparently some code that doesn't deal appropriately with the camera returning an error and no image, and that results in a bad pointer reference.

Hopefully the error handling will be improved, but you may be able to use the API just fine by stopping the MPEG stream, changing the params, and starting it up again.

Greg McKaskle

mandrews281 12-02-2011 09:58

Re: Axis camera setup problem
 
We are having similar data access crashes with our M1011 camera. There appears to be a good information in the RobotPy thread on the same problem:

http://www.chiefdelphi.com/forums/sh...ad.php?t=90687

There is a potential patch up at WPIforge and will require some expertise to re-build the WPILib. I guess I know what I'll be doing at our shop this afternoon.


All times are GMT -5. The time now is 13:00.

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