How to add a new collision to existing model with a model plugin?
Hello everyone,
I am trying to add dynamically a new collision and visual to my model. To do so, I found the member function CreateCollision(). I don't really know how to use it correctly. I also want to do this new collision visible, so how is this possible? Thank you in advance. Appreciating any help!!! Best wishes.
My approach:
namespace gazebo
{
class MyModelPlugin: public ModelPlugin
{
public: void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
{
physics::ModelPtr mymodel = _model ;
physicsLinkPtr new_link = _model->CreateLink("new_link");
physics::CollisionPtr new_collision = physics::physicsEngine::CreateCollision ("polyline", new_link);
...
}}}