Quaternions and Euler Rotations Exploration

#1

Hello,

I did an exploration of rotations with quaternions and Euler angles and sharing the “bare bones” code I wrote.

The original project (a year ago) got out of hand and I really need to clean up the code and references and this was a start.

This code was written to test formulas from:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm

This program:

  1. Generates Euler angles with keyboard control
  2. Euler angles are converted to quaternions
  3. quaternions are converted back to Euler angles
  4. Euler angles are used to rotate a shape

Later I replaced 1 and 2 with serial data (quaternions) from a BNO055 sensor; there was a lot more involved in doing this. :slight_smile:

Code:

Sensor:

Example video of final project (the one I posted is only keyboard and “minimal”):

Enjoy!

:slight_smile:

6 Likes
Request for guidance:- Making 3D objects appear static on a webcam feed using arduino & an IMU: