![]() | 1 | initial version |
It is only important what is the collision tag name in the SDF description. How the Gazebo sees the model you can see by following these steps
Convert XACRO description to URDF
$ rosrun xacro xacro robot.xacro > robot.urdf
Convert URDF description to SDF
$ gz sdf -p robot.urdf > robot.sdf
Open the SDF file and find the link you want to detect the contacts of. This name goes to the contact sensor collision tags.
This sensor can be defined in xacro file of the robot as
<robot name="robot" xmlns:xacro="libgazebo_ros_control.so">
<gazebo reference="my_link">
<sensor name='my_link_contact' type='contact'>
<always_on>1</always_on>
<contact>
<collision>my_link_fixed_joint_lump__my_link_collision_collision</collision>
<topic>/my_link_contact</topic>
</contact>
</sensor>
</gazebo>
</robot>