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

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

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

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:

/bot1/amcl
/bot1/move_base
/bot1/robot_state_publisher
/bot2/amcl
/bot2/move_base
/bot2/robot_state_publisher
/gazebo
/gazebo_gui
/map_server
/rosout
/rviz

Running rostopic list results in the following:

/bot1/amcl_pose
/bot1/camera/parameter_descriptions
/bot1/camera/parameter_updates
/bot1/camera/rgb/camera_info
/bot1/camera/rgb/image_raw
/bot1/camera/rgb/image_raw/compressed
/bot1/camera/rgb/image_raw/compressed/parameter_descriptions
/bot1/camera/rgb/image_raw/compressed/parameter_updates
/bot1/camera/rgb/image_raw/compressedDepth
/bot1/camera/rgb/image_raw/compressedDepth/parameter_descriptions
/bot1/camera/rgb/image_raw/compressedDepth/parameter_updates
/bot1/camera/rgb/image_raw/theora
/bot1/camera/rgb/image_raw/theora/parameter_descriptions
/bot1/camera/rgb/image_raw/theora/parameter_updates
/bot1/cmd_vel
/bot1/imu
/bot1/initialpose
/bot1/joint_states
/bot1/move_base/current_goal
/bot1/move_base/goal
/bot1/move_base_simple/goal
/bot1/odom
/bot1/particlecloud
/bot1/scan
/bot2/amcl_pose
/bot2/camera/parameter_descriptions
/bot2/camera/parameter_updates
/bot2/camera/rgb/camera_info
/bot2/camera/rgb/image_raw
/bot2/camera/rgb/image_raw/compressed
/bot2/camera/rgb/image_raw/compressed/parameter_descriptions
/bot2/camera/rgb/image_raw/compressed/parameter_updates
/bot2/camera/rgb/image_raw/compressedDepth
/bot2/camera/rgb/image_raw/compressedDepth/parameter_descriptions /bot2/camera/rgb/image_raw/compressedDepth/parameter_updates
/bot2/camera/rgb/image_raw/theora
/bot2/camera/rgb/image_raw/theora/parameter_descriptions
/bot2/camera/rgb/image_raw/theora/parameter_updates
/bot2/cmd_vel
/bot2/imu
/bot2/initialpose
/bot2/joint_states
/bot2/move_base/current_goal
/bot2/move_base/goal
/bot2/move_base_simple/goal
/bot2/odom
/bot2/particlecloud
/bot2/scan
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/initialpose
/map ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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: http://wiki.ros.org/amcl

edit flag offensive delete link more

Comments

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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 739 times

Last updated: Jun 24 '19