Git Product home page Git Product logo

Comments (3)

PaulStoffregen avatar PaulStoffregen commented on July 22, 2024 1

Did you watch the video demo?
https://www.youtube.com/watch?v=SHJ2n1Kwe58

This test is very easy to replicate. Just use that small program running on any Arduino board with 3 pots connected, so you can control the 3 inputs easily. If you imagine the visualization is an airplane instead of a circuit board, you can easily tell the old code is wrong and the new code visualizes roll, pitch & yaw correctly.

It issue is a matter of extrinsic vs intrinsic rotation. Background material can be read here:
https://en.wikipedia.org/wiki/Euler_angles
http://math.stackexchange.com/questions/1288207/extrinsic-and-intrinsic-euler-angles-to-rotation-matrix-and-back

Extrinsic means the rotations are relative to an absolute coordinate system. Intrinsic means the rotations are relative to the object itself.

Here's the conversation where the problem was noticed and discussed.
https://forum.pjrc.com/threads/33328-Prop-Shield-Beta-Test?p=99941&viewfull=1#post99941

Look, I don't have a lot of time to write a lot more for you, and really everything has been said far better on those many pages. But still...

Can you please explain the following matrix in terms simple rotateY , rotateX, rotateZ functions

Ok, really quick.... Imagine you're taking a flight within the United States, and imagine a coordinate system where the X axis is West to East, and the Y axis is South to North, as if you had a regular map of the USA on a standard X-Y grid.

I believe we can agree when your plane begins its descent to land, that's negative pitch. Roll involves the wings tilting, and pitch involves the nose of the plane pointing upwards vs downwards. This is the key point, pitch and roll are experienced by people on the plane (intrinsic).

So, if you're flying from Seattle to San Diego, this (wrong) code in the visualizer actually works fine. As you come in for the landing in San Diego (flying Southward), the plane pointing downward is a rotation about the horizontal X axis.

  rotateX(pitch); // RotateX pitch value

But imagine instead you're flying from Seattle to New York. As your plane pitches downward to land in NYC, the plane itself is rotating about the Y-axis (the one drawn vertically on your USA map). This wrong code will visualize the wings tilting on your NYC descent, because it always applies pitch as a rotation about the horizontal X axis. As you descend towards New York, the plane's pitch is actually a rotation about the vertical Y axis.

The matrix approach correctly visualizes negative pitch as the nose of the plane pointing downward, regardless of where the plane is actually heading (yaw).

Hopefully you can understand this. I really can't spend more time explaining. If you still can't see it, I highly recommend you connect any Arduino with 3 pots and run that tiny program to send roll, pitch and yaw. If necessary, edit the code to draw an airplane instead of a circuit board. Or use your imagination that the connectors on the sides of the circuit board visualization are the plane's wings. When you do this, I'm confident you will quickly see the old code is very wrong.

from madgwickahrs.

vasanthsai avatar vasanthsai commented on July 22, 2024

thanks for the helping out !!
Really appreciate the help !!

from madgwickahrs.

vasanthsai avatar vasanthsai commented on July 22, 2024

PaulStoffregen/MahonyAHRS#2

from madgwickahrs.

Related Issues (20)

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.