|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
Has anybody gotten the camera feed and tracking to work in iterative robot?
|
|
#3
|
|||
|
|||
|
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. }; |
|
#4
|
||||
|
||||
|
Re: Camera Declaration/Initialization
put it in the class:
Code:
public yourrobot:public IterativeRobot
{
...
AxisCamera &cam;
public:
yourrobot():
...
cam(AxisCamera::GetInstance())
{ }
....
};
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |