Log in

View Full Version : Axis Camera help!


Lawlhwut
19-01-2012, 00:25
When declaring the axis camera in our program, what do we put in the paranthesis?

class RobotDemo : public SimpleRobot
{
RobotDrive myRobot;
AxisCamera axis;
Joystick stick;

public:
RobotDemo(void):
myRobot(1,2),
axis(???????????????????????????????)
stick(1)...

What do I put in the ????????????????????? And to take a picture, do I just need axis.GetInstance, axis.GetImage? We need the image for particle analysis.

scottbot95
19-01-2012, 01:10
You cannot do it that way. When you need to access the camera you have something like this:
AxisCamera &camera = AxisCamera::GetInstance();

Lawlhwut
19-01-2012, 01:27
Then how would I do functions with the camera? For instancec if I want to do WriteResolution(640,480) or GetImage()?

Lawlhwut
19-01-2012, 01:35
Also, which header files do we use?

scottbot95
19-01-2012, 01:35
camera.WriteResolution(blah);
Image *image = camera.GetImage();
Make sure when getting an image you call IsFreshImage() first; it will save you some processing.

scottbot95
19-01-2012, 01:37
So far, I haven't noticed anything we need that isn't included in WPILib.h