Go to Post No way thats Dean... he didn't give an hour long speech :p - AndyB [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 21-02-2010, 09:20
scolbertrocks scolbertrocks is offline
Registered User
FRC #1025
 
Join Date: Feb 2010
Location: Ferndale, MI
Posts: 2
scolbertrocks is an unknown quantity at this point
Camera Declaration/Initialization

I know there are lots of threads on the camera, but i havn't seen any on this topic specifically.
I'm just wondering how to declare/initalize the camera in an Iterative Robot based program.
Because (correct me if im wrong) you have to use AxisCamera &camera = AxisCamera::GetInstance(), the &camera is a reference, and MUST be initialized when it is declared.
If i put this line of code in the constructor, or TeleopInit, the reference can't be accessed in any other function.
If i put it in TeleopPeriodic, I will be able to access the camera reference where i need it, but it will be inneficiently called every loop

What is the best, or atleast a working way to get a working variable/reference of the camera that i can access in TeleopPeriodic for tracking?
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2010, 11:42
scolbertrocks scolbertrocks is offline
Registered User
FRC #1025
 
Join Date: Feb 2010
Location: Ferndale, MI
Posts: 2
scolbertrocks is an unknown quantity at this point
Exclamation Re: Camera Declaration/Initialization

Has anybody gotten the camera feed and tracking to work in iterative robot?
Reply With Quote
  #3   Spotlight this post!  
Unread 22-02-2010, 00:05
mandrews281 mandrews281 is offline
Registered User
FRC #0281
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Greenville SC
Posts: 82
mandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to behold
Re: Camera Declaration/Initialization

Yes. We resorted to a global variable so above our robot declaration we have:

AxisCamera &g_camera = AxisCamera::GetInstance();

class Robot281: public IterativeRobot {
etc.
};
__________________
Michael Andrews
Team #281 Programming Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 22-02-2010, 07:26
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Camera Declaration/Initialization

put it in the class:
Code:
public yourrobot:public IterativeRobot
{
...
     AxisCamera &cam;
public:
    yourrobot():
...
      cam(AxisCamera::GetInstance())
      { }

....
};
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Declaration Window - Check Team in Code DtD C/C++ 3 20-01-2009 07:09
???Abnormal Camera Initialization???????????? cdennisxlx2 Programming 4 07-11-2006 00:45
Routine declaration syntax error (Or: Where's wlado?) Astronouth7303 Programming 15 24-03-2004 05:51
Reciever Initialization problem PuiChi Programming 1 26-01-2004 23:54
Master uP Initialization Routine Ulibrium Technical Discussion 5 24-01-2002 16:43


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

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