Myo – First day of happy hacking!

It’s been a long wait but I have final­ly got my hands on a Myo arm­band this week!

2014-10-24 20.35.09

 

To start, you need to down­load and install Myo Con­nect from here. You need to go through the set up guide, which includes teach­ing the Myo arm­band how to clas­si­fy the EMG read­ings from your arm to one of five rec­og­nized pos­ture pat­terns:

image

It works well out of the box. Despite being a SDK unit, it’s able to inter­face with some appli­ca­tions such as Pow­er­Point and iTunes. Its script­ing capa­bil­i­ty makes it easy to add sup­port for oth­er appli­ca­tions (more on this lat­er).

The pat­tern detec­tion can feel lag­gy – only by a frac­tion of a sec­ond but notice­able when you’re try­ing to play a game for instance. The accu­ra­cy of the pat­tern detec­tion is not quite there yet either.

But both issues will improve over time as bet­ter firmware becomes avail­able. The guys at Thalmic Labs will also fine tunes their math mod­el with more data from real world usages.

So don’t let these tem­po­rary short­com­ing hold you back from buy­ing a Myo arm­band. (You might want to keep it out of the reach of your pets though, as mine tried to attack and take a bite out of it as soon as I took it off)

 

Programming your Myo

Once everything’s set­up and run­ning you will no doubt be itch­ing to pro­gram against this won­der­ful piece of device.

The SDK allows you to write appli­ca­tion to take full advan­tage of the Myo’s capa­bil­i­ties using C or C++.

sdk-stack.png

Or, you can write Lua scripts to con­trol appli­ca­tions using Myo. This allows you to map pos­tures to key­board or mouse sig­nals (key up/down/press, mouse click, mouse move­ment, etc.). This approach has lim­i­ta­tions – for instance, you can’t pass rota­tion infor­ma­tion into a flight sim­u­la­tion pro­gram via key­board and mouse sig­nals alone. That said, there’s still plen­ty you can do with Lua scripts.

 

Lua Scripts

To run Lua scripts, you need to make sure Myo Con­nect is run­ning (you’ll see it on your taskbar in Win­dows):

Image

Right-click­ing on the Myo Con­nect icon gives you the option to open the Myo Script Man­ag­er where you are able to load your Lua scripts.

image

This is how the Can­vas blank.lua script you see above look in its full glo­ry.

There are cou­ple of things to note about this script:

  1. the scrip­tId vari­able spec­i­fies a unique ID for your script
  2. the onFore­ground­Win­dow­Change func­tion defines a call­back func­tion. Myo Con­nect will call this func­tion when the active appli­ca­tion changes. Our func­tion spec­i­fies that the script should become active when you load the Can­vas Blank mini game. It also allows the Myo to con­trol mouse move­ment when that hap­pens so that we can aim with our arm.
  3. the onPoseEdge func­tion also defines a call­back func­tion. Myo Con­nect will call this func­tion when a pos­ture pat­tern turns on or off. Here we spec­i­fy that a fist pos­ture maps to a mouse left-click, and a fin­gersSpread pos­ture maps to mov­ing the mouse to the cen­tre of the pri­ma­ry dis­play.

 

It was straight for­ward to get the Myo arm­band work­ing with Can­vas Blank. But the play­ing expe­ri­ence is far from sat­is­fac­to­ry due to the fol­low­ing rea­sons:

  • the lag and impre­cise pos­ture recog­ni­tion
  • Myo’s mouse move­ment con­trol is not smooth enough. Cou­pled with an occa­sion­al lag it breaks the sense of immer­sion (and makes me miss an awful lot!)
  • Pos­tur­ing caus­es small move­ments in your arm. It is often enough to cause the mouse to move, anoth­er rea­son for my many miss­es…

 

Based on what I’ve seen so far, I’d say that Myo is not ready for appli­ca­tions that need good pre­ci­sion con­trol yet. FPS games are prob­a­bly out of the ques­tion for now.

Again, this is an area where I expect things to improve soon. Per­haps even by the time you see the final com­mer­cial unit (they’re ship­ping the first batch­es of SDK units right now).

What shouldn’t be under­es­ti­mat­ed, is how easy it was for me to inte­grate with the Myo via Lua scripts. In fact, it’s so easy that you don’t even have to be an expe­ri­enced pro­gram­mer to make it work.

To unlock the full poten­tial of the Myo you need to fall back to the SDK. For now, it means devel­op­ing your appli­ca­tion in C/C++, but oth­er lan­guage bind­ings should become avail­able soon.

 

Useful Links