MyoLinux
Classes | Typedefs | Enumerations | Variables
myolinux::myo Namespace Reference

Contains the Myo client and auxiliary classes. More...

Classes

class  Client
 Class for communication with the Myo device. More...
 
struct  FwInfo
 Various parameters that may affect the behaviour of this Myo armband. More...
 
struct  FwVersion
 Version information for the Myo firmware. More...
 

Typedefs

using EmgSample = std::array< std::int8_t, 8 >
 EmgSample.
 
using OrientationSample = std::array< std::int16_t, 4 >
 OrientationSample Orientation data, represented as a unit quaternion. More...
 
using AccelerometerSample = std::array< std::int16_t, 3 >
 AccelerometerSample Accelerometer data. More...
 
using GyroscopeSample = std::array< std::int16_t, 3 >
 GyroscopeSample Gyroscope data. More...
 
using Address = gatt::Address
 Address of the device. More...
 
using DisconnectedException = gatt::DisconnectedException
 Exception thrown when the device disconnects. More...
 

Enumerations

enum  EmgMode
 EMG modes. More...
 
enum  ImuMode
 IMU modes. More...
 
enum  ClassifierMode
 Classifier modes. More...
 
enum  SleepMode
 Sleep modes. More...
 
enum  Vibration
 Kinds of vibrations. More...
 

Variables

const std::vector< std::uint8_t > MyoUuid
 UUID of the info service. More...
 
constexpr float OrientationScale = 16384.0f
 Orientation data multiplier, see OrientationSample.
 
constexpr float AccelerometerScale = 2048.0f
 Accelerometer data multiplier, see AccelerometerSample.
 
constexpr float GyroscopeScale = 16.0f
 Gyroscope data multiplier, see GyroscopeSample.
 

Detailed Description

Contains the Myo client and auxiliary classes.

Typedef Documentation

§ AccelerometerSample

using AccelerometerSample = std::array<std::int16_t, 3>

AccelerometerSample Accelerometer data.

In units of g. Range of + -16. Values are multiplied by AccelerometerScale.

§ Address

Address of the device.

The address byte sequence is in network order, so it might be in reverse on your arhitecture. To find the address of your device use the Client::discover method or use the bluetoothctl tool.

§ DisconnectedException

Exception thrown when the device disconnects.

This can happen because of inactivity if the myo::SleepMode is set to Normal (set it to NeverSleep to prevent this) or because the device is sending value events faster than your program is processing them. In the latter case decrease the processing latency or put the myo::Client::listen method in a separate thread.

§ GyroscopeSample

using GyroscopeSample = std::array<std::int16_t, 3>

GyroscopeSample Gyroscope data.

In units of deg/s. Range of + -2000. Values are multiplied by GyroscopeScale.

§ OrientationSample

using OrientationSample = std::array<std::int16_t, 4>

OrientationSample Orientation data, represented as a unit quaternion.

Values are multiplied by OrientationScale.

Enumeration Type Documentation

§ ClassifierMode

enum ClassifierMode
strong

Classifier modes.

Enumerator
Disabled 

Disable and reset the internal state of the onboard classifier.

Enabled 

Send classifier events (poses and arm events).

§ EmgMode

enum EmgMode
strong

EMG modes.

Enumerator
None 

Do not send EMG data.

SendEmg 

Send filtered EMG data.

SendEmgRaw 

Send raw (unfiltered) EMG data.

§ ImuMode

enum ImuMode
strong

IMU modes.

Enumerator
None 

Do not send IMU data or events.

SendData 

Send IMU data streams (accelerometer, gyroscope, and orientation).

SendEvents 

Send motion events detected by the IMU (e.g. taps).

SendAll 

Send both IMU data streams and motion events.

SendRaw 

Send raw IMU data streams.

§ SleepMode

enum SleepMode
strong

Sleep modes.

Enumerator
Normal 

Normal sleep mode; Myo will sleep after a period of inactivity.

NeverSleep 

Never go to sleep.

§ Vibration

enum Vibration
strong

Kinds of vibrations.

Enumerator
None 

Do not vibrate.

Short 

Vibrate for a short amount of time.

Medium 

Vibrate for a medium amount of time.

Long 

Vibrate for a long amount of time.

Variable Documentation

§ MyoUuid

const std::vector<std::uint8_t> MyoUuid
Initial value:
= {
0x42, 0x48, 0x12, 0x4a,
0x7f, 0x2c, 0x48, 0x47,
0xb9, 0xde, 0x04, 0xa9,
0x01, 0x00, 0x06, 0xd5
}

UUID of the info service.

The UUID is used to identify a Myo device when scanning. This string appears at the end of the vendor specific part of the packet.