DavidEGrayson / ahrs-visualizer

Draws a 3D representation of an IMU's orientation. Developed for Raspberry Pi and OpenGL ES. Works with minimu9-ahrs.
Other
49 stars 11 forks source link

WARNING

This project does not compile on modern versions of Raspberry Pi OS due to breaking changes in the OpenGL API we use. See issue #11 for more discussion.

ahrs-visualizer

ahrs-visualizer reads orientation data on its standard input and uses that to display a 3D representation of the orientation.

To see what the visualization looks like, check out this video showing the MinIMU-9 v2 with a Raspberry Pi.

Currently, the presence of GPU-specific code means that it only works on the Raspberry Pi but it can probably be ported to other boards. It uses OpenGL ES 2.0.

Getting started

Get minimu9-ahrs working

This program is meant to be used with minimu9-ahrs, a separate utility that reads data from the Pololu MinIMU-9 and computes its orientation. To get that working, follow the instructions at the aforementioned link.

Building ahrs-visualizer from source

Navigate to the top-level source directory and run these commands:

sudo apt-get install libpng-dev libboost-program-options-dev
make

If you want to try out the visualizer before installing it, you can run:

./mock_ahrs.py | ASSET_DIR=assets ./ahrs-visualizer

To install the visualizer, run:

sudo make install

Invoking

To pipe direction cosine matrix (DCM) data from minimu9-ahrs to ahrs-visualizer, simply run the following command:

minimu9-ahrs | ahrs-visualizer

The visualizer runs fine from the console; you do not need to run X.

Run man ahrs-visualizer for more help and details about the options the program accepts.

Understanding the visualization:

Error about opening a vchiq instance

If the program cannot open /dev/vchiq because of a permissions problem, you will see the following error:

Warning: Could not open /dev/vchiq: Permission denied.
    * failed to open vchiq instance

On the Raspberry Pi, the right way to fix this error is to add your user to the video group. Just run the following command and then reboot:

sudo usermod -a -G video $(whoami)

Version history