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

/map not connecting to tf links for loading multiple robots in rviz

asked 2019-06-20 05:08:34 -0600

apletta gravatar image

I am trying to load two robots in Gazebo and visualize them in Rviz to eventually do a leader-follower application. I believe I have the robots initialized in Gazebo correctly and mostly in Rviz, but am having trouble getting the /map topic to link up to either of the robots. I can teleop with the robots separately in Gazebo using their respective namespaces. I am simulating using a turtlebot3 waffle_pi. I'm thinking the problem has something to do with remapping from "map" to "/map" or in how my amcl node is called under the tf_prefixes for my two robots.

From running rosrun rqt_graph rqt_graph I can see that both of my two robots are initialized with their respective connections to /tf and /gazebo. (would upload output image but not enough user points).

From running rosrun tf view_frames I can see that both robots have root parents of "bot1_tf/odom" and "bot2_tf/odom" where "botX_tf" is the tf_prefix. The children connections seem to match output from running a single robot in Gazebo/Rviz. The only thing different seems to be that "/map" is the parent for "/odom" for the single robot, while there is no "/map" parent for the two robots.

Upon loading Rviz I see a green check next to URDF making me thing Rviz is reading in the model correctly, though all other tf topics have errors. When I manually enter either tf_prefix in the "TF Prefix" field in Rviz under "RobotModel" I see errors saying "No transform from [tf_prefix/base_footprint] to [map]" and so on for the other tf topics (base_footprint, base_link, base_scan, camera_link, camera_rgb_frame, camera_rgb_optical_frame, caster_back_left_link, caster_back_right_link, imu_link, wheel_left_link, wheel_right_link).

Running rosnode list results in the following:


Running rostopic list results in the following:

/bot2/camera/rgb/image_raw/compressedDepth/parameter_descriptions /bot2/camera/rgb/image_raw/compressedDepth/parameter_updates
/map ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-24 12:20:56 -0600

FOXTER gravatar image

I think it is because amcl is still looking relative to the namespace for the map (because it is using the service "static_map" per default). Try adding either <param name="use_map_topic" value="true"/> or <remap from="static_map" to="/static_map" />to the amcl.launch file, depending on which method for getting the map you want to use. The /map topic is only used when the "use_map_topic" parameter is true. You can see more here:

edit flag offensive delete link more


Tried both of those, neither seemed to successfully link move_base to /map. Using either of those options, and only one at a time, resulted in the following tf_graph with no /map connection to amcl. I also got that same result when adding both together. What seems to be a step in the right direction is including both but using "map" and "/map" instead of "static_map" and "/static_map". So, adding both of the following lines

<param name="use_map_topic" value="true" />
<remap from="map" to="/map" />

Gives the following tf_graph with /map connected to amcl.

In all cases the nodes were all still connected from tf_prefix/odom and down, but without a top connection to /map, see the tf tree here

Do you think there's more I'd need to do in the move_base launch file?

apletta gravatar image apletta  ( 2019-06-25 02:10:25 -0600 )edit

Question Tools

1 follower


Asked: 2019-06-20 05:08:34 -0600

Seen: 722 times

Last updated: Jun 24 '19