ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Deleting Gazebo model causes Python to freeze

asked 2016-08-05 18:41:25 -0600

jwatson_utah_edu gravatar image

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) # Handle to 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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-13 15:49:44 -0600

UserK gravatar image

I had the same problem. Make sure you are passing to the service a string. use str(modelName) instead

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-08-05 18:41:25 -0600

Seen: 1,193 times

Last updated: Feb 13 '17