What transforms do I need to publish in order to make robot_pose_ekf and slam_gmapping happy?

asked 2014-03-12 17:59:57 -0500

acarrillo gravatar image

updated 2016-10-24 08:36:22 -0500

ngrennan gravatar image

Or, put differently, what does a correct tf graph look like if I am using robot_pose_ekf and slam_gmapping?

I have been trying to use robot_pose_ekf to integrate my wheel odometry and IMU data for slam Gmapping. I am confused by all of the transforms that occur within the nodes I am running, and by the transforms that I am expected to establish myself. My maps look bad, but I cannot tell whether it is because my TFs are all wrong, but it has been difficult to find online precisely what TFs I need to establish in order for robot_pose_ekf and slam_gmapping to do their job.

I have the following topics:

  • topic /odom published by node segway_rmp_node with frame_id odom and child_frame_id base_link
  • topic /imu_data published by vn_sensor_msgs with frame_id LLA
  • topic /scan published by urg_node with frame_id laser

Right out of the gate, segway_rmp_node invokes tf to generate a transform from odom to base_link. This is the point at which I get confused. What transforms do I need to make in order to make robot_pose_ekf and slam_gmapping happy?

I figure that I ought to relate base_footprint with base_link, base_link with LLA, and base_link with laser. However, given the launch file below, this generates no map at all. So I replace base_link with base_footprint, but that yields warnings that there is no relation between base_link and map or odom to map. Whose job is it to generate that tf?

My launch file is below:

    <node pkg="vectornav" type="vn200_node" name="vectornav_vn200" />
    <node pkg="vectornav" type="vn_sensor_msgs.py" name="vn_sensor_msgs" args="Imu:=imu_data" />
    <node pkg="segway_rmp" type="segway_rmp_node" name="segway_rmp_node" args="_serial_port:=/dev/ttyUSB1 /segway_rmp_node/odom:=/odom" />

    <node pkg="urg_node" type="urg_node" name="short_range_laser">
        <param name="angle_min" value="-1.571" />
        <param name="angle_max" value="1.571" />

    <node pkg="tf" type="static_transform_publisher" name="base_footprint_LLA_tf" args="0 0 0.25 0 0 0 base_footprint LLA 1000" />
    <node pkg="tf" type="static_transform_publisher" name="laser_base_tf" args=".553 .114 .342 0 0 0 base_footprint laser 1000" />
    <node pkg="tf" type="static_transform_publisher" name="basefoot_baselink" args="0 0 0.25 0 0 0 base_footprint base_link 1000" />

    <node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf"/>
    <node pkg="gmapping" type="slam_gmapping" name="mapping">
        <param name="odom_frame" value="odom_combined" />
    <node pkg="teleop_twist_joystick" type="teleop_twist_joystick.py" name="teleop_twist_joystick"/>
    <node pkg="rviz" type="rviz" name="rviz"/>

edit retag flag offensive close merge delete


Just stumbled upon this as an unanswered question. Did you find a solution or is this still relevant for you?

demmeln gravatar image demmeln  ( 2014-03-28 01:14:57 -0500 )edit

rosrun tf view_frames to see if you have a proper tf tree

aswin gravatar image aswin  ( 2014-05-12 16:38:15 -0500 )edit