0
$\begingroup$

Gazebo Answers logo

Hi,

I have a model that is composed of numerous spheres as links. At a moment during the simulation I would like to remove some of these spheres (links).

I tried it this way and nothing happens:

// Initialize world (WorldPlugin)
physics::WorldPtr my_world = _parent;

// Init 'liquid_spheres' the model with many sphere links
physics::ModelPtr liquid_model = this->my_world->GetModel("liquid_spheres");

// Create a vector with all the links from the model
std::vector<physics::LinkPtr> links = this->liquid_model->GetAllLinks();

// I try to remove the links with "RemoveChild(EntityPtr _child)", but nothing happens
// Other operations such as moving them in another position works fine
this->liquid_model->RemoveChild(links[i]);

// This one does not do anything either:
this->liquid_model->RemoveChildren();

If it not possible to remove the links, which is the best way to delete the whole model?
I am using ROS Groovy with Gazebo 1.2.5.

Thanks, Andrei


Originally posted by AndreiHaidu on Gazebo Answers with karma: 2108 on 2012-12-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Created a ticket for this here: https://bitbucket.org/osrf/gazebo/issue/786/delete-links-in-a-model-from-a-plugin


Originally posted by nkoenig with karma: 7676 on 2013-07-23

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.