I'm trying to launch two robots (panda and iiwa) under the same urdf spawner node. Both robots have a different robot description that I pass to the node as a parameter. My issue is that for some reason, gazebo only wants to show me the iiwa robot so there is something wrong. I have checked the nodes and parameters in the terminal and seems to be ok.Am I missing something¿?

My main.launch
<?xml version="1.0"?>

  <!-- Gazebo & GUI Configuration -->
  <arg name="debug" default="false"/>
  <arg name="gui" default="true"/>
  <arg name="paused" default="true"/>
  <arg name="world" default="$(find robot_ctrl)/world/worldTable.world"/>
  <arg name="controllers" default="joint_state_controller dual_cartesian_impedance_controller"/>
  <arg name="robot_name_right" default="panda" />
  <arg name="robot_name_left" default="iiwa" />
  <arg name="robot_state_frequency" default="100" />

  <!-- Robot Customization: PANDA -->
    <include file="$(find robot_ctrl)/launchDualControllers/launch_panda.launch">
      <arg name="x" value="0.6"/>
      <arg name="y" value="0"/>
      <arg name="z" value="0.5"/>
      <arg name="roll" value="0"/>
      <arg name="pitch" value="0"/>
      <arg name="yaw" value="3.1415"/>
      <arg name="paused" value="$(arg paused)"/>
      <arg name="arm_id_right" default="$(arg robot_name_right)" />
  <!-- Robot Customization: iiwa -->
    <include file="$(find robot_ctrl)/launchDualControllers/launch_iiwa.launch">
      <arg name="origin_xyz" default="'-0.6 0 0.5'"/> 
      <arg name="origin_rpy" default="'0 0 0'"/>
      <arg name="arm_id_left" default="$(arg robot_name_left)" />

     <!-- Spawn both robots -->
    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
          args="-urdf -model panda -param panda_robot_description
                -urdf -model iiwa -param iiwa_robot_description"/>

   <!-- World launch -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(arg world)"/>
    <arg name="debug" value="$(arg debug)"/>
    <arg name="paused" value="$(arg paused)"/>
    <arg name="gui" value="$(arg gui)"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="headless"    default="false" />

    <!-- Include the controller launch file 
    <include file="$(find robot_ctrl)/launchDualControllers/controllers.launch">
        <arg name="arm_id_right" default="$(arg robot_name_right)" />
        <arg name="arm_id_left" default="$(arg robot_name_left)" />
        <arg name="controllers" default="joint_state_controller dual_cartesian_impedance_controller"/>

my panda_launch is simple (I'm posting the launch part only):

<param name="panda_robot_description"
    command="xacro $(find franka_description)/robots/$(arg arm_id)/$(arg arm_id).urdf.xacro
            hand:=$(arg use_gripper)
            arm_id:=$(arg arm_id)
            xyz:='$(arg x) $(arg y) $(arg z)'
            rpy:='$(arg roll) $(arg pitch) $(arg yaw)'
            $(arg xacro_args)">

my iiwa launch:

<!-- Load the URDF with the given hardware interface into the ROS Parameter Server -->
    <param name="iiwa_robot_description" command="$(find xacro)/xacro '$(find iiwa_description)/urdf/iiwa14.urdf.xacro' hardware_interface:=$(arg hardware_interface) robot_name:=$(arg robot_name_left)   origin_xyz:=$(arg origin_xyz) origin_rpy:=$(arg origin_rpy)"/>

my rosparam list shows /iiwa_robot_description and /panda_robot_description:


my launch shows the node:


 * /arm_id: panda
 * /franka_gripper/arm_id: panda
 * /franka_gripper/finger1/gains/d: 1.0
 * /franka_gripper/finger1/gains/i: 0
 * /franka_gripper/finger1/gains/p: 100
 * /franka_gripper/finger2/gains/d: 1.0
 * /franka_gripper/finger2/gains/i: 0
 * /franka_gripper/finger2/gains/p: 100
 * /franka_gripper/type: franka_gazebo/Fra...
 * /gazebo/enable_ros_network: True
 * /iiwa_robot_description: <?xml version="1....
 * /m_ee: 0.76
 * /panda_robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.16.0
 * /singularity_warning_threshold: 0.0001
 * /tau_ext_lowpass_filter: 1.0
 * /use_sim_time: True

    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    urdf_spawner (gazebo_ros/spawn_model)

but for some reason if I do a rosnode list is not showing anything but /gazebo and /rosout I dont understand what I'm missing.


1 Answer 1


Try to include the panda robot initial pose as an argument of the spawn node.

<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
           args="-urdf -model panda -param panda_robot_description
                 -urdf -model iiwa -param iiwa_robot_description -x $(arg x) -y $(arg y) -z $(arg z) -Y $(arg yaw) -R $(arg roll) -P $(arg pitch)"/>

Place the initial pose the panda robot as an argument of the urdf_spawner node. Change that and see if it works.

  • $\begingroup$ I tried as you say but is not working, it seems that only loads the last robot (iiwa robot). I reorganized the code to be easier to analyze and follow: $\endgroup$
    – mikel lasa
    Mar 22 at 9:47
  • $\begingroup$ Try to spawn both robots on separate nodes. Check as well the respawn flag. $\endgroup$ Mar 24 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.