25 #ifndef S_LEAPMOTION_H 26 #define S_LEAPMOTION_H 28 #include <scolPlugin.h> 29 #include <boost/thread/thread.hpp> 30 #include <boost/bind.hpp> 33 #include <myo/myo.hpp> 44 Quaternion<float> quat;
52 pose = Pose(myo::Pose::unknown);
73 Quaternion<float> mPrevQuat;
74 XDirection mDirection;
90 myo::Myo* GetMyoInstance();
91 void SetMyoInstance(myo::Myo* myoInstance);
92 void SetDirection(XDirection direction);
93 XDirection GetDirection();
94 void Vibrate(myo::Myo::VibrationType type);
95 void SendPose(myo::Pose pose);
96 void SendOrientation(myo::Quaternion<float> quat);
97 void SendAccel(myo::Vector3<float> vec);
109 typedef std::set<SMyo*> MyoList;
110 typedef std::set<myo::Myo*> MyoAvailables;
117 boost::thread mThread;
118 boost::shared_mutex mMutex;
121 MyoAvailables mMyoAvailable;
127 SMyo* AddMyoInstance();
128 void RemoveMyoInstance(
SMyo* myoInstance);
132 virtual void onPair (Myo *
myo, uint64_t timestamp, FirmwareVersion firmwareVersion);
133 virtual void onConnect (Myo *myo, uint64_t timestamp, FirmwareVersion firmwareVersion);
134 virtual void onDisconnect (Myo *myo, uint64_t timestamp);
135 virtual void onPose (Myo *myo, uint64_t timestamp, Pose pose);
136 virtual void onOrientationData (Myo *myo, uint64_t timestamp,
const Quaternion<float> &rotation);
137 virtual void onAccelerometerData (Myo *myo, uint64_t timestamp,
const Vector3<float> &accel);
138 virtual void onGyroscopeData (Myo *myo, uint64_t timestamp,
const Vector3<float> &gyro);
139 virtual void onRssi (Myo *myo, uint64_t timestamp, int8_t rssi);
140 virtual void onArmSync(Myo* myo, uint64_t timestamp, Arm arm, XDirection xDirection);
141 virtual void onArmUnsync(Myo* myo, uint64_t timestamp);
142 virtual void onUnlock(Myo* myo, uint64_t timestamp);
143 virtual void onLock(Myo* myo, uint64_t timestamp);