Closed tshaddix closed 7 years ago
I am working on this now. I get a problem that the data of any axis being perpendicular to the ground keep rotating. Have ever encountered this problem?
Hi, @lixuwork. Sounds very similar to my issue.
Gimbal Lock?
Hi @PaulStoffregen, I appreciate the help.
I just re-read over gimbal lock to make sure I'm familiar with the general concepts. Would this problem continue to persist over different trials and tests?
I've plotted out the raw data from each of the sensors and they all seem to be working as expected in terms of scale and orientation. Rotating/accelerating about each axis produces expected results from the sensor data.
Sadly, I can't look at this right now. Crazy busy with another urgent (and very late) project.
But at first glance, it sounds like gimbal lock, so maybe just a pointer to that well-known limitation of roll-pitch-yaw will help? That's all I can do at this moment.
@PaulStoffregen I appreciate the time you've spent! I'll dive in a bit more. Thanks!
gyro has error ? Is it calibrated? @ @tshaddix
Hi, @PaulStoffregen @tshaddix , I just meet the same problem. I use this filter to get the stable quaternion, but the result shows q0 keeps up and q1, q2, and q3 keeps down no matter what value the parameter "delta" is . When I convert the quaternion to euler angles(Raw, pitch, yaw), they keep up just like your data. Do you solve this problem?
Hi @marooncn . I ended up just going with an IMU that does all of the sensor fusion for you after I had so much trouble getting things to work out myself. Sorry - wish I could be more helpful!
@tshaddix Have you solved your problem yet? I think these code is wrong
mx = imu.calcMag(imu.my);
my = -imu.calcMag(imu.mx);
mz = imu.calcMag(imu.mz);
below is correction
mx = -imu.calcMag(imu.mx);
my = -imu.calcMag(imu.my);
mz = imu.calcMag(imu.mz);
Hi @HelenXR , thanks for following up on this. I never did get this working. Did you try this code on the same IMU type? I remember I had swapped those axises because of a mismatched coordinate system with the IMU (mentioned in the "Potential Problem Areas" section of this issue).
If that is the solution for this IMU, then that's wonderful :)
Hello, all! I've been trying to implement this filter for the last few days with troublesome results. I know this filter works, given the work by @PaulStoffregen and others who show it working well.
I have convinced myself that there must be something wrong with the scale and/or coordinate system input I'm giving the filter, as the readings from my IMU seem to be correct and stable. If this turns out to be the case, I'll be happy to put in the work to add comments or wiki pages describing the fix.
Background Info
update()
call)Here is a printout of the raw readings from my IMU given in x, y, z while sitting on a table:
And here are the values from the filter (the code looks very much like the example included in this repo):
As mentioned, this is with the IMU laying flat on the table.
Potential Problem Areas
This filter is pretty straight-forward in implementation, so I can really only see two areas where things can be going wrong: The coordinate system and the scaling.
The coordinate system for my IMU is a bit wonky, so I normalized it to a right-handed coordinate system. Here is the coordinate system out of the box:
(Note the polarity marker is rotated for the mag diagram)
Here is my normalization and scaling code (and the filter call):
The
calcX
calls are part of the IMU library, described in short:I tried to keep this short, and I appreciate any time anyone can spend on it. I'm also including the full sketch for context if needed.