Coder Social home page Coder Social logo

Comments (3)

xioTechnologies avatar xioTechnologies commented on June 25, 2024

Thank you for raising the issue. The problem can be demonstrated using the following code. The plot ends after 45 samples because the remaining 55 samples are all NaN.

import imufusion
import matplotlib.pyplot as pyplot
import numpy

numberOfSamples = 100

ahrs = imufusion.Ahrs()
pitch = numpy.empty(numberOfSamples)

for index in range(numberOfSamples):
    ahrs.update_no_magnetometer(numpy.array([0, 0, 0]), numpy.array([1, 0, 0]), 1 / numberOfSamples)
    pitch[index] = ahrs.quaternion.to_euler()[1]

pyplot.plot(pitch)
pyplot.show()

image

After implementing the fix you have suggested, the plot shows all 100 samples as shown below.

image

As an aside, it is interesting to note that the transition from the final asinf result (-89.5) to the hardcoded -90.0f is visible in the above plot as step change. The transition becomes smoother when FUSION_USE_NORMAL_SQRT is used as shown below.

image

from fusion.

xioTechnologies avatar xioTechnologies commented on June 25, 2024

The fix has been applied as commit d7788de.

from fusion.

the-m-master avatar the-m-master commented on June 25, 2024

Thanks! We are going to use it in the next release :)

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.