Table of Contents
Stream and visualize mobile phone sensor data in Python. As an example algorithm, a Quaternion-free inclination tracking Kalman filter.
Mobile phones contain many interesting sensors that can be useful tools when developing e.g. sensor fusion algorithms for drones. Python is useful for quickly experimenting with sensor data processing algorithms before implementing the embedded version. This project contains an example implementation of a pipeline consisting of
- Data receiving from mobile phone,
- Sensor fusion algorithm for estimating sensor orientation,
- Real-time visualization on PC.
The inclination (gravitation) tracking in based on a quaternion-free method for estimating gravitation direction in sensor's coordinates. Visualization using OpenGL and Pygame.
Python programming environment with the following additional packages
- PyGame:
pip install -U pygame
- PyOpenGL:
pip install -U PyOpenGL
- Numpy:
pip install numpy
- PyKalman:
pip install pykalman
Currently tested only with the Android app SensorStreamer that sets up a mobile server for sending sensor data.
- Install the app
- Configure a data package with gyroscope and accelerometer data
- Configure a connection with your favorite port (e.g. 3400)
- Find out our mobile phone IP address (Search "IP Address")
- Start a stream in the app with
Lowest possible period
- Run
python sensorstreamer.py --host=123.456.78.90 --port=1234 --buffer=8192 --method=naive
S. Särkkä et. al, Adaptive Kalman filtering and smoothing for gravitation tracking in mobile systems