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

Quaternion Output? #2

Open
da40flyer opened this issue Feb 10, 2020 · 15 comments
Open

Quaternion Output? #2

da40flyer opened this issue Feb 10, 2020 · 15 comments

Comments

@da40flyer
Copy link

Hello,
Does this library output the game rotation vectors as quaternions?

Please excuse my ignorance, I am relatively new to coding.

My goal is to find a way to just output the game rotation vectors as a W, X, Y, Z quaternion. I have been scouring the web for days looking for info and so far have been unsuccessful in finding anything.

I appreciate any help you can provide.

@ericalbers
Copy link
Owner

Yes, the game rotation output is a quaternion

@da40flyer
Copy link
Author

I sent you an email to your listed junk@ericalbers.com address....

@SL06
Copy link

SL06 commented Mar 17, 2020

Hi, thanks for sharing your program.
The ICM-20948 report game rotation vector (6 axis squat style) and rotation vector (9 axis squat style) but they are not equivalent to the MPU9250 quaternion. GRV and RV are signed value, but standard Quat. Does anyone now's how to transform RV to quat ? I could not found the answer on the web. Thanks

@SL06
Copy link

SL06 commented Mar 18, 2020

Forget my previous comment. Game rotation vectors are 6 axis quaternion. Rotation vectors are 9 axis quaternion. I am using MPUTeapot to test the quaternions. Quat9 take few seconds to calibrate, you have to turn the sensor in figure 8, and stabilized faster than the MPU9250. Thanks for your work.

@SL06
Copy link

SL06 commented Feb 24, 2021 via email

@gunarkroeger
Copy link

Sorry, I found out how the value is used and deleted my post. One other question I have is that the quaternion it is flickering sometimes. I found that it is actually happening with the sensor values directly from the dmp:
image

@gunarkroeger
Copy link

This is the Game Rotation Vector I'm getting from the library. Any idea why it has these problems?
image

@SL06
Copy link

SL06 commented Feb 24, 2021 via email

@gunarkroeger
Copy link

it's directly printed through the serial line, and other data is not corrupt. The magnitude of the quaternion is always 1, except when it glitches, where it got as high as 8.9999. The glitches are happening with 2 different nrf52 + icm20948 boards. Can you confirm that you see smooth values in your setup?

@SL06
Copy link

SL06 commented Feb 24, 2021 via email

@gunarkroeger
Copy link

Interesting. I am using C++ but with the PlatformIO + VS Code. It is not an issue with the Serial. the baudrate is actually not relevant for the nrf52 bc it is actually USB. and the rest of the data, like headers, never arrive corrupted. It could be an issue with i2c, but my colleague in another country has the same problem with different computer, different everything. So it must be code.
I enabled the mag, acc, gyr and the game rotation vector only, all at ODR 5 (200Hz). Maybe it cannot keep up when polling so fast?
At some point we need to use the interrupt correctly, but the code was commented out in this library and I'm not totally sure how to implement it.

@SL06
Copy link

SL06 commented Feb 24, 2021 via email

@gunarkroeger
Copy link

I'm using the Adafruit ItsyBitsy. The baudrate argument is just being voided in the Serial initialisation bc the board uses native USB instead of a serial2usb converter. I reduced the ODR and the issue happens less often. It seems to be a problem with i2c not being fast enough, at least the way it is implemented now. I read on another issue here that they had to change to SPI bc i2c was not fast enough for 200Hz ODR.

Calling the inv_icm20948_poll_sensor function is taking a lot of time and is not consistent (from 1.6ms to 5ms). I wonder if it is waiting for new data when it is still not available bc the interrupts are not being used.

@SL06
Copy link

SL06 commented Feb 24, 2021 via email

@SL06
Copy link

SL06 commented Feb 25, 2021 via email

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

4 participants