Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What does the sensor tag do?

I understand a link tag adds a block of matter into the simulation. The joint adds a connection between the two links. But what does the sensor tag actually do?

When look at this chunk of code for example

<sensor name='${name}_contact_sensor' type='contact'>
    <always_on>true</always_on>
    <update_rate>${update_rate}</update_rate>
    <contact>
        <collision>caster_${id}_link_collision</collision>
        <topic>/gazebo/caster_${id}_bumper</topic>
    </contact>
    <plugin name="${name}_gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
        <frameName>world</frameName>
        <bumperTopicName>/gazebo/caster_${id}_bumper</bumperTopicName>
    </plugin>
</sensor>

This sensor loads a plugin. This plugin has a bumperTopicName tag with the same topic name as the sensor tag has in its contacts/topic tag. I can look into the plugin's source code and see what it does with it's tags. But I have no idea what happens with the information inside the sensor tag.

What does the sensor tag do?

I understand a link tag adds a block of matter into the simulation. The joint adds a connection between the two links. But what does the sensor tag actually do?

When look at this chunk of code for example

<sensor name='${name}_contact_sensor' name='contact_sensor' type='contact'>
    <always_on>true</always_on>
    <update_rate>${update_rate}</update_rate>
<update_rate>10</update_rate>
    <contact>
        <collision>caster_${id}_link_collision</collision>
        <topic>/gazebo/caster_${id}_bumper</topic>
<collision>caster_link_collision</collision>
        <topic>/gazebo/caster_bumper</topic>
    </contact>
    <plugin name="${name}_gazebo_ros_bumper_controller" name="gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
        <frameName>world</frameName>
        <bumperTopicName>/gazebo/caster_${id}_bumper</bumperTopicName>
<bumperTopicName>/gazebo/caster_bumper</bumperTopicName>
    </plugin>
</sensor>

This sensor loads a plugin. This plugin has a bumperTopicName tag with the same topic name as the sensor tag has in its contacts/topic tag. I can look into the plugin's source code and see what it does with it's tags. But I have no idea what happens with the information inside the sensor tag. tag.

What does the sensor tag do?

I understand a link tag adds a block of matter into the simulation. The joint tag adds a connection between the two links. But what does the sensor tag actually do?

When look at this chunk of code for example

<sensor name='contact_sensor' type='contact'>
    <always_on>true</always_on>
    <update_rate>10</update_rate>
    <contact>
        <collision>caster_link_collision</collision>
        <topic>/gazebo/caster_bumper</topic>
    </contact>
    <plugin name="gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
        <frameName>world</frameName>
        <bumperTopicName>/gazebo/caster_bumper</bumperTopicName>
    </plugin>
</sensor>

This sensor loads a plugin. This plugin has a bumperTopicName tag with the same topic name as the sensor tag has in its contacts/topic tag. I can look into the plugin's source code and see what it does with it's tags. But I have no idea what happens with the information inside the sensor tag.