-
Notifications
You must be signed in to change notification settings - Fork 75
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
Extracting accuracy for accelerometer, gyroscope and magnetometer #100
Comments
I can only speak with any confidence about the gyro values but I suspect this carries across to the acc and compass values. The Gyro_accuracy is not the number which to scale the raw gyro values by, but is an expression of accuracy, between 0~3. The lowest accuracy is 0 and 3 is the highest. This is probably done to save space in data registers on the chip. This code implements the gyro scaling: In this code, agmt.fss.g is accessing the same data as your data->Gyro_Accuracy. Getting a value of 0 for the gyro accuracy is expected, though this isn't sufficient to say your implementation is working properly; that might require seeing the Gyro_Accuracy value change between 0 and 3 when loaded with other accuracy settings. Hope this helps a little. |
Hello again! I've found, oddly, that sometimes on startup (and very occasionally during operation), the data.Gyro_Accuracy term will begin to report a different value (in my case, erroneously reporting "0" when the true value is "3"), which does not correspond to an actual change in the resolution of the reported gyro values. This results in the gyro values suddenly changing in scale! I do not know how much this behavior is caused by my implementation of the gyro scaling vs. caused by the library. This has been a frustrating problem and my solve for now is to hardcode the gyro_accuracy number within my gyro scaling code, |
Thanks for your comments @SamuelHawkins. You wouldn't happen to know what the critical configuration is that has the DMP produce accuracy data for icm_20948_DMP_data_t data packets. The IMU is working however whenever I look in data.Quat9.Data.Accuracy the accuracy is 0. I should note that I've ported the Cpp code to C for an STM32. Example6_DMP_Quat9_Orientation.ino produces an accuracy reading in the 0 - 800 range however I get only 0. |
When you say "Example6_DMP_Quat9_Orientation.ino produces an accuracy reading in the 0 - 800 range" I assume you're referring to the output of this line, is that right? If so, I haven't played with that code, and I'm not sure at the minute what values are expected from it. I am accessing My best guess right now is that you are accessing one of many accuracy values within the data struct. I think that your accuracy value might act more like an error bar for the calculated headings, while the value I am accessing is an indicator of the resolution. If you want to produce values for accuracy like the example code, I would start by copying all the function calls within Hope this helps, and apologies if I have misunderstood you or misjudged your current issue. |
Hi Sam, yes I am referencing the line you've linked and yes as you say it's different to the In my ported STM version of Example 6 I manage to access and convert the quarternions to Euler's no problem but unfortunately accuracy is always 0. No doubt I've made a mistake in my porting from cpp to c but I am unsure where exactly haha. The configurations for the DMP firmware are fairly tedious. I am able to run an unsullied Example 6 on an Arduino with the IMU attached without issue. I wonder if the 2 bytes of heading accuracy (thank you for highlighting that comment) relates only to compass heading?? Especially since only DMP modes that use the magnetometer feature an accuracy field. My initialization function at the highest level looks like this:
And my test function looks like this:
|
Same issue, I've been wondering about the meaning of the accuracy number (data.Quat9.Data.Accuracy). the type is int16_t, so 16 bits. Did not have time to check but my guess is that bits 0 and 1 are for one modality (say accel), then bits 4 and 5 for the next (say gyro) and 8 and 9 for the last (say compass)? Not sure about the position of the bits used (seems reasonnable to space every 4 bits). One way to test would be to list all the observed values. |
I am unable to obtain the accuracy of the raw sensors despite having them enabled.
data->header
never has the header2 bit set and hence the values of the I have tried rolling back to the library version around when these answers were posted that list how to access these values but the result was the same. Forum Post.Has anyone been able to get non-zero values for
data->Accel_Accuracy
data->Gyro_Accuracy
data->Compass_Accuracy
using this library.
The text was updated successfully, but these errors were encountered: