Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

The <sensor> tag adds a sensor to the link, which usually publishes the sensor readings to a Gazebo Transport topic.

According to the configurations of your contact sensor, it will publish messages to the /gazebo/caster_bumper Gazebo topic whenever the link's caster_link_collision touches something. That's the sensor's basic functionality and it will work even if you remove the <plugin> tag.

Adding a plugin to a sensor lets the user extend the sensor's functionality directly in the C++ code. The referenced plugin library will be loaded together with the sensor and can tie callbacks to specific simulation events.

The functionality of plugin in your example is to publish ROS messages with the sensor readings. So the sensor on your example is _publishing to 2 different transport systems: Gazebo's and ROS_. The parameters inside the plugin tag only affect the plugin - in this case, they're setting the TF frame name for the readings, and the ROS topic name.

The <sensor> tag adds a sensor to the link, which usually publishes the sensor readings to a Gazebo Transport topic.

According to the configurations of your contact sensor, it will publish messages to the /gazebo/caster_bumper Gazebo topic whenever the link's caster_link_collision touches something. That's the sensor's basic functionality and it will work even if you remove the <plugin> tag.

Adding a plugin to a sensor lets the user extend the sensor's functionality directly in the C++ code. The referenced plugin library will be loaded together with the sensor and can tie callbacks to specific simulation events.

The functionality of plugin in your example is to publish ROS messages with the sensor readings. So the sensor on your example is _publishing to 2 different transport systems: Gazebo's and ROS_. The parameters inside the plugin tag only affect the plugin - in this case, they're setting the TF frame name for the readings, and the ROS topic name.

Update

Source code: