Motion Capture is an on-board computing project for motion capture using accelerometer data. The source code is written in C and is compiled for a Gumxtix controller. A GUI application on a remote computer lets you observe the motion in real time.

GUI application

Overview

Setup: this project is built upon a Gumstix Overo Airstorm and an extension card (accelerometer) under Linux Angström.

Project description: displaying on a remote computer, the real-time position and motion of the Gumstix controller.

Functional challenges:

  • Recover accelerometer data from the registers in an optimal way.

  • Compute the position of the controller from noisy accelerations data.

  • Guarantee real-time constraints with a minimum of missed deadlines.

  • Communication between the system and the computer with an ad hoc wifi.

  • Graphic display of the system position and motion.

Overview of the architecture.
Overview of the architecture.

Recovering accelerometer data

Accelerometer data are saved in a specific register, thus we need to recover them from the I²C communication bus. Functions from the manufacturer are already available to do this job, but the code is large, complex and with multiple dependencies. Therefore, I’ve significantly reduced the code to gain a speedup in performance of 1.5.

Computing the position

To compute the position from acceleration, one can take the mathematical relation between the two: by doing a double integral onto the acceleration signal, the relative position may be obtained.

From acceleration to relative position.
From acceleration to relative position.

Sadly, reality is not as perfect as theory…

First, the acceleration signal is not continuous but discretized. Second, data are noisy in many ways due to the sensor imperfection. Thus, positions calculated from this data would be inaccurate.

Different techniques are applied to partially correct existing incertitudes:

  • Trapezoidal rule for integrals: reduce integration error on discrete values.
  • Sensor calibration: reduce measurement bias.
  • Low pass filter onto the acceleration signal: help to reduce the mechanical and electrical noise of the accelerometer.
  • Window filtering: ignore acceleration values near zero to annihilate noise during stationary periods.
  • Motion verification: force the estimated speed to zero if acceleration is null for long enough.