Skip to content
Peter Walkington edited this page Jan 23, 2022 · 11 revisions

Getting started

This tutorial builds upon the pyomyo Getting started tutorial, I recommend following it to play the Chrome Dino Game with the Myo first.

  1. Plug the Myo dongle into your PC, make sure the Myo is charged and wear it to let it warm up.
  2. Git clone this repo and run pip install -r requirements.txt
  3. Git clone pyomyo locally.
  4. Go into the cloned directory and use pip uninstall pyomyo then pip install . to install your local developer version of pyomyo.
  5. Install OpenGloves on Steam. OpenGloves overrides SteamVR inputs, so remember to disable it when you want to use your normal controllers.
  6. Open OpenGloves and change the Communication Method to NamedPipe, make sure to enable OpenGloves for the hand you want to control with the Myo. (If using the left, you may have to change the pipe in code from right to left.)
  7. Start SteamVR and a game with finger tracking support such as Half Life Alyx. Make sure Myo Connect is not open and your dongle is plugged in.
  8. Put your Myo on and let it warm up.
  9. Confirm OpenGloves is getting the data using python opengloves_tester.py which allows you control SteamVR hands using a GUI.
  10. To try proportional grasp control run: python predictor_grasp.py which closes your hand depending on values from the Myo.
    It won't work well as we need to train a model for complex tasks like finger classification.
  11. To try a finger classifier run: python predictor_basic.py and follow the instructions below.

Training a model using predictor_basic.py

SteamVR finger tracking

The video above shows quick training of a finger classifier model using predictor_basic.py. You'll notice it's a modified dino_jump.py which is why you should start there.

Each number key on the keyboard corresponds to both a class and a finger. So resting the hand and pressing 0 will label incoming EMG data of a resting hand as resting. The pose handler takes in the predicted class number and then sends the appropriate signal to SteamVR.

predictor_basic.py assumes the mapping:
Class 0 - Rest
Class 1 - Thumb curl
Class 2 - Index curl
Class 3 - Middle curl
Class 4 - Ring curl
Class 5 - Pinky curl
Class 6 - Close fist

Start by closing resting one hand and using your other hand to label the data as resting (press 0).
Curl your thumb and press 1, if you have Half Life Alyx and OpenGloves running, you should see your virtual thumb curl as your classifier predicts 1.
Continue labelling using the above mapping.

If you see no finger movement in Alyx, try running python opengloves_tester.py and confirm OpenGloves is getting commands over the NamedPipe.
If not, try the Troubleshooting steps.

Feel free to ask for further help in the Discord here.

Clone this wiki locally