Giter Club home page Giter Club logo

Comments (1)

jonathanjfshaw avatar jonathanjfshaw commented on July 20, 2024

I've identified the bug. As part of the quaternion calculations self.acc gets vector normalized. But when calculating position, we need to use the original un-normalized acc; this is no longer stored on self.acc because of python's passing by reference.

If you modify my script above like this:

def test(q_type):
    my_sensor = MyOwnSensor(in_data=copy.deepcopy(in_data), q_type=q_type, 
 calculate_position=True)
   # reset the acc as it has now been overwritten by vector normalized acc
    my_sensor.acc = imu['gia']
    # Use the true quat not the estimated one, to isolate errors to the position calculations
    my_sensor.quat = body['quat']
    # redo the position calculations with the proper acc and true quat
    my_sensor.calc_position()
    print(q_type + " pos")
    print(my_sensor.pos[-1])

Then you get:

actual pos
[0.873 0.436 0.218]
analytical pos
[0.873 0.436 0.218]
kalman pos
[0.873 0.436 0.218]
madgwick pos
[0.873 0.436 0.218]
mahony pos
[0.873 0.436 0.218]

These are the lines in imus.py that are corrupting the values of self.acc for madgwick and mahony:

            Acc = vector.normalize(self.acc)
            Mag = vector.normalize(self.mag)

Why kalman is also affected, I don't know.

from scikit-kinematics.

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.