Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in the calcQuaternion algorithm #9

Open
jtragtenberg opened this issue Nov 10, 2015 · 4 comments
Open

Bug in the calcQuaternion algorithm #9

jtragtenberg opened this issue Nov 10, 2015 · 4 comments

Comments

@jtragtenberg
Copy link
Collaborator

Hi there,
I've been all this time learning C++ and figuring out how the Motioner and RazorIMU libraries work.
I make my own prototyping board with just an arduino UNO soldered with a HMC8553L magnetometer and MPU6050 gyro+accel. I'm doing all my tests connecting the board through USB.
I made a code out of the Motioner.ino where in the loop() I just added the lines:

float qx = motioner.mRazorIMU.getQuatX();
float qy = motioner.mRazorIMU.getQuatY();
float qz = motioner.mRazorIMU.getQuatZ();
float qw = motioner.mRazorIMU.getQuatW();

Serial.print(qw);
Serial.print('|');
Serial.print(qx);
Serial.print('|');
Serial.print(qy);
Serial.print('|');
Serial.println(qz);

where the getQuat* functions I added are just:

float getQuatX() const { return quat.x; }
float getQuatY() const { return quat.y; }
float getQuatZ() const { return quat.z; }
float getQuatW() const { return quat.w; }

and I made the mRazorIMU object public on the Motioner class.

Out of this I noticed a bug in the angles as I tilt them, where the quaternions change sign for no reason...
I have calibrated my board with the IMUDebug.ino firmware and it all worked well in the IMUvisualization Processing sketch.

here is what the serial monitor shows:
https://youtu.be/AYBm-mMuhkI

Does anyone know why this bug keeps bugging me?
Is this discontinuity and sign inversion expected?

thank you

@jtragtenberg
Copy link
Collaborator Author

Anyone?...

@jtragtenberg
Copy link
Collaborator Author

Has anyone an example of a Motioner IMU working just outputting the quaternion values ?
It really seems to me that the bug is in the calcQuaternion algorithm, the Gamasutra code that transforms the Matrix into quats....

@skistua
Copy link

skistua commented Dec 15, 2015

you are right . It's wrong. Give me your email address . then I send your right one . it's project is long gone. Here is no one answer your question. @jtragtenberg

@jtragtenberg
Copy link
Collaborator Author

Hi there,

its [email protected]

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants