This modification of Xsens DOT Server records a signal from xSens DOT sensors (logging it to a CSV file) and sends it via the OSC signal to the specified port / host.
It will also apply Detrended Fluctuation Analysis to the signal (currently, the average of all acceleration signals on each sensor) and calculate its according Alpha exponent, which shows how fractal the signal is.
The Alpha exponent at around 0.5 indicates random walk (sensor in an idle state), between 0.6 and 0.9 is a positively correlated signal, betweeen 0.9 and 1.1 the signal has fractal (self-similar, scale-free) properties, more than 1.1 is a complex signal where the bigger is the scale, the higher are the deviations and they are not scale-free.
In EightOS we aim to go through various Alpha exponents in a movement session, so that both the individuals and the group can experience all the different states (randomness, positive correlation, fractality, and disruption). It relates to the variability principle described on EightOS.IO in more detail.
Xsens DOT Server is a simple web server that can scan, connect and start measurement with Xsens DOT on Windows, macOS and Raspberry Pi. The system is built using Node.js in combination with Noble.
Functions
- Scan sensor
- Connect sensor
- Synchronization
- Real-time streaming - While you can get all measurement modes (exclude high fidelity modes), 6 modes are currently supported in Xsens DOT Server:
- Complete (Euler)
- Extended (Quaternion)
- Rate quantities (with mag)
- Custom mode 1
- Custom mode 2
- Custom mode 3
- Data logging
- Heading reset
- OSC streaming
Get more information about Xsens DOT in Develepor Page and Base.
- Disconnect all Bluetooth peripherals (mouse, keyboard) before start Xsens DOT Server to ensure stable Bluetooth connections.
- Firmware support:
- v1.6.0
- System Architecture: system architecture of Xsens DOT Server.
- Sensor Server: application and workflow control.
- BLE Handler: creates an abstraction from the BLE protocol.
- Web GUI Handler: the web server
- Noble: Node package that implements an interface with the BLE radio (i.e. driver).
- Web Client: a web browser that can run on any computer on the local network and that renders an HTML page that implements the GUI.
- Windows 10, Windows 7
- Compatible Bluetooth 4.0 USB adapter or above
- Recommend to use Chrome or Firefox
-
Install Python 3.8.3 from the Micfrosoft Store package
-
Install Node.js-v12.16.2-x64
-
Install node-gyp
npm install -g node-gyp
-
Install all the required tools and configurations using Microsoft's windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator)
npm install --global --production windows-build-tools
-
Install Zadig to setup WinUSB driver:
- Install Xcode
- Install node.js 8.9.4
- You can install n package to easily manage Node.js versions.
Note: For some operating systems (e.g. macOS), the address is not available unless a connection has been established first. If this is the case, the address of the peripheral is set to a counter. This address will be used until the server is restarted and the sensor is discovered again.
- Raspberry Pi 4 Model B 4GB RAM / Raspberry Pi 3 Model B+, 1 GB RAM
- Install Raspberry Pi OS
-
Install dependcies
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev sudo apt-get install build-essential checkinstall libssl-dev
-
Download Node.js 8.x:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
-
Install
npm
:sudo apt-get install npm
-
Install Node.js 8.x:
sudo npm install -g n sudo n 8.11.1 node -v
-
Open Terminal
-
Clone repository
git clone https://github.com/deemeetree/xsens_dot_server.git
-
Enter Xsens DOT Server project
cd ./xsens_dot_server
-
Install the dependency packages
npm install
-
Install the required Python packages using Conda (python package management) or directly:
a. If you're doing it on a Mac or Windows, go to the https://www.anaconda.com/products/individual and download it to your computer and follow the installation instructions
b. On Raspberry P you have two ways: b.1 — APT-GET or b.2 — MINICONDA. The apt-get
way is easier. You just have to do:
sudo apt-get install python-numpy python-scipy python-pandas python-matplotlib
- If you used Conda or Miniconda, activate the correct environment:
then
conda create -n eightos numpy pandas matplotlib scipy
conda activate eightos
If the current conda (python) environment is set to eightos OR if you installed the Python packages via apt-get
, you can now run the application
-
Make sure you are in the Terminal or open it on your computer.
-
Make sure you are in the
xsens-dot-server
folder. If not, go to that folder:cd xsens-dot-server
-
Run Xsens DOT Server
- Windows and macOS:
node xsensDotServer
- Raspberry Pi:
sudo node xsensDotServer
If everything is good, the Terminal will show you the host address for the application
- Windows and macOS:
-
Open Xsens DOT server in browser
- Run http://localhost:8080/ or http://127.0.0.1:8080/ you are able to use Xsens DOT Server
-
Map OSC port as necessary (port / host)
-
Click
Start Scanning
-
Connect to the Sensors
-
Click
Start Streaming
There are 4 states of the Alpha possible. They are calculated for each separate sensor and for all the sensors at the same time every 30 seconds.
The value (usually ~0.3 to 1.5 max) is sent to the OSC /alpha/sensor_id
channel every 30-40 seconds, where sensor_id
is the ID of the sensor.
--
- alpha <= 0.60 (Note: A) UNIFORM / RANDOM Repetitive, Uniform, Random Movement (0/1, up/down, left/right). Also when the sensors are on the table, not moving
--
- alpha > 0.60 && alpha < 0.90 (Note: B) REGULAR Regular movement (e.g. standard dancing, doing stuff, walking). Most of the time we are here
--
- alpha >= 0.90 && alpha <= 1.10 (Note: C) FRACTAL Fractal movement — this is what we're looking for - variative movement, butoh, adaptive movement.
--
- alpha > 1.10 (Note: D) COMPLEX Complex movements with phase shifts — changing patterns of movement.
--
This same signal also sends the state via the OSC /alpha_note/sensor_id
channel.
A for random (1), B for regular (2), C for fractal (3), D for complex (4)
--
An average alpha is also calculated for all the sensors, so we can see the state of the whole system (all the dancers or all the body parts) at every point of time.
The alpha is sent to
/alpha_avrg/all
.
The OSC note (as above - A, B, C or D) is sent to
/alpha_avrg_note/all
.
In terminal it's called SENSOR AVERAGE ALPHA
--
For each sensor we also calculate the historical Alpha that shows how the state evolved over time.
For this we take the last 3 states of that sensor, calculate an average of those last 3 states, and send the Alpha to
/alpha_history/sensor_id
as well as the OSC note (A, B, C or D) to
/alpha_history_note/sensor_id
where sensor_id
is the sensor.
We also calculate the global historical state for all the sensors.
For that, we take the last 3 global states (last 3 Average states of the system) and calculae the Alpha for all those states. This Alpha is sent to
/alpha_history/all
--
Finally, each historical state can have more than 4 states, because we are dealing with the combination of the last 3 states.
So that means that it could be, for example, ABC, but also BBC and so on.
This is why there are more values for Historical notes than for the standard alpha states. Because we have more possible states.
We also use it to provide an advice: based on the last 3 states (regular, fractal, random or complex) what you should do next.
--
This can be sent as as Note to /alpha_history_note/sensor_id
for each sensor and /alpha_history_note/all
for all the sensors.
THIS NOTE CAN HAVE VALUES FROM E
to V
(in alphabetical order) - LOTS OF VARIETY - 18 states
--
And as a Signal (less options) to /alpha_history_signal/sensor_id
for each sensor and /alpha_history_signal/all
for all the sensors.
THE SIGNAL HAS LESS VARIETY: V
, L
, R
, F
, W
, S
, T
, M
- 8 states
We also provide an advice for the next action based on this logic. The advice is encoded via the OSC Signal code above.
This advice is also displayed in the Terminal and in the Browser.
--
We have total 18 combinations and the logic is as follows:
- ALL LAST 3 STATES ARE RANDOM / UNIFORM
advice: 'VARIATE' | note: 'E' | signal: 'V'
- ALL LAST 3 STATES ARE REGULAR
advice: 'FRACTALIZE' | note: 'F' | signal = 'F'
- ALL LAST 3 STATES ARE FRACTAL
advice: 'LOOP' | note: 'G' | signal: 'L'
- ALL LAST 3 STATES ARE COMPLEX
advice: 'RELAX' | note: 'H' | signal: 'R'
More logic is exemplified below. We analyze the last two states to know where the history is coming to and the first two states to know where it's coming from. Based on that we decide on the advice to give.
else if (last_two == 'random') {
cum_score_advice = 'MAINTAIN'
cum_note = 'I'
cum_signal = 'M'
}
else if (first_two == 'random') {
cum_score_advice = 'LOOP OR VARIATE'
cum_note = 'J'
cum_signal = 'W'
}
else if (last_two == 'regular') {
cum_score_advice = 'MAINTAIN'
cum_note = 'K'
cum_signal = 'M'
}
else if (first_two == 'regular') {
cum_score_advice = 'MAINTAIN'
cum_note = 'L'
cum_signal = 'M'
}
else if (last_two == 'fractal') {
cum_score_advice = 'FRACTALIZE'
cum_note = 'N'
cum_signal = 'F'
}
else if (first_two == 'fractal') {
cum_score_advice = 'VARIATE'
cum_note = 'O'
cum_signal = 'V'
}
else if (last_two == 'complex') {
cum_score_advice = 'DISRUPT'
cum_note = 'P'
cum_signal = 'T'
}
else if (first_two == 'complex') {
cum_score_advice = 'VARIATE'
cum_note = 'Q'
cum_signal = 'V'
}
else if (counts_alpha['random'] == 2 && last_two != 'random' && first_two != 'random') {
cum_score_advice = 'CHOOSE'
cum_note = 'R'
cum_signal = 'S'
}
else if (counts_alpha['regular'] == 2 && last_two != 'regular' && first_two != 'regular') {
cum_score_description = 'unstable regular'
cum_score_advice = 'LOOP OR VARIATE'
cum_note = 'S'
cum_signal = 'W'
}
else if (counts_alpha['fractal'] == 2 && last_two != 'fractal' && first_two != 'fractal') {
cum_score_description = 'unstable fractal'
cum_score_advice = 'FRACTALIZE'
cum_note = 'T'
cum_signal = 'F'
}
else if (counts_alpha['complex'] == 2 && last_two != 'complex' && first_two != 'complex') {
cum_score_description = 'unstable complex'
cum_score_advice = 'DISRUPT'
cum_note = 'U'
cum_signal = 'T'
}
else {
cum_score_description = 'diverse'
cum_score_advice = 'FRACTALIZE'
cum_note = 'V'
cum_signal = 'F'
}
--
- [Connection] Unable to connect sensors in Mac with Bluetooth 5.0.
- [Connection] Connection with firmware 1.3.0 sensors may fail in Windows. You can:
- use firmware 1.0.0
- or use a Bluetooth dongle which support 4.0 or above. Refer to Add Bluetooth adapter to configure your Bluetooth dongle.
--
If you encounter Error: No compatible USB Bluetooth 4.0 device found!
when try to run Xsens DOT Sever on Windows, it means you need to add your Bluetooth adapter to the USB device list:
- Open Device Manager, find the VID and PID of your Bluetooth adapter.
- Open source code: xsens_dot_server\node_modules\bluetooth-hci-socket\lib\usb.js
- Add Bluetooth VID & PID in usb.js (line 66), save and close.
- Run Xsens DOT Server again.
After replacing the Bluetooth adapter with WinUSB driver, you cannot connect to Bluetooth devices with your PC. Here is the way to reinstall the Bluetooth adapter:
- Go to Device Manager -> Universal Serial Bus devices
- Find your converted WinUSB driver and uninstall
- In Device Manager, go to Action (top menu), then Scan for hardware changes and let it reinstall
- You should able to find your Bluetooth adapter back in Bluetooth.
All feedback is welcome and helps us to improve!
Please report all bugs by rasing an issue.
You can also raise app development questions and feature requests of Xsens DOT in our Community Forum.