-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyoCon.h
45 lines (35 loc) · 1.71 KB
/
MyoCon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef MYOCON_H_
#define MYOCON_H_
#include <myo/myo.hpp>
void move_forward(int speed);
void turn_right(int speed);
void turn_left(int speed);
void move_back(int speed);
class tank_listener : public myo::DeviceListener
{
public:
// These values are set by onArmRecognized() and onArmLost() above.
bool onArm;
myo::Arm whichArm;
// These values are set by onOrientationData() and onPose() above.
int pitch_w, yaw_w;
myo::Pose currentPose;
tank_listener() :
onArm(false), pitch_w(0), yaw_w(0), currentPose() {};
// onUnpair() is called whenever the Myo is disconnected from Myo Connect by the user.
void onUnpair(myo::Myo* myo, uint64_t timestamp);
// onOrientationData() is called whenever the Myo device provides its current orientation, which is represented
// as a unit quaternion.
void onOrientationData(myo::Myo* myo, uint64_t timestamp, const myo::Quaternion<float>& quat);
// onPose() is called whenever the Myo detects that the person wearing it has changed their pose, for example,
// making a fist, or not making a fist anymore.
void onPose(myo::Myo* myo, uint64_t timestamp, myo::Pose pose);
// onArmRecognized() is called whenever Myo has recognized a Sync Gesture after someone has put it on their
// arm. This lets Myo know which arm it's on and which way it's facing.
void onArmRecognized(myo::Myo* myo, uint64_t timestamp, myo::Arm arm, myo::XDirection xDirection);
// onArmLost() is called whenever Myo has detected that it was moved from a stable position on a person's arm after
// it recognized the arm. Typically this happens when someone takes Myo off of their arm, but it can also happen
// when Myo is moved around on the arm.
void onArmLost(myo::Myo* myo, uint64_t timestamp);
};
#endif