robot_localization: WARNING: could not obtain transform from map to odom. Error was Unable to lookup. Could not transform measurement into odom. Ignoring...
hello, I have a nomadic scout 2-wheel robot with a kinect sensor that is able to navigate inside a map by means of the ros (groovy) navigation stack. An odometry topic is provided by the robot, and the /odom --> /base_link transform too. I want to feed the ekf_localization node with the position the robot provided by our Vicon MoCap system, in order to fuse it with the odometry information. I have a map, provided by a map server, and the robot pose coming from Vicon is published as a PoseWithCovarianceStamped topic, with ref_frame_id = 'map'. So I want to use ekf_localization node in the second mode, with world_frame = 'map', and I expect the /map --> /odom tf from ekf_localization node. What I see is that ekf_localization node is publishing /odom --> /base_link transform too, overwriting the odometry-generated transform each other. So the ekf_localization node seems working in the first mode, and it does not sense the /odom --> /base_link tf, already published by the robot.
this is my ekf launch file:
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="0.1"/>
<param name="two_d_mode" value="true"/>
<param name="pose0" value="/scoutPose"/>
<param name="odom0" value="/odom"/>
<rosparam param="pose0_config">[true, true, false, true, true, true, false, false, false, false, false, false]</rosparam>
<rosparam param="odom0_config">[true, true, false, true, true, true, false, false, false, false, false, false]</rosparam>
<param name="pose0_differential" value="true"/>
<param name="odom0_differential" value="false"/>
<param name="debug" value="true"/>
<param name="debug_out_file" value="/home/robouser/debug_ekf_localization.txt"/>
<param name="map_frame" value="map"/>
<param name="world_frame" value="map"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<rosparam param="process_noise_covariance">[0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.00, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.05, 0.0, 0.0, 0.0,
0.0, 0 ...
Please post a sample message for every input topic. Also, how did you check that the EKF is also publishing the odom->base_link transform? Are you inferring that from the warning, or did you use another method?
I believe that the transform was being published, but what I'm not sure of is that the EKF was publishing it. Your odometry source will often broadcast that transform as well. If your
world_frame
is set to map, the EKF will not broadcast a transform from odom->base_link.With world_frame = map the ekf should publish the map --> odom transform. What happens is that it publishes odom->base_link transform instead. I am sure that EKF was publishing the odom->base_link transform, I checked with tf_monitor, rviz, rostopic echo...