Closed tfx2001 closed 2 years ago
When I use get_gyro()
, the range of results looks a bit strange. Then I tried to derive it myself and found that it was a algorithm problem.
After this change, I use the result in Madgwick fusion and it works good.
How did you setup madgwick fusion and/or could you post before and after? Thanks!
Which revision of the manual did you get the image above from? Or is it some other source?
How did you setup madgwick fusion and/or could you post before and after? Thanks!
Which revision of the manual did you get the image above from? Or is it some other source?
I'm sorry, I don't have a record of before and after changes. And the formula above is my own derivation. If I have misunderstood, please point it out and apologize for that.
no worries, I am not 100% sure myself.
Which madgwick filter package did you use? I'll check it out as soon as I can, prob Christmas Break
perfekt, thank you!
Can you please still push this branch to master, and push to crates.io?
You are absolutely correct in your assessment @tfx2001.
The confusion for me arose in the way I apply "sensitivity", basically the inverse "resolution".
According to the datasheet, depending on the scale configuration of the gyroscope, the data needs to be scaled, like this:
250DPS => 250.0 / 32768.0,
500DPS => 500.0 / 32768.0,
1000DPS => 1000.0 / 32768.0,
2000DPS => 2000.0 / 32768.0,
RAW_DATA * (!) FACTOR
is the default scaling. I tried to save some calculations and saved results of this scaling factor as the "sensitivity"
// 32768.0 / 250.0, ....
pub const GYRO_SENS: (f32, f32, f32, f32) = (131., 65.5, 32.8, 16.4);
of course, this "sensitvity" must be applied my dividing, exactly as you have found.
Thanks again, I will merge and publish to crates.io.
done
What is your source for this change?