Inserting a model with the same name as a deleted model makes it disappear

Create issue
Issue #1789 new
Louise Poubel created an issue

Copy/Paste example

This happens when you copy/paste for example:

  1. Insert a box

  2. Copy the box and paste it

  3. Delete the copy

  4. Paste again - model appears and disappears immediately after, because it would have the same name as the deleted one

Latching issue

This seems to be related to a problem with latched subscribers. The issue is fixed by setting the request subscriber in physics::World as not latching:

--- a/gazebo/physics/
+++ b/gazebo/physics/
   this->dataPtr->requestSub = this->dataPtr->node->Subscribe("~/request",
-                                           &World::OnRequest, this, true);
+                                           &World::OnRequest, this, false);

Pull request #1912 addressed the latching issue in a different way but it does not solve this issue by itself.

Comments (4)

  1. Louise Poubel reporter

    It seems to be a timing problem. Just by printing debug statements to the console the issue gets solved. There's probably something which is trying to delete an entity right before latching gets set to false or something like that. I tried adding a mutex to CallbackHelper but just that didn't help.

    @nkoenig , ideas?

  2. Louise Poubel reporter

    Nevermind, I added mutexes to more places and got it to work! Woots! PR coming soon.

  3. Log in to comment