Problem when fusing IMU and Odometry
Hi, I am trying to use robot localization to fuse the data from an XSense IMU and Odometry Source (Pioneer). The output is not what i expect actually. The resulting odometry looks similar (almost exact) to the odometry of the pioneer? So the filter is not improving or at least changing the result?
This is my launch file:
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="0.1"/>
<param name="base_link_frame" value="base_footprint"/>
<param name="two_d_mode" value="true"/>
<param name="imu0" value="imu/data"/>
<rosparam param="imu0_config">[false, false, false,
false, false, true,
false, false, false,
false, false, false,
false, false, false]</rosparam>
<param name="imu0_differential" value="true"/>
<param name="imu0_remove_gravitational_acceleration" value="false"/>
<param name="odom0" value="/odom/fixed_wheel"/>
<rosparam param="odom0_config">[true, true, false,
false, false, true,
false, false, false,
false, false, false,
false, false, false]</rosparam>
<param name="odom0_relative" value="true"/>
<param name="imu0_relative" value="true"/>
Here is an sample bagfile together with robot localization: https://www.dropbox.com/s/kalrug9s48j5w3x/odom_imu_fuse.bag?dl=0
Topic: /imu/data == xsense imu data
Topic: /odom/fixed_wheel == pioneer improved odometry (by hand added covariances)
Topic: /odom/ukf == current results of robot localization
Topic: /scan/sick == laser scanner for reference
Topic: /tf
Topic: /tf_static
Here is the same bagfile without robot localization: https://www.dropbox.com/s/01xtvgmv7gchb63/odom_imu_unfused.bag?dl=0 --- Update ---
I added this fixed odometry covariance:
odom.pose.covariance = boost::assign::list_of(1e-2) (0) (0) (0) (0) (0)
(0) (1e-2) (0) (0) (0) (0)
(0) (0) (1e6) (0) (0) (0)
(0) (0) (0) (1e6) (0) (0)
(0) (0) (0) (0) (1e6) (0)
(0) (0) (0) (0) (0) (1e-3) ;
Maybe i am missing something obvious? Thanks in advance!
--- Update ---
I tried some different covariance matrices but nothing changed but when i changed my launch file like so:
<param name="imu0_differential" value="true"/>
<param name="odom0_differential" value="true"/>
then i got following result: image its an image, green is the wheel odometry and red the ukf result and blue is the ground truth (i know, really bad drawn^^)
What i do not understand is why the imu is making the result worse? This data is captures outside on a sidewalk, could this be a problem? I am pretty sure that the imu is directed in the right direction but it looks weird...
-- Update --
Here is the sample output of each source, first odometry, then imu:
header:
seq: 4343
stamp:
secs: 1464844455
nsecs: 543424495
frame_id: odom
child_frame_id: ''
pose:
pose:
position:
x: -68.2792701104
y: 122.427959131
z: 0.0
orientation:
x: 0.0
y: -0.0
z: -0.629156547298
w: -0.777278610919
covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0 ...
so you set the covariances of the Odometry by hand? How you do that. Are you actually calculating them or set them to a static value?
for the odometry i set the covariance to a static value, the imu was already publishing a covariance matrix
I think thats the main problem. What values did you choose? When you got small values in the covariancematrix of the odometry and high values in the imu covariancemartrix the robot_localisation will "trust" the odometry data much more than the imu data und so the imu data has almost no influence.
i added the covariance matrix to the question, i'll try some larger values and see how it performs
Please post a sample message from each input. I realize there's a bag, but it's often enough to just see the raw data. See my answer for more information, though.