Robotics StackExchange | Archived questions

Delete model fails using gzclient

I spawned some models in the simulation using standard gzclient. Then, i have a plugin in those models that shows the models already spawned in the world.

Suppose that i have 3 models : robot1, robot2 and robot3. When i insert robot4 it should show me robot1, robot2 and robot3 as the already spawned models. If i delete robot2 and i spawn another model, if i read the world model list it still shows me robot2, even after i deleted it ...

Help ?

Asked by wicked88 on 2016-08-20 07:22:11 UTC

Comments

What API functions are you using to check the list of models in the world?

Asked by chapulina on 2016-08-21 14:23:39 UTC

Hi. Im doing a list output when i load a new model, in the model's plugin. I have access to the matching WorldPtr, so i use Model_V GetModels (), where Model_V is std::vector.

Asked by wicked88 on 2016-08-21 17:44:40 UTC

Answers

I wrote a little test which checks the vector of models returned by World::GetModels after a model is deleted by sending an entity_delete request (as gzclient does), and the test passes. This means the model is being properly removed from the vector.

Not sure what could be going wrong in your case. Are you sure you're getting a new vector of models? Did you give it enough time for the model to be fully deleted?

Asked by chapulina on 2016-08-22 11:15:39 UTC

Comments