Gazebo | Ignition | Community
Ask Your Question

Delete model fails using gzclient

asked 2016-08-20 07:22:11 -0600

wicked88 gravatar image

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 ?

edit retag flag offensive close merge delete


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

chapulina gravatar imagechapulina ( 2016-08-21 14:23:39 -0600 )edit

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<modelptr>.

wicked88 gravatar imagewicked88 ( 2016-08-21 17:44:40 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-08-22 11:15:39 -0600

chapulina gravatar image

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?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-08-20 07:22:11 -0600

Seen: 492 times

Last updated: Aug 22 '16