Quaternions given relative to NED but I want to orientate my sensor relative to Down only

5 views (last 30 days)
Hello all, i am using the Bosch BNO055 IMU to do gait analysis. The quaternions outlutted from the sensor are relative to the NED (or ENU, im not sure) global refernece frame. I would like to keep the DOWN part of this so the sensor is aligned with gravity, but the X and Y axis stay in the orginal body frame.
the quaternion is in w,x,y,z form where the z quaternion aligns the sensor relative to north (and therefor east). If i reset this to 0 then will it not longer aligned the sensor with North and East, but still down? Also does anyone know what i will have to do to the W term if i do this?
Thank you for your help and suggestions
  1 Comment
James Tursa
James Tursa on 11 Sep 2020
I don't understand your request. If you have a DOWN vector and two BODY vectors they will not form an orthogonal set of axes. What is your purpose in trying to do this?

Sign in to comment.

Answers (1)

Greg
Greg on 18 Jun 2025
Thank you for your question.
If you want the tilt angle, please use a function called tilt() that does that. It takes an orientation quaternion as input. This function ships in both Nav and SFTT Toolboxes.
If you want the actual pitch and roll angles, the easiest is just to convert.
Assuming you are working with a quaternion object:
eul = euler(q, ‘ZYX’, ‘frame’) ;
pitch = eul(2);
roll = eul(3);
If you want to rebuild a quaternion with no yaw: quaternion([0 pitch roll], ‘euler’, ‘ZYX’, ‘frame’)
Also, There are conversion functions to work with the N-by-4 quaternion in Aerospace Toolbox.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!