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 or robotics. Python is useful for quickly experimenting with sensor data processing algorithms before implementing the embedded version. This project contains an example implementation of a development environment consisting of
- Data receiving from mobile phone to (e.g. laptop) computer,
- Sensor fusion algorithm for estimating sensor orientation,
- Real-time visualization on display.
The inclination (gravitation) tracking in based on a quaternion-free Kalman filtering method for estimating gravitation direction in sensor's coordinates. Visualization using OpenGL and Pygame.
Python programming environment can be installed with
pip install -r requirements.txt
NOTE: PyOpenGL requires typically an OpenGL utility toolkit, e.g.
freeglut3-dev
on Ubuntu Linux.
Currently tested only with the Android app SensorStreamer that sets up a mobile server for sending sensor data.
- Install the SensorStreamer 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" in Android)
- An option is to activate a "Mobile hotspot" local network and connect the laptop to the network
- Start a stream in the app with
Lowest possible period
- Launch visualization program:
python sensorstream.py --host=<insert_your_phone_ip_address> \
--port=3400 \
--buffer=8192 \
--method=naive
S. Särkkä et. al, Adaptive Kalman filtering and smoothing for gravitation tracking in mobile systems