View Full Version : cRIO boots before Camera
DDSLoan96
18-02-2014, 09:35
We have been having an issue with the camera where the camera doesnt finish booting until after the cRIO does and it fills our driverstation log with errors because of this. Anything we can do to fix this?
AlexBrinister
03-03-2014, 09:58
Does the camera's slow start affect your robot in any other way?
Alex Brinister
DjScribbles
03-03-2014, 12:54
I'm not 100% sure if this is your exact problem, but in reviewing my 2012 camera code, I noticed that I explicitly avoid getting an instance of the camera (i.e. connecting) in a constructor.
I use the following function to get a pointer to the camera whenever I want to use it:
AxisCamera *Camera::GetCamera()
{
static AxisCamera *camera = (AxisCamera *) 0;
if (camera == (AxisCamera *) 0)
{
AxisCamera &camRef = AxisCamera::GetInstance("10.24.74.11");
camera = &camRef;
}
return camera;
}
This way, you don't try to connect to the camera until the first time you use it.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.