Attitude Estimation Algorithm Implementations

Project Description

In an effort to further my own understanding of sensor fusion algorithms, I decided to implement a few different attitude estimation algorithms for deployment on the Nicla Sense Me board. That being said, all algorithms were implemented in pure C++, so they are platform agnostic. An algorithm execution layer was developed to provide the required board-specific information to the algorithms upon instantiation and at each update step. The following attitude estimation algorithms have been implemented:

  • Complementary Filter

  • Madgwick Filter

  • Mahony Filter

Algorithm Data Output Format

The algorithm driver layer creates an instance of the selected attitude estimation class, and provides an interface to update the estimated attitude using measurements from an IMU sensor. The IMU provided on the Nicla Sense Me board has an internal MCU that runs an EKF state estimation algorithm in parallel with whatever is implemented on the main MCU. This EKF result is treated as a "ground truth" for evaluating the algorithms implemented here. At each update step in the algorithm driver class, a JSON message is generated containing the ground truth quaternion and the newly estimated quaternion from the selected algorithm. This JSON message is then output to a host machine via a serial interface. An example JSON message can be seen below:

{"ground_truth_quat": {"w": 0.998838, "x": -0.017456, "y": -0.035095, "z": -0.026733},"estimated_quat": {"w": 0.959821,"x": -0.005751,"y": -0.037534,"z": 0.278033}}

Attitude Data Visualization Utility

This data can be consumed and visualized by the visualization tool developed here. This tool will generate a 3D representation of the orientation of the sensor in space for the ground truth data, and the selected orientation algorithm data. The data is read into a host machine via a USB interface from the Nicla Sense Me board. The resulting JSON message is parsed the 3D representation is updated in near real-time. A screenshot of the tool running can be seen below, along with a demonstration video:

Next
Next

6-DOF Wireless Pose Capture System