Deleting Gazebo model causes Python to freeze
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
# FREEZES EITHER WAY
del_model_prox(modelName) # Remove from Gazebo
There is no feedback from ROS / Gazebo as to what is happening. Why does this happen?
Same problem with gazebo7 ROS indigo and Ubuntu 16.04
There is likely a problem in `gazebo_ros_pkgs`. You might want to try posting an issue there.
does it help to do this instead? resp = del_model_prox(modelName)