Quote:
Originally Posted by Lawlhwut
Quick question, how do I initialize the axis camera after delcaring it with "AxisCamera axis;"
|
Since it's a singleton and the get function returns a reference, you need to declare it as "AxisCamera& axis;"
Then, you use the GetInstance method in the initialization list.
Code:
class MyRobot : public SimpleRobot {
AxisCamera& axis;
public:
MyRobot()
: axis(AxisCamera::GetInstance(/*ipaddress*/))
{
// Constructor stuff
}
// rest of class
};
Alternatively, you could just call GetInstance whenever you want to call the AxisCamera methods and not have an instance variable for it at all.