pololu_open_imu's People
Forkers
patronne ismailugur07 tomas62 akaivola lzq888 helgenodland skislalom1 dethegeek damfal03 diegoag duckman01 bringfire moeburn antthom hustmrzhang alfalopez fonzule tperson56pololu_open_imu's Issues
"Init failure" - minIMU v5 not work?
is that part of the code
if (LSM303OBJ.init() == false) {
while (1) {
Serial.println("init failure");
delay(500);
}
}
use of Magdwick algorithm ?
Hello,
Quickly comparing Pololu_Open_IMU code with your OpenIMU generic library I don't find the code issued from Madgwick algorithm... Am I wrong or you've removed it for now ?
Maybe it is what you want to say in your TODO at the beginning of the file...
Can you clarify me on this point ?
Regards,
Jérémie
Some errors in the code and questions about the filter's operation
Hello @mikeshub!
When adapting this code to the LSM303
and L3DG20
sensors, I discovered a completely ineffective code.
By reviewing the lines of code
Pololu_Open_IMU/Pololu_Open_IMU.ino
Line 191 in e57681a
and
Pololu_Open_IMU/Pololu_Open_IMU.ino
Line 277 in e57681a
an oddity was found in this line and replaced with the following code.
gyroSumX += groRead[X_];
gyroSumY += groRead[Y_];
gyroSumZ += groRead[Z_];
and
acc_x = accScaled[X_];
acc_y = accScaled[Y_];
acc_z = accScaled[Z_];
respectively.
As a result, I compiled the code into firmware and output it to the plotter, I got reasonable pitch and roll angles, but I have drift.
Also, when changing the roll angle, there is no effect on the pitch angle.
But when I change the pitch angle more than 80
or -80
degrees, the roll angle begins to change.
I also found differences in calculating pitch and roll angles in radians based on quaternions.
Source:
Pololu_Open_IMU/Pololu_Open_IMU.ino
Line 313 in e57681a
Pololu_Open_IMU/Pololu_Open_IMU.ino
Line 319 in e57681a
Pololu_Open_IMU/Pololu_Open_IMU.ino
Line 324 in e57681a
My corrected code:
void GetPitch() {
// pitch = asin(2.0 * (q[0] * q[2] - q[1] * q[3]));
// pitchInRadians = asin(2.0 * (q0 * q2 - q3 * q1));
pitchInRadians = asin(2.0 * (q0 * q2 - q1 * q3));
pitchInDegrees = pitchInRadians * RAD_TO_DEG;
}
void GetRoll() {
// roll = atan2((q[0] * q[1] + q[2] * q[3]), 0.5 - (q[1] * q[1] + q[2] * q[2]));
// rollInRadians = atan2(2 * (q0 * q1 + q2 * q3),1 - 2.0 * (q1 * q1 + q2 * q2));
rollInRadians = atan2((q0 * q1 + q2 * q3), 0.5 - (q1 * q1 + q2 * q2));
rollInDegrees = rollInRadians * RAD_TO_DEG;
}
void GetYaw() {
// yaw = -atan2((q[1] * q[2] + q[0] * q[3]), 0.5 - (q[2] * q[2] + q[3] * q[3]));
// yawInRadians = atan2(2.0 * (q0 * q3 + q1 * q2),1 - 2.0 * (q2 * q2 + q3 * q3));
yawInRadians = -atan2((q1 * q1q2 + q0 * q3), 0.5 - (q2 * q2 + q3 * q3));
yawInDegrees = yawInRadians * RAD_TO_DEG;
if (yawInDegrees < 0){
yawInDegrees +=360;
}
if (yawInDegrees > 360){
yawInDegrees -=360;
}
}
void GetEuler() {
GetPitch();
GetRoll();
GetYaw();
}
As far as I understand, the author of the code does not support and does not respond to requests... this is of course very bad when a person’s work is forgotten and becomes moldy.
I wanted the code and the project to continue to live and benefit others.
Lots of Drift,YPR
Hi Mike, have been playing with your open and a V3. I have very large drift in Yaw and the pitch and roll are increasing (this is with the IMU sitting stationary)
I did find that my Z axias was -15726 +17611 = +1885/2 = +942, X = -59, Y = -277 .
I have tried with and without Merlins cal defines. I have also played with the accel scale factors, which enabled the roll or the pitch to stop increamenting but not both.
I have also tried changing the Mag gaus (is there a LSB offset to put in?) as well as the Accel g
Were did you get the Accel scale factor from? as it seems different from the data sheet, but this all could be due to me as l have limited programming skills.
What l did like was that compared to The Pololu AHRS which my V3 had up to +-15 yaw difference on some headings when tilted, with your code this was down to +-2, but the Yaw would start stable for a second or 2 then start drifting along with the Roll and Pitch.
Any guidance would be appreciated.
Regards Kevin
nan values when computining initial quaternion
Thank for sharing the sketch -- it's very usefull;
I'm randomly getting a NaN values on pitch,roll,yaw vector when computing initial values. Repeting the procedure till all the values are not NaN solves the problem somehow, but if its a bug? feature? how to solve it properly?
Open IMU not compatible with newest LSM303 and L3G libraries
This library does not work with MinIMU-9 v3 Gyro, Accelerometer, and Compass (L3GD20H and LSM303D Carrier) and the latest LSM303 and L3G libraries.
Question about reading fluctuations
Thanks for sharing your sketch.
Could you tell me what are normal fluctuations for an IMU laying flat on a table and not moving? My readings with your sketch have less fluctuation than with the MinIMU-9-Arduino-AHRS code, but I want to make sure I don't need to do further tuning. I did use the numbers from the calibration sketch.
0.5 degrees of drift per second on all 3 axes, regardless of orientation or calibration
I'm using the MiniIMU v3 with your code, it was working great for a while, but now suddenly all 3 axes are drifting at about 0.5 degrees per second, regardless of what orientation I hold the device in (suggesting it's not a mag calibration problem), and regardless of what values I enter in the mag calibration section (also suggesting it's not a mag calibration problem).
I have tried running the mag for cal code, copying the output into a text file, and entering that text file, along with my magnetic norm at my location, into the magneto program linked in the code. The 0's stayed close to 0, the 1's changed to around 0.15, and the offsets were between 20,000 and 50,000. This had absolutely no effect on the drift from the original 0's and 1's in the calibration section - still getting about 0.5 degrees of drift per second on all 3 axes.
I've tried different USB cables, I've tried different rooms of my house, I've tried different computers, but I'm always getting about 0.5 degrees of drift on all 3 axes.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.