Adding Contact Sensor to a Gazebo Plugin

asked 2019-06-14 03:45:54 -0500

namankumar gravatar image

updated 2019-06-14 03:46:19 -0500

Hey guys,

I am writing a Gazebo plugin which will go through a robot model (sdf file) and iterate through the links using the joints and add a contact sensor to all the collisions present in those links. Currently, I have all the links, joints and collisions in the custom plugin.

I am stuck at adding a contact sensor to all of those collisions. There is a function AddContact in


but it is deprecated. Any suggestions on how can I add a contact sensor to those collisions in the plugin code itself?

PS: I know I can just add it in the model file but I don't want that because the model will keep changing and I don't want to keep on updating it with the contact sensor tag.

Thanks in advance.

edit retag flag offensive close merge delete