Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Everything about the KAI controller 🤳🏻. The Kai polls for data from the Gyroscope, Accelerometer, and Magnetometer built into it. Once it detects a gesture / needs to send data, it sends it using the Bluetooth Low Energy (BLE) protocol of the Bluetooth 4.0 spec 🦉

License

Notifications You must be signed in to change notification settings

addu390/motion-tracking-kai-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ No longer maintained

Project: https://www.pyblog.xyz/myo-electric-prosthetic-arm

Kai Python Package

Setup

Run the following commands to initialise the project directory

python3 setup.py build
python3 setup.py install

Module Initialisation

a. Make sure the moduleId and moduleSecret are defined correcty in your program.

moduleID = "moduleName"     # Name can be anything
moduleSecret = "qwerty"

b. Connect to the KaiSDK Websocket.

module = WebSocketModule()
success = module.connect(moduleID, moduleSecret)

Accessing Data

Set Capabilities

module.setCapabilities(module.DefaultKai, KaiCapabilities.AccelerometerData | KaiCapabilities.GyroscopeData | KaiCapabilities.PYRData)

Set Listeners

def accelerometerEv(ev):
    print(ev.accelerometer.x)
    print(ev.accelerometer.y)
    print(ev.accelerometer.z)

module.DefaultKai.register_event_listener(Events.AccelerometerEvent, accelerometerEv)

Unset Capabilities

module.unsetCapabilities(module.DefaultKai, KaiCapabilities.AccelerometerData | KaiCapabilities.GyroscopeData | KaiCapabilities.PYRData)

Closing the Module

module.close()

Run the example file using the following command

python3 gesture.py

About

Everything about the KAI controller 🤳🏻. The Kai polls for data from the Gyroscope, Accelerometer, and Magnetometer built into it. Once it detects a gesture / needs to send data, it sends it using the Bluetooth Low Energy (BLE) protocol of the Bluetooth 4.0 spec 🦉

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages