How multiple robots share a map?
I was following the instruction in this post
https://answers.ros.org/question/41433/multiple-robots-simulation-and-navigation/#261902
and I was able to launch 3 robots in the environment. the only problem is they can not use the map. I tested the map before using one robot and it worked.
does any one have an idea what could be the problem ??
the warning appears:
[ WARN] [1520822669.083386275, 5.051000000]: Request for map failed; trying again...
[ WARN] [1520822669.111106811, 5.078000000]: Timed out waiting for transform from robot2_tf/base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.1 timeout was 0.1.
[ WARN] [1520822669.115123720, 5.082000000]: Timed out waiting for transform from robot1_tf/base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.103 timeout was 0.1.
[ WARN] [1520822669.133585376, 5.100000000]: Timed out waiting for transform from robot3_tf/base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.103 timeout was 0.1.
and these are the launch files I am using:
1st: one_robot.launch
<launch>
<arg name="robot_name"/>
<arg name="init_pose"/>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
args="$(arg init_pose) -param /robot_description -urdf -model $(arg robot_name) " />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
</launch>
2nd: robots.launch
<launch>
<!-- No namespace here as we will share this description.
Access with slash at the beginning -->
<param name="robot_description" textfile="$(find robot_description)/urdf/myrobot.urdf" />
<!-- BEGIN ROBOT 1-->
<group ns="robot1">
<param name="tf_prefix" value="robot1_tf" />
<include file="$(find robot_description)/launch/one_robot.launch" >
<arg name="init_pose" value="-x 0 -y 1 -z 0" />
<arg name="robot_name" value="Robot1" />
</include>
</group>
<!-- BEGIN ROBOT 2-->
<group ns="robot2">
<param name="tf_prefix" value="robot2_tf" />
<include file="$(find robot_description)/launch/one_robot.launch" >
<arg name="init_pose" value="-x 0 -y -1 -z 0" />
<arg name="robot_name" value="Robot2" />
</include>
</group>
<!-- BEGIN ROBOT 3-->
<group ns="robot3">
<param name="tf_prefix" value="robot3_tf" />
<include file="$(find robot_description)/launch/one_robot.launch" >
<arg name="init_pose" value="-x 0 -y -0 -z 0" />
<arg name="robot_name" value="Robot3" />
</include>
</group>
</launch>
3rd: move_base
<launch>
<!--- Run AMCL -->
<include file="$(find amcl)/examples/amcl_diff.launch" />
<!-- Define your move_base node -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find robot_description)/src/costmap_common_params.yaml" command="load" ns="global_costmap"/>
<rosparam file="$(find robot_description)/src/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find robot_description)/src/local_costmap_params.yaml" command="load" />
<rosparam file="$(find robot_description)/src/global_costmap_params.yaml" command="load" />
<rosparam file="$(find robot_description)/src/base_local_planner_params.yaml" command="load" />
<remap from="map" to="map" />
</node>
</launch>
4th: robots_nav.launch
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
</include>
<!-- start the world -->
<node name="spawn_model1" pkg="gazebo_ros" type="spawn_model"
args="-sdf -file $(find robot_description)/urdf/wall.sdf -x 0 -y 0 -z 0 -model wall"/>
<!-- include our robots -->
<include file="$(find robot_description)/launch/robots.launch"/>
<!--Run the map server-->
<node name="map_server" pkg="map_server" type="map_server" args="$(find robot_description)/maps/map.yaml" respawn="false" >
<param name="frame_id" value="/map" />
</node>
<group ns="robot1">
<param name="tf_prefix" value="robot1_tf" />
<param name="amcl/initial_pose_x" value="0" />
<param name="amcl/initial_pose_y" value="1" />
<include file="$(find robot_description)/launch/move_base.launch" />
</group>
<group ns="robot2">
<param name="tf_prefix" value="robot2_tf" />
<param name="amcl/initial_pose_x" value="0" />
<param name="amcl/initial_pose_y" value="-1" />
<include file="$(find robot_description)/launch/move_base.launch" />
</group>
<group ns="robot3">
<param name="tf_prefix" value="robot3_tf" />
<param name="amcl/initial_pose_x" value="0" />
<param name="amcl/initial_pose_y" value="0" />
<include file="$(find robot_description)/launch/move_base.launch" />
</group>
</launch>
Asked by nora on 2018-03-11 21:05:41 UTC
Comments
Can you please post your launch files?
Asked by jayess on 2018-03-11 21:16:14 UTC
Why did you delete this question? And why did you post 2 duplicates of it then afterwards?
Asked by gvdhoorn on 2018-03-12 04:31:13 UTC
I don't know why put when I copy the warning msg. it appears only in editing mode. after posting it does not. I though there was a problem. and tried posting it a gain but the same thing happend.
Asked by nora on 2018-03-12 13:21:11 UTC
So this question is basically ok? Can you close/delete the other ones? Then I'll undelete this one.
re: disappearing warning msg: you need to format your text propely using the Preformatted Text button (the one with
101010
on it). Otherwise the warning/error msgs get filtered out.Asked by gvdhoorn on 2018-03-12 13:25:26 UTC
I've updated your question text with the correct formatting, but please do it yourself next time.
Asked by gvdhoorn on 2018-03-12 13:26:59 UTC
Hi im having the same issue. Have you fixed the problem?
Asked by topkek on 2018-06-25 10:43:55 UTC