View Single Post
  #3   Spotlight this post!  
Unread 03-03-2014, 12:54
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: cRIO boots before Camera

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:

Code:
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.
Reply With Quote