Myo SDK MATLAB MEX Wrapper

Access data from Thalmic Labs' Myo Gesture Control Armband in m-code and Simulink!
3.5K Downloads
Updated 28 Oct 2022

Thalmic Labs' Myo Gesture Control Armband (myo.com) features an Inertial Measurement Unit (IMU) and 8 surface Electromyography sensors (sEMG) in addition to a Windows SDK that allows developers to obtain access to this data!
Check out this Preview video on YouTube to see what this package can do,
https://youtu.be/pPh306IgEDo

On the surface, this package contains a simplified m-code class, MyoMex, that enables MATLAB users to stream data from one or two Myo devices at 50Hz (IMU and meta data) and 200Hz (EMG) with only 1 command! Note that EMG data is not available when using two devices due to hardware/software limitations.

mm = MyoMex(); % Upon construction, MyoMex starts accumulating streaming data in its myoData property
m = mm.myoData; % get MyoData object
% Data is now being pushed into log properties of m named,
% quat_log, gyro_log, accel_log, emg_log, etc.
% Data acquisition is non-blocking, too!
mm.delete(); % clean up

The IMU data includes estimated quaternion (orientation), three-axis gyroscope (angular velocity), and three-axis accelerometer (linear acceleration).

The sEMG data includes 8 raw data channels plus the output of Myo's built-in gesture detection.

Here are some of the things that you'll find in this package,

* README.txt - Step-by-step instructions for prerequisite configuration
* install_myo_mex() - installation tool
* build_myo_mex() - MEX-file build tool
* MyoMex_Quickstart - Quickstart guide script with example code and liberal comments
* MyoMexGUI_Monitor - GUI implementation of streaming data with visualization of all available data

New Simulink support includes MEX C/C++ S-Function block and other supporting utility blocks that support two following configurations:

* One Myo - EMG disabled
* One Myo - EMG enabled
* Two Myos - EMG disabled

The Simulink block data outputs mirror the data available from MyoData in m-code. The data is streamed in soft real-time. Thus, Simulink Desktop Real-Time is required to synchronize the model with the system clock.

This is being developed on one machine configuration: MATLAB R2013a; Windows 7 64-bit; VS2012 Pro

Comment and rate below! If you have questions, I answer messages pretty quickly.

You can also email me or send a message through my profile here,
mark (at) mark-toma (dot) com | marktoma (at) buffalo (dot) edu

I'll also stay current with the repo on GitHub,
https://github.com/mark-toma/MyoMex

There's a post about this package at Thalmic Labs' Developer Forums,
https://developer.thalmic.com/forums/topic/2940/

Cite As

Mark Tomaszewski (2024). Myo SDK MATLAB MEX Wrapper (https://github.com/mark-toma/MyoMex), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Simulation in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
3.0.0.0

NEW support for Myo in Simulink! This is new and is not well tested. The current solution requires some sort of soft real time synchronization, hence the Simulink Desktop Real-Time requirement.

2.5.0.0

Fixes garbled code due to GitHub misuse. Otherwise same logic as v2.4.

2.4.0.0

Fixes a bunch of problems with using multiple Myos

2.3.0.0

This is the *real* v2.3!
Fixes bug with timeEMG property values

2.2.0.0

added link to preview video on youtube
Quick revision to fix some bugs in GUIs; Added rateXXX properties to check estimated data rates

2.1.0.0

Disabled EMG when using two Myos (hardware/software limitations); Added newDataFcn callbacks to MyoMex and MyoData; Added example directory with one script for testing data for corruption.

2.0.0.0

Unchanged the title after GitHub transition
Added links to description; changed name to include "MATLAB" so Google might like it more.
Major rewrite to add support for multiple Myos and full EMG sample rate; Transitioned to GitHub repo for future maintenance

1.1.0.0

Some new features in MyoMex (no changes to myo_mex) and a slew of modifications to the example GUI. The myo_mex build has also been tested successfully with Visual Studio 2012 Professional.

1.0.0.0

Inserted two newlines this time.
Removed binary MEX file (in accordance with community guidelines) and updated requirements to reflect need for compiler.
description formatting

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.