How do I assign joint state publisher nodes to the correct namespaces?
I am trying to have multiple turtlebots navigate on a shared map. I used template codes from The Construct live class #64 along with my own gazebo launch file that spawns the three turtlebots. When I launch my navigation file, I get the following error:
RLException: roslaunch file contains multiple nodes named [/robot_state_publisher].
Please check all <node> 'name' attributes to make sure they are unique.
Also check that $(anon id) use different ids.
The traceback for the exception was written to the log file
I thought I could avoid this error by specifying a "multi_robot_name" as an argument in the launch file, but I still got the error. Here is the navigation launch file I tried to run. I am using ROS Melodic. Many thanks if someone knows how to correct this!
<launch>
<!-- Arguments -->
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="open_rviz" default="true"/>
<arg name="multi_robot_name" default=""/>
<arg name="move_forward_only" default="false"/>
<param name="/use_sim_time" value="true"/>
<!-- Run the map server -->
<node name="map_server" pkg="map_server" type="map_server" args="/home/in/sandbox.yaml">
<param name="frame_id" value="map" />
</node>
<!-- Properties of each robot -->
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
<arg name="multi_robot_name" value="robot1/" />
<arg name="model" value="waffle_pi" />
</include>
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
<arg name="multi_robot_name" value="robot2/" />
<arg name="model" value="waffle_pi" />
</include>
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
<arg name="multi_robot_name" value="robot3/" />
<arg name="model" value="burger" />
</include>
<!-- AMCL -->
<include file="$(find MoveOneOfThree)/launch/amcl_robot1.launch"/>
<include file="$(find MoveOneOfThree)/launch/amcl_robot2.launch"/>
<include file="$(find MoveOneOfThree)/launch/amcl_robot3.launch"/>
<!-- MOVE_BASE-->
<include file="$(find MoveOneOfThree)/launch/move_base_1.launch" />
<include file="$(find MoveOneOfThree)/launch/move_base_2.launch" />
<include file="$(find MoveOneOfThree)/launch/move_base_3.launch" />
Here is one of the three AMCL files:
<launch>
<arg name="use_map_topic" default="false"/>
<arg name="scan_topic" default="/robot1/scan"/>
<arg name="initial_pose_x" default="0.0"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>
<arg name="odom_frame_id" default="/robot1/odom"/>
<arg name="base_frame_id" default="/robot1/base_footprint"/>
<arg name="global_frame_id" default="map"/>
<node pkg="amcl" type="amcl" name="robot1_amcl">
<param name="use_map_topic" value="$(arg use_map_topic)"/>
<!-- Publish scans from best pose at a max of 10 Hz -->
<param name="odom_model_type" value="diff"/>
<param name="odom_alpha5" value="0.1"/>
<param name="gui_publish_rate" value="10.0"/>
<param name="laser_max_beams" value="60"/>
<param name="laser_max_range" value="12.0"/>
<param name="min_particles" value="500"/>
<param name="max_particles" value="2000"/>
<param name="kld_err" value="0.05"/>
<param name="kld_z" value="0.99"/>
<param name="odom_alpha1" value="0.2"/>
<param name="odom_alpha2" value="0.2"/>
<!-- translation std dev, m -->
<param name="odom_alpha3" value="0.2 ...