How to run multiple Independent Gazebo instances on the same machine?
Hi all, I'm trying to run multiple independent Gazebo-ROS instances on the same machine so two or more remotely connected users can use it at the same time. I've read this answer about multiple ros masters and this one about multiple Gazebo instances.I've been following them with no success.
I've tried running two ros masters on different ports and launch a gazebo empty_world.launch on each one with different group namespaces as follows:
terminal 1: Run the first ros master: roscore -p 11312
terminal 2: Run test_A.launch: Where test_A.launch is the same as gazebo_ros empty_world.launch but adding a group ns="ns_A" and changing the node names as follows:
<launch>
<!-- these are the arguments you can pass this launch file, for example paused:=true -->
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<arg name="verbose" default="false"/>
<arg name="world_name" default="worlds/empty.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->
<!-- set use_sim_time flag -->
<group if="$(arg use_sim_time)">
<param name="/use_sim_time" value="true" />
</group>
<!-- set command arguments -->
<arg unless="$(arg paused)" name="command_arg1" value=""/>
<arg if="$(arg paused)" name="command_arg1" value="-u"/>
<arg unless="$(arg headless)" name="command_arg2" value=""/>
<arg if="$(arg headless)" name="command_arg2" value="-r"/>
<arg unless="$(arg verbose)" name="command_arg3" value=""/>
<arg if="$(arg verbose)" name="command_arg3" value="--verbose"/>
<arg unless="$(arg debug)" name="script_type" value="gzserver"/>
<arg if="$(arg debug)" name="script_type" value="debug"/>
<group ns="ns_A">
<!-- start gazebo server-->
<node name="gazebo_A" pkg="gazebo_ros" type="gzserver" respawn="false" output="screen"
args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) $(arg world_name)" />
<!-- start gazebo client -->
<node name="gazebo_gui_A" pkg="gazebo_ros" type="gzclient" respawn="false" output="screen"></node>
</group>
</launch>
terminal 3: Run the second ros master: roscore -p 11313
terminal 4: Run test_B.launch: Where test_B.launch is the same as gazebo_ros empty_world.launch but adding a group ns="ns_B" and changing the node names as follows:
<launch>
<!-- these are the arguments you can pass this launch file, for example paused:=true -->
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<arg name="verbose" default="false"/>
<arg name="world_name" default="worlds/empty.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->
<!-- set use_sim_time flag -->
<group if="$(arg use_sim_time)">
<param name="/use_sim_time" value="true" />
</group>
<!-- set command arguments -->
<arg unless="$(arg paused)" name="command_arg1" value=""/>
<arg if="$(arg paused)" name="command_arg1" value="-u"/>
<arg unless="$(arg headless)" name="command_arg2" value=""/>
<arg if="$(arg headless)" name="command_arg2" value="-r"/>
<arg unless="$(arg verbose)" name="command_arg3" value=""/>
<arg if="$(arg verbose)" name="command_arg3" value="--verbose"/>
<arg unless="$(arg debug)" name="script_type" value="gzserver"/>
<arg if="$(arg debug)" name="script_type" value="debug"/>
<group ns="ns_B">
<!-- start gazebo server-->
<node name="gazebo_B" pkg="gazebo_ros" type="gzserver" respawn="false" output="screen"
args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) $(arg ...