Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MyoJS. From gesture to code - TopConf Tallinn 2016

MyoJS. From gesture to code - TopConf Tallinn 2016

The Myo armband measures the electrical activity from your muscles to detect what gesture your hand is making. It also senses all of the motions and rotations of your hand and forearm.

The talk is about the Javascript library which allows to detect gestures and make web applications based on hand motions.

Alex Canessa

November 16, 2016
Tweet

More Decks by Alex Canessa

Other Decks in Programming

Transcript

  1. @alexcanessa MyoJS - TopConf Tallinn 2016 @alexcanessa Italian full-stack dev

    living in London co-founder of bisquits working at DigitalDetox
  2. @alexcanessa MyoJS - TopConf Tallinn 2016 A bit of history

    Historical Development of Hand Gesture Recognition
  3. @alexcanessa MyoJS - TopConf Tallinn 2016 Electromyography (EMG) is an

    electrodiagnostic technique for evaluating and recording the electrical activity produced by skeletal muscles. EMG
  4. @alexcanessa MyoJS - TopConf Tallinn 2016 Gestures and motions Double

    Tap Fist Spread Fingers Wave In Wave Out Rotate Move
  5. @alexcanessa MyoJS - TopConf Tallinn 2016 import Myo from 'myo';

    Myo.connect(‘com.acanessa.myApp’); Myo.on('connected', function() { // this is the myo armband this.vibrate(); });
  6. @alexcanessa MyoJS - TopConf Tallinn 2016 Methods and Events •

    Myo.on • Myo.off • Myo.lock • Myo.unlock • Myo.vibrate • Myo.streamEMG • on('pose') • on('orientation') • on('arm_synced') • on('connected') • on('locked') • on('battery_level') https://github.com/thalmiclabs/myo.js/blob/master/docs.md
  7. @alexcanessa MyoJS - TopConf Tallinn 2016 Web Sockets “WebSockets is

    an advanced technology that makes it possible to open an interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.” MDN
  8. @alexcanessa MyoJS - TopConf Tallinn 2016 What does it mean?

    WebSockets JSON myo.js Myo { } < /> onmessage send() WS
  9. @alexcanessa MyoJS - TopConf Tallinn 2016 What does it mean?

    WebSockets JSON myo.js Myo { } < /> send() onmessage WS
  10. @alexcanessa MyoJS - TopConf Tallinn 2016 Listen for a web

    socket event Myo.socket.onmessage = Myo.handleMessage; pose : function(myo, data){ myo.trigger(data.pose); myo.trigger('pose', data.pose); }
  11. @alexcanessa MyoJS - TopConf Tallinn 2016 Trigger a web socket

    event vibrate : function(intensity){ intensity = intensity || 'medium'; Myo.socket.send(JSON.stringify(['command',{ "command": "vibrate", "myo": this.connectIndex, "type": intensity }])); return this; }