-
Notifications
You must be signed in to change notification settings - Fork 2
PhysioSense
Welcome to PhysioSense Code Repository Wiki.
The PhysioSense project is a part of the PhysioVR framework and it enables the framework to provide sensor data through User Datagram Protocol (UDP) a core member of the Internet protocol suite.
PhysioSense consists of two applications, a mobile application for a smartphone, and a wearable application for an android wear compatible device, such as a smartwatch. Moreover it accommodates various physiological sensors in order facilitate the PhysioVR framework.
This has been developed and tested with a Samsung Galaxy S4 smartphone and LG G Watch R, but should be compatible with any smartphone running android Lollipop or later and Android Wear compatible device. In addition we have also implemented and tested Muse: The Brain Sensing Headband and Myo: Gesture Control Armband as well.
This module is responsible for running the PhysioSense Activity on an Android handheld device. It also doubles as a module to receive the processed sensor data from respective sensor listeners and dispatches it to a specific UDP data stream.
-
HandheldActivity class This class focuses on extracting sensor data from their respective listener modules and interpreting them to running GUI Activity.
-
UDPSender class This class is a UDP data dispatcher which consolidates the processed sensor data received from their relevant listener modules and sends them through the local UDP Port (
11111
by default) by utilizing a timer. The timer allows a developer to modify the frequency of dispatching the sensor data onto the UDP stream (1000
milliseconds /1Hz
by default).-
Sensor Data: Serialization
S_Sensor, Signal type, Value *The **S_** is to distinguish the UDP message as a sensor message. The **Sensor** will represent the name of the sensor along with an incremental number for multiple sensors. The **Signal Type** will represent the type of signal that is sent from the sensor. The **Value** will represent the value of the signal type for the relevant sensor.* Simple serialization example (Android wearable heart rate): `S_WEAR,HR,70` Complex serialization example (Android wearable heart rate, Muse's four eeg signals and a Myo's emg): `S_WEAR,HR,70 | S_MUSE01,EEG1,60, S_MUSE02,EEG2,70, S_MUSE03,EEG3,80, S_MUSE04,EEG4,90 | S_MYO,EMG1,20` **note:** *the pipe character* (|) *is applied in order to differentiate the sensors and better readability.*
-
This module is responsible for running the PhysioSense Activity on an Android wearable device. It allows the the users to both collect and send relevant sensor data using GoogleApiClient.
- WearActivity class This class focuses on reading the relevant sensor data from the wearable device and send it to the paired handheld device as a GoogleApiClient message. Furthermore this class also represents the sensor data on the wearable's GUI Activity (if applicable).
This module is responsible for interpreting the GoogleApiClient message sent by the android wearable device running the PhysioSense. In addition to the message interpretation this module also retrieves the sensor status in order to provide better user feedback.
This module is responsible for connecting and retrieving raw MuseDataPackets and processing them by utilizing the Libmuse SDK (the official muse development kit library for Android).
This module is responsible for connecting and retrieving raw MyoDataPackets and processing them through a custom build library (unofficial) to allow the developers to access various sensor data ranging from EMG to Accelerometer.
libmuse is a library for interfacing with Muse headbands, including finding paired Muses, connecting to them, reading their state, and receiving packets of various sensor data. You can use it in your own applications, subject to the terms of our license.
The library consists of two parts: a core in C++ and a platform-specific interface in whatever language your platform writes its interfaces in: Java for Android, Objective-C for iOS.
Visit http://developer.choosemuse.com for additional information.
MyoListener is a custom library built for hacking bluetooth in order to retrive EMG data from Myo
Reference: Thalmic Lab. myo bluetooth protocol