I creating a plugin with gazebo7 where I am trying to create links dynamically insde a given model (previously loaded from a sdf file).
I tried to insipire in the maze plugin, but it looks it creates different models for each wall: https://github.com/PeterMitrano/gzmaze/blob/master/maze_plugin/MazePlugin.cc
What I really want is creating links dynamically and latter I will try to create joints dynamically.
Then I tried just to update the Sdf with a new link.
sdf::ElementPtr originalSdf = this->model->UnscaledSDF();
physics::LinkPtr l = model->GetLink("link");
sdf::ElementPtr linksdf = l->GetSDF();
sdf::ElementPtr link2 = linksdf->Clone();
link2->GetAttribute("name")->Set("link2");
originalSdf->InsertElement(link2);
this->model->UpdateParameters(originalSdf);
But I get the following error:
Error [Element.hh:336] Unable to find value for key[pose]
The original sdf Tostring is:
0 0 0.5 0 -0 0 1 1 1 10 1 1 1 0 1 0 0 1 0 1 1 0 1
After the update the sdf ToString is:
0 0 0.5 0 -0 0 1 1 1 10 1 1 1 0 1 0 0 1 0 1 1 0 1
↧