Creating sdf element in plugin source code and adding collision

asked 2015-09-14 02:20:21 -0500

Kazuhiro Sasabuchi gravatar image

I'm trying to create and add collisions from model mesh (not from sdf, but by using sdf::ElementPtr, AddElement, and Model::Load in a plugin).

The collisions are somehow visualized but I don't see the collision element in the menu (see attached figure). How can I fix this (I want the collisions to appear in menu)? or what could be the possible problem? Thanks.



  • I'm using gazebo5_5.1.0 compiled from source, Ubuntu 14.04.
  • The plugin I'm creating is a world plugin but loads a class object that inherits the Model class (this is the class that has the collisions).
  • I'm adding a link element to the _sdf argument, and then loading the _sdf through Model::Load (like in line 124). The collision element is attached to the created link element.
  • link->GetCollision("name-of-collision")->HasType(Base::COLLISION) returns true.
  • world->GetByName("name-of-collision") does not return NULL.

So I'm guessing the CollisionPtr exists, and something not going right with the communication between gzserver and gzclient?

edit retag flag offensive close merge delete