I would like to spawn models and then delete them while running my python algorithm... but as I do I am only able to spawn the models, and delete the handles of these models the actual model stays in the gazebo world.
I'm using the following code to spawn the model,
os.system("rosrun gazebo spawn_model -file /opt/ros/electric/stacks/simulator_gazebo/gazebo_worlds/objects/small_sphere_1.urdf -gazebo -model p%s -x %s -y %s -z %s" %(index, particles[index,0], particles[index,1], particles[index,2]))
and using this code to delete the model,
os.system("rosservice call gazebo/delete_model '{model_name: p%s}'" %(index))
Is there anyway to clear the gazebo world of these objects using another command? These commands work the way I expect when I directly type them into the terminal but not when I use os.system()
Originally posted by ncr7 on ROS Answers with karma: 325 on 2012-08-06
Post score: 0