ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.

asked 2016-03-10 02:49:08 -0500

papaclaudia gravatar image

Hi! I would like to do an exploration. These are the steps I followed:

rosrun xv_11_laser_driver neato_laser_publisher _port:=/dev/ttyUSB0 _firmware_version:=2
rosrun tf static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms
roslaunch hector_slam_launch neato.launch

Because my neato.launch is:

<node pkg="xv_11_laser_driver" type="neato_laser_publisher" name="xv_11_node">
<param name="port" value="/dev/ttyUSB0"/>
<param name="firmware_version" value="2"/>
<param name="frame_id" value="laser"/>
<param name="baud_rate" value="115200"/>
<param name="pub_map_odom_transform" value="true"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="base_frame" />
<param name="odom_frame" value="base_frame" />
<param name="static_map" value="false"/>
<param name="map_pub_period" value="0.005" />
<param name="map_resolution" value="0.025" />
<param name="map_size" value="1024" />
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5"/>
<param name="map_update_distance_thresh" value="0.4"/>
<param name="map_update_angle_thresh" value="2"/>
<param name="map_multi_res_levels" value="3" />
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.9"/>
<param name="scan_subscriber_queue_size" value="5"/>
<param name="pub_map_scanmatch_transform" value="true"/>
<param name="output_timing" value="false" />
<param name="tf_map_scanmatch_transform_frame_name" value="scanmatcher_frame"/>
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 10"/>
<node pkg="tf" type="static_transform_publisher" name="base_frame_laser" args="0 0 0 0 0 0 /base_link /neato_laser 10"/>
<node pkg="rviz" type="rviz" name="rviz"
args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>
<include file="$(find hector_mapping)/launch/mapping_default.launch"/><node pkg="rviz" type="rviz" name="rviz" args="-d rviz_cfg.rviz"/>
<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"/>

<arg name="trajectory_source_frame_name" default="/base_link"/>
<arg name="trajectory_update_rate" default="4"/>
<arg name="trajectory_publish_rate" default="0.25"/>

Then I type in the terminal:

rosrun hector_costmap hector_costmap
roslaunch hector_exploration_node exploration_planner.launch

I have this message:

[ WARN] [1457530291.227602967]: Could not get robot pose, cancelling reconfiguration
[ERROR] [1457530292.327489342]: Connectivity Error looking up robot pose: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.

My exploration_planner.launch is:

<!--launch-prefix="gdb -ex run ++args"-->
<node pkg="hector_exploration_node" type="exploration_planner_node" name="hector_exploration_node" output="screen">
<rosparam file="$(find hector_exploration_node)/config/costmap.yaml" command="load"/>
<node name="static_tf0" pkg="tf" type="static_transform_publisher" args="2 0 0 0 0 0 /map /base_link 100"/>
<node name="costmap_node" pkg="costmap_2d" type="costmap_2d_node">
<param name="global_frame" value="/map"/>
<param name="robot_base_frame" value="base_link"/>
<param name="transform_tolerance" value="0.2"/>
<param name="update_frequency" value="5.0"/>
<param name="publish_frequency" value="1.0"/>
<param name="rolling_window" value="false"/>
<param name="resolution" value="0.05"/>
<param name="publish_voxel_map" value="true"/>
<rosparam file="$(find costmap_2d)/launch/example_params.yaml" command="load" ns="costmap"/>

Where am I doing wrong? Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-03-10 06:25:32 -0500

papaclaudia gravatar image

I solved it by creating tf_listener2.cpp and tf_broadcaster2.cpp for the transformation /map->/base_link

edit flag offensive delete link more


Is it possible to look into your files?

pmuthu2s gravatar image pmuthu2s  ( 2018-10-22 18:01:29 -0500 )edit

Same, how did you call the lookupTransform()?

HaFred gravatar image HaFred  ( 2021-11-18 21:56:38 -0500 )edit

answered 2016-03-10 04:04:31 -0500

Have you tried running the command "rosrun tf view_frames" and looking at the frames.pdf file that it produces. This will show you how the frames you've setup are connected.

Hopefully this will make it easier to find the problem, having a quick look at your code I can't see anything obvious that would stop this working though.

edit flag offensive delete link more


Thank you for your answer! Yes, in frames.pdf I had see that map and base_link are not part of the same tree. I would create a connection with broadcaster like in this tutorial but I don't know how to do.

papaclaudia gravatar image papaclaudia  ( 2016-03-10 04:50:24 -0500 )edit

Question Tools

1 follower


Asked: 2016-03-10 02:49:08 -0500

Seen: 9,661 times

Last updated: Mar 10 '16