Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Camera using IterativeRobot class (http://www.chiefdelphi.com/forums/showthread.php?t=80944)

Steve Warner 23-01-2010 14:23

Camera using IterativeRobot class
 
Has anybody converted the 2010 Image Demo from the SimpleRobot class to the IterativeRobot class? How did you define the camera so it's not local to only the function it's defined in and therefore lost between iterations? The AxisCamera class seems to work differently from all the other WPILib classes.

Steve Warner 23-01-2010 17:49

Re: Camera using IterativeRobot class
 
I think I have an answer to my own question if anyone is interested. The line

AxisCamera &camera = AxisCamera::getInstance

can be put into a function and called repeatedly. The first time it's called it creates a pointer to the camera object and starts the camera app. After that it just returns the same pointer. Seems to works okay.

Mr. Lim 24-01-2010 21:47

Re: Camera using IterativeRobot class
 
Quote:

Originally Posted by Steve Warner (Post 905292)
Has anybody converted the 2010 Image Demo from the SimpleRobot class to the IterativeRobot class? How did you define the camera so it's not local to only the function it's defined in and therefore lost between iterations? The AxisCamera class seems to work differently from all the other WPILib classes.

Declare a pointer in your IterativeRobot class:

Code:

AxisCamera * camera;
Then in your IterativeRobot constructor call:

Code:

camera = &(AxisCamera::GetInstance());
Use the dereference arrow -> instead of periods when calling camera methods.

Code above is from memory, so it may not work if you cut/paste, but hopefully it will help!


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

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