You can become a serverless blackbelt. Enrol in my course Learn you some Lambda best practice for great good! and learn best practices for performance, cost, security, resilience, observability and scalability. By the end of this course, you should be able to make informed decisions on which AWS service to use with Lambda and how to build highly scalable, resilient and cost efficient serverless applications.
It’s been a long wait but I have finally got my hands on a Myo armband this week!
To start, you need to download and install Myo Connect from here. You need to go through the set up guide, which includes teaching the Myo armband how to classify the EMG readings from your arm to one of five recognized posture patterns:
It works well out of the box. Despite being a SDK unit, it’s able to interface with some applications such as PowerPoint and iTunes. Its scripting capability makes it easy to add support for other applications (more on this later).
The pattern detection can feel laggy – only by a fraction of a second but noticeable when you’re trying to play a game for instance. The accuracy of the pattern detection is not quite there yet either.
But both issues will improve over time as better firmware becomes available. The guys at Thalmic Labs will also fine tunes their math model with more data from real world usages.
So don’t let these temporary shortcoming hold you back from buying a Myo armband. (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 setup and running you will no doubt be itching to program against this wonderful piece of device.
The SDK allows you to write application to take full advantage of the Myo’s capabilities using C or C++.
Or, you can write Lua scripts to control applications using Myo. This allows you to map postures to keyboard or mouse signals (key up/down/press, mouse click, mouse movement, etc.). This approach has limitations – for instance, you can’t pass rotation information into a flight simulation program via keyboard and mouse signals alone. That said, there’s still plenty you can do with Lua scripts.
To run Lua scripts, you need to make sure Myo Connect is running (you’ll see it on your taskbar in Windows):
Right-clicking on the Myo Connect icon gives you the option to open the Myo Script Manager where you are able to load your Lua scripts.
This is how the Canvas blank.lua script you see above look in its full glory.
There are couple of things to note about this script:
- the scriptId variable specifies a unique ID for your script
- the onForegroundWindowChange function defines a callback function. Myo Connect will call this function when the active application changes. Our function specifies that the script should become active when you load the Canvas Blank mini game. It also allows the Myo to control mouse movement when that happens so that we can aim with our arm.
- the onPoseEdge function also defines a callback function. Myo Connect will call this function when a posture pattern turns on or off. Here we specify that a fist posture maps to a mouse left-click, and a fingersSpread posture maps to moving the mouse to the centre of the primary display.
It was straight forward to get the Myo armband working with Canvas Blank. But the playing experience is far from satisfactory due to the following reasons:
- the lag and imprecise posture recognition
- Myo’s mouse movement control is not smooth enough. Coupled with an occasional lag it breaks the sense of immersion (and makes me miss an awful lot!)
- Posturing causes small movements in your arm. It is often enough to cause the mouse to move, another reason for my many misses…
Based on what I’ve seen so far, I’d say that Myo is not ready for applications that need good precision control yet. FPS games are probably out of the question for now.
Again, this is an area where I expect things to improve soon. Perhaps even by the time you see the final commercial unit (they’re shipping the first batches of SDK units right now).
What shouldn’t be underestimated, is how easy it was for me to integrate with the Myo via Lua scripts. In fact, it’s so easy that you don’t even have to be an experienced programmer to make it work.
To unlock the full potential of the Myo you need to fall back to the SDK. For now, it means developing your application in C/C++, but other language bindings should become available soon.
- SDK reference
- Getting started with Myo Scripts part 1, 2, 3, 4, 5, 6
- Myo user experience design guidelines
I specialise in rapidly transitioning teams to serverless and building production-ready services on AWS.
Are you struggling with serverless or need guidance on best practices? Do you want someone to review your architecture and help you avoid costly mistakes down the line? Whatever the case, I’m here to help.
Check out my new podcast Real-World Serverless where I talk with engineers who are building amazing things with serverless technologies and discuss the real-world use cases and challenges they face. If you’re interested in what people are actually doing with serverless and what it’s really like to be working with serverless day-to-day, then this is the podcast for you.
Check out my new course, Learn you some Lambda best practice for great good! In this course, you will learn best practices for working with AWS Lambda in terms of performance, cost, security, scalability, resilience and observability. We will also cover latest features from re:Invent 2019 such as Provisioned Concurrency and Lambda Destinations. Enrol now and start learning!
Check out my video course, Complete Guide to AWS Step Functions. In this course, we’ll cover everything you need to know to use AWS Step Functions service effectively. There is something for everyone from beginners to more advanced users looking for design patterns and best practices. Enrol now and start learning!
Are you working with Serverless and looking for expert training to level-up your skills? Or are you looking for a solid foundation to start from? Look no further, register for my Production-Ready Serverless workshop to learn how to build production-grade Serverless applications!
Here is a complete list of all my posts on serverless and AWS Lambda. In the meantime, here are a few of my most popular blog posts.
- Lambda optimization tip – enable HTTP keep-alive
- You are wrong about serverless and vendor lock-in
- You are thinking about serverless costs all wrong
- Just how expensive is the full AWS SDK?
- Many faced threats to Serverless security
- We can do better than percentile latencies
- Yubl’s road to Serverless
- AWS Lambda – should you have few monolithic functions or many single-purposed functions?
- AWS Lambda – compare coldstart time with different languages, memory and code sizes
- Guys, we’re doing pagination wrong
- Top 10 Serverless framework best practices