ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosservice call /gazebo/spawn_urdf_model error. How to use this service correctly?

asked 2020-05-23 05:05:50 -0500

Vicky410 gravatar image

updated 2020-07-26 07:31:20 -0500

Hi I am new to ROS. I need to spawn a model in gazebo by calling spawn_urdf_model service in a terminal. When I call it I got this error.

$ rosservice call /gazebo/spawn_urdf_model "model_name: 'e_pmm1'
model_xml: '/home/rosi/pro_ws/src/jnj/urdf/pmm1.urdf'
robot_namespace: ''
initial_pose:
  position: {x: 1.0, y: 0.0, z: 0.0}
  orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
reference_frame: 'world'" 
ERROR: service [/gazebo/spawn_urdf_model] responded with an error:

In the terminal where I launch gazebo world I got this error

[ERROR] [1590224787.297184677, 22524.557000000]: SpawnModel: Failure - entity format is invalid.

Is it because of the model_xml? How can I make it right?

Here is my urdf file

 <?xml version="1.0" encoding="UTF-8" ?>
 <robot name="e_pmm1" xmlns:xacro="http://ros.org/wiki/xacro">
 < link name ="pmm1_link"> 
     <collision>
       <origin xyz="0 0 0.015" rpy="0 0 0"/>
       <geometry>
             <mesh filename="package://jnj/urdf/meshes/pmm1.dae"/>
       </geometry>
     </collision>
     <visual>
        <origin xyz="0 0 0.015" rpy="0 0 0"/>
        <geometry>
              <mesh filename="package://jnj/urdf/meshes/pmm1.dae"/>
        </geometry>
     </visual>
     <inertial>
            <origin xyz="0 0 0" />
            <mass value="0.088" />
            <inertia ixx="1.966873333E-4" ixy="0.0" ixz="0.0" iyy="6.858206667E-4" iyz="0.0" izz="5.0233333333E-4" />
     </inertial>
  </link>  
  <gazebo reference="pmm1_link">
    <gravity>1</gravity>
      <kp>1000000.0</kp>
      <kd>1000000.0</kd>
      <mu1>0.1</mu1>
      <mu2>0.1</mu2>
  </gazebo>
 </robot>

Any help would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-07-24 08:53:56 -0500

Vicky410 gravatar image

I got it. I need to either write a helper script.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-23 05:05:50 -0500

Seen: 813 times

Last updated: Jul 26 '20