Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BNO055 : Convertng Heading/Pitch/Roll Angles to Rotation Matrix

    BNO055 : Convertng Heading/Pitch/Roll Angles to Rotation Matrix

    New Poster


    I understand that the Euler Angle outputs for the BNO055 aren't supposed to be used for determining large roll-pitch angle orientation. 

    I'm currently working with a large dataset taken from a previous flight test utilizing a BNO055, one in which the heading is moving through the entire 360 degree range, but the roll and pitch angles are limited to below about 20-30 degrees. This dataset unfortunately does not include the quaternion outputs.

    So my goal here is to use the data I have (accelerometer, gyro, magnetometer, gravity vector, and euler angles) to determine orientation of the body frame relative to the IRF (which I understand to be defined by the i-axis aligned with magnetic north, and the k-axis aligned with the gravity vector (or plumb with earth). 

    However, I cannot seem to find anything in the literature relating the euler angles given to a rotation matrix. I haven't messed with extrinsic rotations, but I have looked at all 12 unique intrinsic rotation sequences, and they do not appear to line up (I test out each by numerically computing the OcB matrix for the each rotation sequence, using the supplied euler angles, and rotating the Body frame (B frame) magnetometer data into the IRF (O frame) using the expression O = OcB*B.) I've also tried using a Matlab-based Madgwick Filter on the raw data to compute the rotation matrix, and have gotten reasonably good results from that, but there are still periods of time when the gravity vector does not rotate onto k axis in the IRF, suggesting a dissagreement between the Madgwick filter and the BNO's internal sensor fusion algorithm. 

    Perhaps I'm doing something wrong with my computations, does anyone have any experience using the BNO055's supplied euler angles to acheive an accurate rotation matrix? If not, does anyone know anything about the sensor fusion algorithm used internal to the BNO055 (Mahoney, Madgwick, Kalman, proprietary)?

    Thanks in advance!

    2 REPLIES 2

    Community Moderator
    Community Moderator

    Why not directly use "Quaternion" from BNO055 for your calculation? 

    we are output querternion vector with "w,x,y,z" then you can use matlab to convert to your expected coordination directly

    Thanks for the reply!

    Unfortunately, the dataset I'm working with has already been recorded, and Quaternion data is not present in the dataset. 

    I realize that using quaternion output is the best practice in future datasets, however I am trying to extract orientation from the data that I currently have (Euler Angles).