Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rotation convention used in MPU sources #12

Copy link
Copy link
@yerzhik

Description

@yerzhik
Issue body actions

My task is to compare two sensors results one is xsense another is MPU 9150.
I read about the quaternions to euler conversion:
wikipedia formula

What I see from the source code of MPU is:

 *x = atan2( 2.f * ( q->x * q->w + q->y * q->z ), 1.f - 2.f * ( sqz + sqw ) );
 *y = asin( 2.f * test );
 *z = atan2( 2.f * ( q->x * q->y - q->z * q->w ), 1.f - 2.f * ( sqy + sqz ) );

As you see its different. I tried to analyze the matrices of rotations with different conventions (xyz, zyx etc) but none fits this kind of formulas.

Due to unknown convention I can't compare them. So I decided to use the quaternions from MPU instead. And then Using matlab to convert them into euler angles. Euler angles (yaw pitch roll) from MPU and euler angles got from MATLAB after conversion MPU quaternions to euler angles are completely different and makes no sense. MPU euler angles are OK. Showing good results but mpu quaternions to euler angles done in Matlab are completely wrong (matlab uses zyx convention but I think it doesn't matter which convention to use as I'm getting it from quaternions).

So the question is: is it possible that mpu is using it's own kind of quaternions and rotation matrix convention for euler angles or am I missing something? Could you help with that please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.