-
Notifications
You must be signed in to change notification settings - Fork 435
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
Z axis points downwards if magnetometer does not publish during some seconds #211
Comments
Did you have a look at the input topics of I could imagine something like this happening: magnetometer is unplugged -> no messages for 5 seconds -> Unfortunately the filter doesn't yet check for large time jumps forward. There is a function called |
Hi @mintar , Thanks for your input, it helped me to figure out what could be the issue. Indeed, no messages are sent when the magnetometer is unplugged. I will check the |
There's already an open PR (#200) about the adding forward jump checks to the checkTimeJump method. It got stalled because the author and I didn't agree on what the correct behaviour would be. If you want, you could pick it up, simplify and test it, so we can merge it. Alternatively, as a workaround, you can just set the |
Hi @mintar, I finally had the opportunity test your recommandation and heading seem to stay consistent. Forcing a constant_dt in madgwick configuration file (similar to the magnetometer's publisher frequency) seems to resolve the problem. Thank you for your help! |
Hi,
I am working with the imu_filter_madgwick package and have encountered some behavior that I do not understand.
Using the package with a magnetometer, we noticed that sometimes our robot's heading turns in the opposite direction when turning in place. After a certain delay, it returns to normal.
The issue seems to originate from the data published on /imu/data (output from the Madgwick filter), and it is observable in Rviz. To confirm this hypothesis, it is reproducible with another magnetometer we tested. Therefore, it confirms that the issue is not with the device itself but with our Madgwick filter configuration. I believe our IMU configuration is correct (Z is positive and points upwards).
For the record, here is our imu_filter_madgwick.yaml configuration:
To reproduce the issue:
You'll notice that the axis rotates when you plug it back in (the z-axis points downwards instead of upwards). It slowly returns to normal after some time. The longer you wait, the more disoriented it gets.
I have attached a video demonstrating the steps described above. Once I plug the magnetometer back in, you can see the axes are completely disoriented. Increasing the gain helps to recover faster, but I would prefer to avoid this disorientation altogether. Can you help me, please?
Screencast.from.10-10-2024.12.11.51.PM.webm
Thanks in advance,
Kind regrads,
Christophe
The text was updated successfully, but these errors were encountered: