Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Two lasers on one robot not working properly

I have two lasers (ray sensors) on my robot (modeled in URDF), on front and back. However, when I use both of them, I can see a few problems

  1. they do not publish at the intended frequency. Published frequency seems to be around 10Hz at the beginning and slows down little by little to around 8Hz.
  2. Each laser shows a glitch few times a second where the laser seems to be flipped
  3. When I set the laser to be visualized, gazebo only shows one laser

When I only use one laser, it works fine and publishes at the rate specified in <update_rate> tag.


Here's some images from the robot with ROS move-base with both lasers in use. Green dots in line shows the laser. Black box is the robot

  1. Both lasers on. Only the rear one seems to be working Both lasers on. Only one seems to be working

  2. How gazebo shows only one laser. The other laser is positioned on top left corner of the robot How gazebo shows only one laser

  3. The glitch. The one laser that is working is showing as well. Two other lasers can be seen but they do not match with the robot's position image description


This is the gazebo elements for the lasers. What am I missing here?

<gazebo reference="front_scan">
  <material>Gazebo/FlatBlack</material>
  <sensor name="lds_lfcd_sensor" type="ray">
    <pose>0 0 0 0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>2</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-2.25619449019</min_angle>
          <max_angle>2.25619449019</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.12</min>
        <max>15.0</max>
        <resolution>0.015</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_lds_lfcd_controller">
      <topicName>scan</topicName>
      <frameName>front_scan</frameName>
    </plugin>
  </sensor>
</gazebo>
<gazebo reference="rear_scan">
  <material>Gazebo/FlatBlack</material>
  <sensor name="lds_lfcd_sensor" type="ray">
    <pose>0 0 0 0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>2</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-2.25619449019</min_angle>
          <max_angle>2.25619449019</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.12</min>
        <max>15.0</max>
        <resolution>0.015</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_lds_lfcd_controller">
      <topicName>scan</topicName>
      <frameName>rear_scan</frameName>
    </plugin>
  </sensor>
</gazebo>

Two lasers on one robot not working properly

I have two lasers (ray sensors) on my robot (modeled in URDF), on front and back. However, when I use both of them, I can see a few problems

  1. they do not publish at the intended frequency. Published frequency seems to be around 10Hz at the beginning and slows down little by little to around 8Hz.
  2. Each laser shows a glitch few times a second where the laser seems to be flippedshifted
  3. When I set the laser to be visualized, gazebo only shows one laser

When I only use one laser, it works fine and publishes at the rate specified in <update_rate> tag.


Here's some images from the robot with ROS move-base with both lasers in use. Green dots in line shows the laser. Black box is the robot

  1. Both lasers on. Only the rear one seems to be working Both lasers on. Only one seems to be working

  2. How gazebo shows only one laser. The other laser is positioned on top left corner of the robot How gazebo shows only one laser

  3. The glitch. The one laser that is working is showing as well. Two other lasers can be seen but they do not match with the robot's position image description


This is the gazebo elements for the lasers. What am I missing here?

<gazebo reference="front_scan">
  <material>Gazebo/FlatBlack</material>
  <sensor name="lds_lfcd_sensor" type="ray">
    <pose>0 0 0 0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>2</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-2.25619449019</min_angle>
          <max_angle>2.25619449019</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.12</min>
        <max>15.0</max>
        <resolution>0.015</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_lds_lfcd_controller">
      <topicName>scan</topicName>
      <frameName>front_scan</frameName>
    </plugin>
  </sensor>
</gazebo>
<gazebo reference="rear_scan">
  <material>Gazebo/FlatBlack</material>
  <sensor name="lds_lfcd_sensor" type="ray">
    <pose>0 0 0 0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>2</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-2.25619449019</min_angle>
          <max_angle>2.25619449019</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.12</min>
        <max>15.0</max>
        <resolution>0.015</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_lds_lfcd_controller">
      <topicName>scan</topicName>
      <frameName>rear_scan</frameName>
    </plugin>
  </sensor>
</gazebo>

Two lasers on one robot not working properly

I have two lasers (ray sensors) on my robot (modeled in URDF), on front and back. However, when I use both of them, I can see a few problems

  1. they do not publish at the intended frequency. Published frequency seems to be around 10Hz at the beginning and slows down little by little to around 8Hz.
  2. Each laser shows a glitch few times a second where the laser seems to be shifted
  3. When I set the laser to be visualized, gazebo only shows one laser

When I only use one laser, it works fine and publishes at the rate specified in <update_rate> tag.


Here's some images from the robot with ROS move-base with both lasers in use. Green dots in line shows the laser. Black box is the robot

  1. Both lasers on. Only the rear one seems to be working Both lasers on. Only one seems to be working

  2. How gazebo shows only one laser. The other laser is positioned on top left corner of the robot How gazebo shows only one laser

  3. The glitch. The one laser that is was working is still showing as well. Two other lasers can The shifted laser seems to be seen the combined laser showing the full 360 view but they do not match with the robot's position it is rotated 180 image description


This is the gazebo elements for the lasers. What am I missing here?

<gazebo reference="front_scan">
  <material>Gazebo/FlatBlack</material>
  <sensor name="lds_lfcd_sensor" type="ray">
    <pose>0 0 0 0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>2</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-2.25619449019</min_angle>
          <max_angle>2.25619449019</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.12</min>
        <max>15.0</max>
        <resolution>0.015</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_lds_lfcd_controller">
      <topicName>scan</topicName>
      <frameName>front_scan</frameName>
    </plugin>
  </sensor>
</gazebo>
<gazebo reference="rear_scan">
  <material>Gazebo/FlatBlack</material>
  <sensor name="lds_lfcd_sensor" type="ray">
    <pose>0 0 0 0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>2</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-2.25619449019</min_angle>
          <max_angle>2.25619449019</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.12</min>
        <max>15.0</max>
        <resolution>0.015</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_lds_lfcd_controller">
      <topicName>scan</topicName>
      <frameName>rear_scan</frameName>
    </plugin>
  </sensor>
</gazebo>