Software for ESP32: Gather motion data from gyroscope and accelerometer (translational acceleration in x/y/z and rotation rate around x/y/z). Calculate X/Y/Z position and roll/pitch/yaw angles by integrating over time. Drift of roll and pitch angles is corrected by accelerometer measurements.
The data is compressed and sent via Bluetooth Low Energy in short intervalls. Arduino Code for the ESP32 can be found in attached Github repository.