GithubHelp home page GithubHelp logo

Comments (4)

xioTechnologies avatar xioTechnologies commented on July 4, 2024

Variables such as halfGravity and halfGyroscope exist as an optimisation to avoid unnecessary operations. There any many intermediate calculations that involve a multiplication by 2. The optimisation removes all of these intermediate multiplications, and replaces them with a single multiplication at the end.

For example, consider the following sequence:

  1. value = 2 * input
  2. value = value + 2 * constant_a
  3. value = value + 2 * constant_b
  4. output = value

This can be optimised as:

  1. half_value = input
  2. half_value = half_value + constant_a
  3. half_value = half_value + constant_b
  4. output = 2 * half_value

This is effectively what is going on in FusionAhrsUpdate.

from fusion.

jacklee0575 avatar jacklee0575 commented on July 4, 2024

Thank you for your kind reply of the detailed trick in the code. I also want to ask the second question. I have tested the algorithm without the feedback of acc or mag, and contrasted with the direct integration of the gyro data. The results show that the quaternion implementaion with a half gyro is more stable than the direct integration of single axis gyro data, which has less drift over time while the direct integration caused drift is very obvious. Have you noticed this phenomenon? Could you tell me the possible reason for this phenomenon. Many thanks!

from fusion.

xioTechnologies avatar xioTechnologies commented on July 4, 2024

Calling FusionAhrsUpdate with the arguments accelerometer and magnetometer set to FUSION_VECTOR_ZERO will remove the accelerometer and magnetometer feedback so that the orientation is calculated though integration of the gyroscope data.

It sounds like you are comparing this result for a triple-axis gyroscope, to different result for a single axis gyroscope. The difference in performance will be because the single-axis is not accounting for motion (even if very small) in the other two axes.

from fusion.

jacklee0575 avatar jacklee0575 commented on July 4, 2024

Thank you for your detailed reply. I have understand this phenomenon.

from fusion.

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.