Gazebo | Ignition | Community
Ask Your Question

Multiple Ray Sensors - Interference?

asked 2020-05-22 15:47:43 -0600

flodo gravatar image

Hi there,

I added multiple single ray sensors to my robot using the appended xacro. I then instantiated three of them, one in the middle, one to the right and one to the left, I appended the code for that too.

The problem is: somehow the left and the right sensor are affected by the one in the middle. If the one in the middle is detecting something, than also the others show the same values. Furthermore: the sensor to the left and the one to the right do have a really strange behaviour, let me show that to you:

image description C:\fakepath\Screen Capture_select-area_20200522223754.gif

It looks like those three sensors somehoe interfere internally - but why?

<xacro:macro name="distance_sensor" params="link_name parent_name mass radius height xyz rpy min_angle max_angle">

<link name="${link_name}">

      <origin xyz="0 0 0" rpy="0 0 0"/>
      <mass value="${mass}" />
      <xacro:cylinder_inertia m="0.01" r="${radius}" h="${height}" />

      <origin xyz="0 0 0" rpy="${rpy}"/>
        <cylinder radius="${radius}" length="${height}"/>
      <material name="sensor_red" />

      <origin xyz="0 0 0" rpy="${rpy}" />
        <cylinder radius="${radius}" length="${height}"/>


<joint name="joint_${link_name}" type="fixed">
  <origin xyz="${xyz}" rpy="0 0 0"/>
  <parent link="${parent_name}"/>
  <child link="${link_name}"/>

<gazebo reference="${link_name}">


  <sensor type="ray" name="${link_name}_sensor">


    <plugin name="${link_name}_controller" filename="">



      <!-- Laser Range Finder Bricklet (Tinkerforge) -->
        <min>0.1</min> <!-- 0.05 -->






  <!-- Laser Sensors -->
      mass="0.01" radius="0.015" height="0.1"
      xyz="0.25 0 0" rpy="0.00 1.5708 0.00"
      min_angle="0" max_angle="0"

  <!-- US Sensor Left -->
      mass="0.01" radius="0.015" height="0.1"
      xyz="0.25 0.05 0" rpy="-1.0472 1.5708 0.00"
      min_angle="60" max_angle="60"

  <!-- US Sensor Right -->
      mass="0.01" radius="0.015" height="0.1"
      xyz="0.25 -0.05 0" rpy="1.0472 1.5708 0.00"
      min_angle="-60" max_angle="-60"
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-26 17:06:44 -0600

flodo gravatar image

updated 2020-05-26 17:11:32 -0600

image description image description image description image description image description image description image description

As you can see, there is a bug in Gazebo which is related to Resolution / Samples ratio. I fixed it by using two samples.

furthermore, if you specify min_angle = max_angle, then it is alsways measuring to 0 degrees, no matter which angle is specified.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-05-22 15:47:43 -0600

Seen: 20 times

Last updated: May 26