View Single Post
  #10   Spotlight this post!  
Unread 19-01-2012, 01:33
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Vision Tracking With Color

Quote:
Originally Posted by Lawlhwut View Post
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.
Reply With Quote