Lesson Five: Detecting Poses

Similar documents
Lesson Seven: Holding Gestures

Hand Gesture Data Collection Procedure Using a Myo Armband for Machine Learning

WINDOWS 8.X SIG SEPTEMBER 22, 2014

3. Surfing with Your ipad

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG

OrbBasic LESSON 1 Goto and Variables Student Guide

Chapter 4: Programming with MATLAB

Laboratory IV LCD Framebuffer

Computer Basics. Need more help? What s in this guide? Types of computers and basic parts. Why learn to use a computer?

Apple ipad Accessibility Features Quick Reference Guide

QUICK START MANUAL. Whiteboarding made easy. Quickstart Manual June/18 1

OrbBasic Lesson 1 Goto and Variables: Student Guide

Lifespan Guide for installing and using Citrix Receiver on your Mobile Device

Getting to Integris/SIS

OrbBasic 1: Student Guide

Remote Desktop Services Guide. Android DG ITEC ESIO - STANDARDS

UNIT 1. The App Store was created the next year and its Android rival, Google Play,(2008)

Tips & Tricks on Ipad

KEEPOD QUICK USER GUIDE

Using PSpice to Simulate Transmission Lines K. A. Connor Summer 2000 Fields and Waves I

Tutorial: How to Load a UI Canvas from Lua

Guide to Triggering PopClip with Other Mac Automation Applications

Do a domain analysis by hand-drawing three or more pictures of what the world program will look like at different stages when it is running.

CMPT 100 : INTRODUCTION TO

What is Emcee? Actions in Thumbnail View Starting Emcee and Activating the Thumbnail View... 5

NETWORK THE HOME 10 FOLDERS APPS

Document Number: /4/2012

Connect for iphone. Aug, 2012 Ver 5.3b AWest. 1 P a g e

Instruction: Download and Install R and RStudio

Bomgar Connect Android Rep Console 2.2.6

Task On Gingerbread On Ice Cream Sandwich Notification bar on lock screen Notification bar is not accessible on the lock screen.

MATLAB provides several built-in statements that allow for conditional behavior if/elseif/else switch menu

USER GUIDE for ios 1

Getting to Know Windows 10. Handout

Microsoft Remote Desktop setup for OSX, ios and Android devices

In this lesson you are going to create a drawing program similar to Windows Paint. 1. Start with a new project and remove the default cat sprite.

Mobile Speech Recognizer

HPE ilo mobile app for ios

THE LAUNCHER. Patcher, updater, launcher for Unity. Documentation file. - assetstore.unity.com/publishers/19358

Privileged Access Management Android Access Console 2.2.2

Quick Start Guide. English Android 5.1.1, Lollipop

Remote Desktop Services Guide. ipad DG ITEC ESIO - STANDARDS

Chapter 7: Programming in MATLAB

Mach4 CNC Controller Screen Editing Guide Version 1.0

An Introduction to R 1.1 Getting started

Bomgar Connect ios Rep Console 2.2.7

better if the document has a good contrast to the background and all edges are clearly visible. A white document on a white table would be difficult

Opening and Using Programs

Documentation for Flash Project

OFFLINE MODE OF ANDROID

VISION BASICS. Introduction (note materials updated for Vision 6.8.0)

Accounts and Passwords

Chapter 2: Android Device Basics

CS 160: Interactive Programming

Introduction to Scratch

How to set up Restrictions on the ipad

Navigating Your Kindle Fire 1st Generation

Computer Programming

Please click double click on the icon labeled Internet Explorer, the picture is a blue letter E.

Using the Interactive Whiteboard

StoryStylus Scripting Help

COMP30019 Graphics and Interaction Input

Introduction... 1 Part I: Introductions... 5

2 - Diving into the desktop. 2.1 Logging in

COMP : Practical 8 ActionScript II: The If statement and Variables

What is OneNote? The first time you start OneNote, it asks you to sign in. Sign in with your personal Microsoft account.

Taking Adobe Captivate to the Next Level. Joseph Ganci, Dazzle Technologies Corp. Produced by Selecting, Combining, and Using Authoring Tools

JavaScript Fundamentals_

Organist Palette Guide

Xerox Mobile Client for DocuShare User Guide

Introduction. What is Max?

Nacsport Tag&go 1

Steps on a Computer Compared to Steps on an ipad

SCRIPT REFERENCE. UBot Studio Version 4. The UI Commands

JavaScript Specialist v2.0 Exam 1D0-735

Controlling Windows with gestures

Hello, World! An Easy Intro to Python & Programming. Jack Rosenthal

Image from Google Images tabtimes.com. CS87 Barbee Kiker

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

iphones for beginners

SCRATCH. Introduction to creative computing with Scratch 2.0

Computer Programming ECIV 2303 Chapter 6 Programming in MATLAB Instructor: Dr. Talal Skaik Islamic University of Gaza Faculty of Engineering

ios GUEST GUIDE Remote Support & Management PC Mac Tablet Smartphone Embedded device 1. An Introduction WiseMo Host module on your computer or device

on the: My Files (Yours may be in a different location) (Android only)

Bomgar Connect Android Rep Console 2.2.9

Customizing DAZ Studio

LDSB ipad Overview. Multitasking gestures. movement from one open app to another. o 1 finger swipe side to side allows the

Scripting Tutorial - Lesson 11: Advanced: Introducing Classes

IAT 445 Lab 10. Special Topics in Unity. Lanz Singbeil

Table of Contents Data Validation... 2 Data Validation Dialog Box... 3 INDIRECT function... 3 Cumulative List of Keyboards Throughout Class:...

GUI s and Keyboards. Larry Rudolph March 13, Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

by AssistiveWare Quick Start

