Deleting Gazebo model causes Python to freeze

asked 2016-08-05 18:31:25 -0500

jwatson_utah_edu gravatar image

updated 2016-08-05 18:32:02 -0500

Indigo on Ubuntu 14.04 with Gazebo 7.3 and Python 2.7

Whenever I call the Gazebo model deletion service, Python freezes. No errors or special messages appear when the deletion code runs. This happens whether I wait for the service to become available or not. I checked that the model name is correct.

from gazebo_msgs.srv import DeleteModel # For deleting models from the environment

def del_model( modelName ): # FIXME: Freezes Python, DO NOT USE!
    """ Remove the model with 'modelName' from the Gazebo scene """
    # delete_model : gazebo_msgs/DeleteModel
    del_model_prox = rospy.ServiceProxy('gazebo/delete_model', DeleteModel) # model spawner
    # rospy.wait_for_service('gazebo/delete_model') # Wait for the model loader to be ready 
    del_model_prox(modelName) # Remove from Gazebo

There is no feedback from ROS / Gazebo as to what is happening. Why does this happen?

edit retag flag offensive close merge delete


Same problem with gazebo7 ROS indigo and Ubuntu 16.04

userk gravatar imageuserk ( 2017-02-13 13:38:15 -0500 )edit

There is likely a problem in `gazebo_ros_pkgs`. You might want to try posting an issue there.

nkoenig gravatar imagenkoenig ( 2017-02-14 09:39:35 -0500 )edit

does it help to do this instead? resp = del_model_prox(modelName)

wc-s gravatar imagewc-s ( 2017-04-28 15:13:15 -0500 )edit