I have a slightly curious problem with /gazebo/delete_model service. I have a scene with some robots and spawn some simple boxes in runtime. Then to reset the environment, I call delete_model service for the objects as following.
for model_name in model_names:
rospy.loginfo(model_name)
try:
res = self.delete_service(model_name)
rospy.loginfo(res)
except Exception as exc:
rospy.loginfo("Service did not process request: " + str(exc))
If there are only 1-2 objects it works fine but if there are more the service freezes removes some of them and then freezes at a random object 90% of the time. When it is frozen, if I manually delete the model from gazebo UI, service call actually returns "successfully deleted" message. Then it gets stuck on the next object. In the sample code, it freezes on "delete_service" call.
I tried a couple of things. First, I tried an empty scene and it worked fine, somehow the fact that there are more models in the scene causes the freeze.
Second, in my scene, before deleting the models I stop gzclient. After deleteing is done, I start gzclient again. And this seems to also work up to like 70-80 objects, after that it also gets some occasional freezes.
I have seen some similar old questions about delete_model freeze in here so I get the feeling this is a bug in gazebo.
My question is: is there a solution or any kind of workaround for this? Also, is this a known issue?
P.S.: My setup is ros-melodic and gazebo9
Originally posted by kky on ROS Answers with karma: 61 on 2019-07-30
Post score: 1