Code Monkey home page Code Monkey logo

Comments (7)

mkschreder avatar mkschreder commented on August 15, 2024

Also, you state that your vector multiplication formula is q.inversed() * q(0, v) * q. The glm library convention uses the opposite I believe, because rotating v(1, 0, 0) by quaternion q(cos(rads(90/2)), 0, sin(rads(90/2)), 0) results in r(0, 0, -1). Which was my assumption, but instead I was getting r(0, 0, 1).

from px4-matrix.

mkschreder avatar mkschreder commented on August 15, 2024

Can we make assumption that rotations are always applied right to left?

ie. q2 * q1 * v means apply q1 to v first, then apply q2 rotation.

This would clear things up and be more consistent with how it is done in other places.

from px4-matrix.

RomanBapst avatar RomanBapst commented on August 15, 2024

@mkschreder

v_rotated = q^(-1) * [0;v] * q

The description for the rotation formula seems to be wrong. As you stated above this actually applies a transformation rather than a rotation.

from px4-matrix.

jgoppert avatar jgoppert commented on August 15, 2024

I switched to Hamilton quaternion def here: 19554c4

The unit tests all pass with previous and current definition, so no significant change, but I agree it is better to follow the common convention. I'm not sure which reference I pulled that from orginaly.

@mkschreder Please post a new issue if you find anything else, thanks for going through the details.

@mkschreder Quaternion multiplication is associative I believe, so I don't think it matters if we we (q2 * q1)*v or q2 * (q1 * v). The code will execute it as QuatMul(q2, Quat_Mul(q1, v)), effectively always evaluating it as q2 * (q1 * v). Am I following you? Did you mean that v is a vector? I don't believe quat * vector is supported in the library.

from px4-matrix.

mkschreder avatar mkschreder commented on August 15, 2024

Roman, vector part of the resulting quaternion from that transformation is
the rotated vector v.

On 16 Aug 2016 09:57, "Roman Bapst" [email protected] wrote:

@mkschreder https://github.com/mkschreder

v_rotated = q^(-1) * [0;v] * q

The description for the rotation formula seems to be wrong. As you stated
above this actually applies a transformation rather than a rotation.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#28 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AERqibRYSyXXzVEO7xgH3HI0XGuaI19Sks5qgW1mgaJpZM4JlDnZ
.

from px4-matrix.

mkschreder avatar mkschreder commented on August 15, 2024

It is clockwise, as that seems to be the convention when using hamilton
notation (as opposed to positive angle representing counterclockwise
rotation).

On 16 Aug 2016 10:41, "Martin Schroeder" [email protected]
wrote:

Roman, vector part of the resulting quaternion from that transformation is
the rotated vector v.

On 16 Aug 2016 09:57, "Roman Bapst" [email protected] wrote:

@mkschreder https://github.com/mkschreder

v_rotated = q^(-1) * [0;v] * q

The description for the rotation formula seems to be wrong. As you stated
above this actually applies a transformation rather than a rotation.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#28 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AERqibRYSyXXzVEO7xgH3HI0XGuaI19Sks5qgW1mgaJpZM4JlDnZ
.

from px4-matrix.

mkschreder avatar mkschreder commented on August 15, 2024

Thanks for fixing this.

from px4-matrix.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.