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?
Asked by jwatson_utah_edu on 2016-08-05 18:31:25 UTC
Comments
Same problem with gazebo7 ROS indigo and Ubuntu 16.04
Asked by userk on 2017-02-13 14:38:15 UTC
There is likely a problem in
gazebo_ros_pkgs
. You might want to try posting an issue there.Asked by nkoenig on 2017-02-14 10:39:35 UTC
does it help to do this instead?
resp = del_model_prox(modelName)
Asked by wc-s on 2017-04-28 15:13:15 UTC