Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Create links programatically and dinamically

$
0
0
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 01 1 1101 1 10100101101 After the update the sdf ToString is: 0 0 0.5 0 -0 01 1 1101 1 10100101101

Viewing all articles
Browse latest Browse all 7017

Latest Images

Trending Articles



Latest Images