Go to Post I think candids are my best... I'm sneaky with my 12X optical zoom. - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-02-2012, 20:04
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 671
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Issues connecting cRIO 2 with Camera

Quote:
Originally Posted by DjScribbles View Post
Be sure you are calling AxisCamera::GetInstance each time you go through the function it's used in (as apposed to getting the pointer to it and saving it in a attribute during init), because the CRIO boots faster than the camera, and (I believe) you need to call the get instance after the camera is booted (green lights).
Are you sure about this? According to the source code of AxisCamera.cpp, GetInstance will just instantiate the AxisCamera class if it's not already done so. And the constructor of AxisCamera is just creating a semaphore, creating a camera task and starting it. The camera task is a forever loop reading images from the camera. If the camera is not ready, it will sleep for 1 second before trying again. Regardless of whether the camera is ready or not, GetInstance() will give you a pointer to the camera object. So I don't see why I cannot save the camera pointer instead of having to call GetInstance() over and over again.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2012, 03:03
matthewfl matthewfl is offline
Registered User
FRC #0687 (Nerd Herd)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2003
Location: CA
Posts: 7
matthewfl is an unknown quantity at this point
Re: Issues connecting cRIO 2 with Camera

I have been going through some of the WPILib source code as well, and I believe that the GetInstance returns the same camera object the whole time.

As far as code goes, the relevant camera lines are:
AxisCamera &camera = AxisCamera::GetInstance("10.06.87.11");
HSLImage *image = new HSLImage();
// this inside the loop
cout << camera.GetImage(image) << endl; // This prints out 0 meaning that no image was returned.

I think what I am basically asking are other teams having similar problems, have you fixed it and how. (We have been working on this for over a week now with no image coming through on the dashboard or the cRIO getting any note of the camera being there, the best that we got is we can ping the camera from the cRIO)
__________________
BE A NERD!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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