dzhu / myo-raw

MIT License
218 stars 115 forks source link

See PyoMyo fork: Many bugs fixed and added features. #38

Open PerlinWarp opened 2 years ago

PerlinWarp commented 2 years ago

PyoMyo - Python Open-source Myo library

Chrome Dinosaur Game

Around a year ago I tried myo-raw and found many bugs, I then created pyomyo, the first open-source, multi-threaded, cross-platform Myo library.

It's worth noting that myo-raw does not actually use raw values (e.g. from the ADC) but preprocessed values (0x01) which have already been filtered and rectified. PyoMyo lets you choose which of the 3 Myo modes you want to use. (Preprocessed, Filtered or Raw.)

Some initial fixes are listed below:

  1. Stopped the Myo disconnecting after 30 seconds.
  2. Correctly handled Myo Bluetooth values to stop crashing.
  3. Refactored the code and updated it to Python 3.
  4. Implemented the Bluetooth protocol in a separate thread. Plotting libraries require to be in the main thread in Python. (Matplotlib and Pygame), myo-raw would do everything in a single thread causing unreliable performance.
  5. Benchmark the frequency of received data and plot it.
  6. Added the option to prespecify Myo MAC Address. Given multiple Myo’s in range, the library would randomly connect to one as the Myo is always on.

PyoMyo documentation is in the Wiki, see Getting Started. I also created resources around using EMG, including:

See also

  1. NeuroBreakout
    An example showing how to use the Myo for 1D regression.

Playing breakout with sEMG

  1. NeuroGloves Models and tools for predicting 5 finger curl using EMG and LucidGloves for labelling.

SteamVR finger tracking

  1. NeuroLeap
    Models and tools for predicting LeapMotion data from EMG.

Acknowledgements

Huge thanks to dhzu and Alvipe for their extensive and fundamental work on getting the Myo working in Python.
I do feel weird essentially advertising my fork on dhzu's original, however myo-raw shows up first when searching on GitHub, likely due to its 7-year head start compared to PyoMyo. Since this repo doesn't seem to be actively maintained, I decided to make my own and not just fork it, to try to make sure the code base could be maintained however despite lots of attention in the project, developers will not be able to find it when looking for a Myo library due to it's search results being highly dependent on the number of stars the repo has.