Connect to Xsens DOT wearable sensors via Python.
- Bluepy
- Numpy
- One or more Xsens DOT sensors
Enter this in your command prompt or terminal to install necessary Python modules via Pip:
pip install -r requirements.txt
There are generally two steps to connecting to any Bluetooth device: Scanning for all Bluetooth devices near you, and pairing/connecting to the device.
- Find the DOTs with
$ python blescan.py
.blescan.py
finds all Bluetooth devices in your area, including phones, laptops, and lightbulbs, and will print them all to the console/command line/Terminal. - Add the addresses of only the Xsens DOTs that were found to
device_addresses.csv
. The address will look likeaa:bb:cc:12:34:56
. - Connect to and start getting data from the DOTs by running
$ python server.py
. DOT data will be printed to the console.
There is a known issue where DOTs may send out messages that only have half the data elements they're supposed to. For example, if you turn on a mode that is supposed to give you accelerometer data and gyroscope data, you might only get accelerometer data. This may be an issue with the code in this repository or with the original Xsens code.
There is an issue open here with Xsens themselves, but they're a Node shop rather than a Python shop, so the issue was not looked into further.