The system consists of a consumer an N-publishers identified by an 8 bit id.
A publisher simulates "random" motion of a device and outputs the resultant sensor readings with artificial measurement noise superimposed on top. It sends the packet containing the IMU payload as a datagram with a sequence number for ordering.
The consumer collects messages and puts them in a queue corresponding to the sender for ordering. After each packet it attempts to update the estimated orientation of remote sensors. It uses a simple complementary filter which combines integrated gyroscope rates for fine movement accuracy and tilt-compensated magnetometer readings for long term stability and recovery of orientation.
The coordinate system assumed is as per the below image
Recommended python3.12+
- Clone this repository
- Run
pip install -r requirements.txt - Optionally run
pip install -r requirements-vis.txt - Using visualization on linux might require the
libxcb-cursor0package
To start the consumer:
python3 -m src.consumer --socket-path ./tmp.sock
To start the publisher:
python3 -m src.publisher --socket-path ./tmp.sock --frequency-hz 500
Both accept a --visualize flag which will display the internal orientation of the publisher or the orientation estimated by the consumer
- Video showing 2 publishers pushing updates to the consumer, with visualization enabled
demo_A.webm
- Video showing recovery capability of both processes.
