About using imu_tools filters
Hi. I have a simple question about the usage of the filters included in imu_tools
(imu_complementary_filter
& imu_filter_madgwick
).
So far, I have succeeded in sending my IMU readings to ROS from an Arduino (at a rate of around 100Hz, publishing Accelerometer, Gyro and Magnetometer to ROS). Then, I created a node that takes that data and builds two messages (sensor_msgs::Imu
and sensor_msgs::MagneticField
respectively).
I put the accelerometer values in the linear_acceleration
field, the gyro in the angular_velocity
field and the magnetometer in the magnetic_field
. Additionally, I fill the covariance_matrices with 0, as I have no information about the covariances. Finally, on the orientation field, as my IMU does not produce an orientation estimate, I don't modify it and set orientation_covariance[0]=-1
, as suggested in the message definition.
However, when I plot the results the orientation values seem to jump a lot between 0 and 1, even with the IMU resting on the desk. I also tested the rviz plugin, but the box moves crazily, and I don't know what else to do.
Any idea on what am I doing wrong? I assumed the filters would take the available data fuse it and estimate the orientation quaternion. Am I right?
I tried with both filters, and couldn't get the IMU to work/display properly. Am I suppose to provide an estimation of the orientation to the filters?
I'm running Ubuntu 16.04 with ROS kinetic, and the IMU I'm using is a I2C LSM9DS0 from Adafruit.