Ask Your Question

Revision history [back]

You need to spawn the URDF file and after that your plugins/Robot models will be loaded into Gazebo simulator.

for instance in the launch file a robot attached with sensors can be initialized with ;

  <group if="$(arg load_robot_model)">
    <param name="robot_description"
           command="$(find xacro)/xacro --inorder $(find your_package)/urdf/robot.xacro" />
  </group>

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" 
        output="screen" respawn="false"
        args="-urdf
              -param robot_description
              -model your_robot
              -x 0
              -y 0
              -z 0"  
                 />

You need to spawn the URDF file and after that your plugins/Robot models will be loaded into Gazebo simulator.

for instance in the launch file a robot attached with sensors can be initialized with ;

  <group if="$(arg load_robot_model)">
    <param name="robot_description"
           command="$(find xacro)/xacro --inorder $(find your_package)/urdf/robot.xacro" />
  </group>

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" 
        output="screen" respawn="false"
        args="-urdf
              -param robot_description
              -model your_robot
              -x 0
              -y 0
              -z 0"  
  />