spawning similar robots in gazebo

asked 2022-09-02 07:02:31 -0600

M.IR gravatar image

updated 2022-09-02 07:05:41 -0600

hello. I am trying to spawn two similar robot at a time and the following is the launch file I wrote. the problem is that only first robot appears in gazebo and in the log file I got this error :"[rosout][INFO] 2022-09-02 13:56:55,036: Spawn status: SpawnModel: Failure - entity already exists." is there any specific setting for gazebo that can solve the problem of the problem has its roots somewhere else?

<launch>

<!-- launch the simulator world -->
<arg name="debug" default="false"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="pause" default="false"/>
<arg name="world" default="simulation" />
<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find rosbot_simulation)/worlds/$(arg world).world"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg pause)"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="headless" value="$(arg headless)"/>
    <arg name="verbose" value="true"/>
</include>

<!-- BEGIN ROBOT 1-->

<group ns="robot1"> <node name="robot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-x 0 -y 0 -z 0 -urdf -param robot_description1 -model rosbot "/> --> <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"> </node> </group>

<group ns="robot2"> <node name="robot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-x 1 -y 1 -z 0 -urdf -param robot_description2 -model rosbot "/> --> <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"> </node> </group> </launch>

edit retag flag offensive close merge delete

Comments

unfortunately the launch file is not posted completely, maybe there is a word count limitation

M.IR gravatar image M.IR  ( 2022-09-02 07:04:34 -0600 )edit

You have typing mistake at the end of <node> as "-->" which is commenting the line I suppose. Maybe removing this should fix your problem.

manzurmurshid gravatar image manzurmurshid  ( 2022-09-02 10:07:11 -0600 )edit

Yeah, thanks, you were right, to my surprise this typing mistake did not generate any error, fixing the mistake didn't change anything though; the problem is not figured out yet

M.IR gravatar image M.IR  ( 2022-09-02 14:09:41 -0600 )edit