# Revision history [back]

### How does one use /gazebo/spawn_sdf_model ?

I'm trying to delete and respawn an SDF model as a (hopeful) work around to my problem here.

I'd like to use a rosservice so I can call it using a rospy.ServiceProxy.

For now, I'm just trying to get it to run from the command line:

$rosservice call /gazebo/spawn_sdf_model "model_name: 'joe' model_xml: '/home/benb/Dropbox/RoboticsResearch/WAMInProgress/tp/AllInOne/Trajectory_Phonebook/ros_stuff/src/iiim_wam_description/wam.sdf' robot_namespace: '' initial_pose: position: {x: 0.0, y: 0.0, z: 0.0} orientation: {x: 0.0, y: 0.0, z: 0.0, w: 0.0} reference_frame: ''"  I've tried using a few things for the model_xml argument: • The above is the absolute path to the sdf. • I've tried launching it from /home/benb/Dropbox/RoboticsResearch/WAMInProgress/tp/AllInOne/Trajectory_Phonebook/ros_stuff/src/iiim_wam_description/ with the argument model_xml: 'wam.sdf' • I've tried using the directory name iiim_wam_description • I've tried using the name specified in the model.config, iiim_ros_wam In all cases, I get the message: success: False status_message: GazeboRosApiPlugin SpawnModel Failure: input model_xml not SDF or URDF, or cannot be converted to Gazebo compatible format.  ### How does one use /gazebo/spawn_sdf_model ? I'm trying to delete and respawn an SDF model as a (hopeful) work around to my problem here. I'd like to use a rosservice so I can call it using a rospy.ServiceProxy. For now, I'm just trying to get it to run from the command line: $ rosservice call /gazebo/spawn_sdf_model "model_name: 'joe'
model_xml: '/home/benb/Dropbox/RoboticsResearch/WAMInProgress/tp/AllInOne/Trajectory_Phonebook/ros_stuff/src/iiim_wam_description/wam.sdf'
robot_namespace: ''
initial_pose:
position: {x: 0.0, y: 0.0, z: 0.0}
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 0.0}
reference_frame: ''"


I've tried using a few things for the model_xml argument:

• The above is the absolute path to the sdf.
• I've tried launching it from /home/benb/Dropbox/RoboticsResearch/WAMInProgress/tp/AllInOne/Trajectory_Phonebook/ros_stuff/src/iiim_wam_description/ with the argument model_xml: 'wam.sdf'
• I've tried using the directory name iiim_wam_description
• I've tried using the name specified in the model.config, iiim_ros_wam

In all cases, I get the message:

success: False
status_message: GazeboRosApiPlugin SpawnModel Failure: input model_xml not SDF or URDF, or cannot be converted to Gazebo compatible format.


It would be especially helpful if someone could give me pointers on doing this using the rospy ServiceProxy.