Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You need to set a gazebo tag in your urdf file.

For example, if I have a link safety_lidar to represent my sensor, I will add the following tag :

<gazebo reference="safety_lidar">
  <sensor type="ray" name="sensor_name">
  .
  .
  .

You need to set a gazebo tag in your urdf file.

For example, if I have a link safety_lidar to represent my sensor, I will add the following tag :

<gazebo reference="safety_lidar">
reference="velodyne_${lidarName}">
  <sensor type="ray" name="sensor_name">
  .
  .
  .
name="velodyne_sensor_${lidarName}">
    <pose>0.0 0.0 0.0 0.0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>10</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>${sample_number}</samples>
          <min_angle>${min_angle}</min_angle>
          <max_angle>${max_angle}</max_angle>
        </horizontal>
        <vertical>
          <samples>16</samples>
          <min_angle>-0.26</min_angle>
          <max_angle>0.26</max_angle>
        </vertical>
      </scan>
      <range>
        <min>0.30</min>
        <max>100.0</max>
      </range>
    </ray>
    <plugin name="gazebo_ros_velodyne_controller_${lidarName}" filename="libblock_laser_plugin.so">
      <topicName>/velodyne_${lidarName}</topicName>
      <frameName>velodyne_${lidarName}</frameName>
      <alwaysOn>true</alwaysOn>
      <gaussianNoise>0.00</gaussianNoise>
      <updateRate>10.0</updateRate>
      <hokuyoMinIntensity>1</hokuyoMinIntensity>
    </plugin>
  </sensor>
</gazebo>

I am using xacro parameters (${}) to adapt my sensor.