Impero Learning Series Teacher Tips English

Introduction to Conditionals

ipad Basics Hannah Digital Literacy Specialist December 6 th, 2017

Lesson 6: Modeling Basics

Import using Settings Migration Tool. Setting the server into which to import

Advanced Excel Macros : Data Validation/Analysis : OneDrive

Adapting elearning for Mobile - Learning from Wonderful Mistakes (Sep 14)

Transcription:

Lesson Five: Detecting Poses PAGE 01

Lesson Five: Detecting Poses Overview Last lesson, we introduced onforegroundwindowchange and how it can be used to detect applications. This lesson will focus on writing a detailed function. We will look at pose and edge, two important arguments which decide what the application does (what poses do and when to detect poses). We can use if statements to build these parts. Objective By the of this lesson, you will be able to write a script that works for a certain application. You will also have learned how to detect poses, so you can start assigning functions to each pose. Goals Learn how to use onposeedge Explore the concept of edge Print poses to the Debug Console Learn how to detect specific poses Lesson Length (Time) 60 Minutes PAGE 02

PART 1: POSES The Myo armband detects five hand poses: Wave Out, Wave In, Fist, Finger Spread, and Double Tap. When and how to use each pose is covered in the UX guidelines 1. To detect a pose, we can use the second of our predefined callbacks: onposeedge. The format for this function, shown below, is very similar to onforegroundwindowchange. function onposeedge(pose, edge) We will cover what edge means later. Currently, pose can have one of the following values: wavein, waveout, fist, doubletap, fingersspread, rest, and unknown. rest is the state where the user is not actively posing, and unknown means that the Myo armband can t determine any poses. PART 2: WHAT IS EDGE? edge will be set to on when a pose is read, and off when the user releases it. This will allow you to start listening for changes in the position of the Myo armband when necessary. You will see this "edge" concept again when we discuss keyboard and mouse button presses. PAGE 03

PART 3: DETECTING POSES ON DEBUG CONSOLE Printing the pose and edge state to the Myo Debug Console is similar to the last lesson with onforegroundwindowchange. You can add something like this below to your previous code. If you don t want your script to continue outputting the app and title, remove the line of code that contains myo.debug from your onforegroundwindowchange function. function onposeedge(pose, edge) myo.debug("onposeedge: ".. pose.. ": ".. edge) Save the file and refresh it in the Application Manager (using Developer Mode). Try printing poses and the edge state to the console yourself, and compare what happens in the debug log and the pose window (the circle at the bottom of your screen that displays what poses are being made). The debug console should look something like this: Note that you have to unlock the Myo armband with a double tap before any poses come through to your script. Until we come back to advanced locking behaviour, the armband will lock itself automatically after a few seconds. PAGE 04

PART 4: IF STATEMENTS We are going to implement onposeedge through several if statements. This means you will be performing a specific task for each gesture you care about. In Lua, if statements look like this: if <conditional> then -- do something elseif <other conditional> then -- do something if something else is true else -- do something else An if statement evaluates the conditional statement first. If it is true, it executes the code after then and nothing else in the rest of the elseif/else statements. If the original conditional statement is not true, it goes through any elseifs in order and does the same thing. If it gets all the way down to an else, it will execute that code. For example, you might add something like this in your onforegroundwindowchange function to detect your applications in the foreground: if (title == "My Application") then return true elseif (title == My Other Application ) then return true else return false This if statement only returns true if the title variable has been assigned the string value My Game. If you want to use this in your script, you can find the title of your application by using onforegroundwindowchange to output it to the debug console. Remember to close any if statements with. PAGE 05

PART 5: DETECTING SPECIFIC POSES It is recommed to detect the pose you want in onposeedge, and then handle what happens for each pose in a separate function. Add your logic to your onposeedge implementation that will detect any gestures through edge, and call a separate function for each pose (something generic like onwaveout() for Wave Out). If you wanted to perform a function for wave out specifically, it would look something like this: function onposeedge(pose, edge) myo.debug("onposeedge: ".. pose.. ": ".. edge) if (edge == "on") then if (pose == "waveout") then onwaveout() This function first waits for a pose to be detected and then runs the onwaveout function if the pose detected is waveout. PAGE 06

Challenge Activities The following code is from the previous lesson. You may use it as a template to complete the first question. scriptid = 'com.thalmic.examples.myfirstscript' scripttitle = "My First Script" scriptdetailsurl = "" function onforegroundwindowchange(app, title) myo.debug("onforegroundwindowchange: ".. app.. ", ".. title) return true 1. Write a script using onforegroundwindowchange, but use if statements so that your script only outputs the app and title to the debug console for a specific title. For example, if you clicked on your preassigned window the output message would appear as it normally would. However, if you changed your foreground window to any other window, nothing would be output to the debug console. 2. In Part 5 of this lesson, we implemented a specific function for wave out inside of onposeedge. Implement the other gestures by adding to the if statement, and use default function names such as onwaveout, onwavein, onfist, and onfingersspread. PAGE 07

Footnotes [1] https://developer.thalmic.com/ux PAGE 08

Solutions 1. scriptid = 'com.thalmic.examples.myfirstscript' scripttitle = "My First Script" scriptdetailsurl = "" function onforegroundwindowchange(app, title) if (title == "Replace this text with Application Title") then myo.debug("onforegroundwindowchange: ".. app.. ", ".. title) 2. function onposeedge(pose, edge) myo.debug("onposeedge: ".. pose.. ": ".. edge) if (edge == "on") then if (pose == "waveout") then onwaveout() elseif (pose == "wavein") then onwavein() elseif (pose == "fist") then onfist() elseif (pose == "fingersspread") then onfingersspread() PAGE 09