How to add a new collision to existing model with a model plugin?

asked 2021-07-08 12:16:27 -0500

SneakPete gravatar image

updated 2021-07-14 03:31:26 -0500

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); ... }}}

edit retag flag offensive close merge delete