Laser ray sensor not detecting object in plugin?

asked 2016-02-22 10:41:22 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi all,

I’m new to Gazebo and I couldn’t find any examples that show the examination of a laser sensor data in a plugin.

I’m using a model plugin and I inserted a box model in the gui. The visual ray shows the box stopping the ray. But, when I displayed the min, max range and the fidtance from a deted object. The distance from the object is always infinite.

= 0.08 max_distance = 10 current_distance = inf

The model.sdf is:

<?xml version="1.0" ?>
<sdf version="1.5">
  <model name="ab_robot">
    <link name="chassis">
      <pose>0 0 0.16 0 0 0</pose>
      <inertial>
        <mass>5.67</mass>
        <!-- interias are tricky to compute -->
        <inertia>
          <ixx>0.07</ixx>
          <iyy>0.08</iyy>
          <izz>0.10</izz>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyz>0</iyz>
        </inertia>
      </inertial>
      <collision name="collision">
        <geometry>
          <box>
            <size>0.445 0.277 0.17</size>
          </box>
        </geometry>
      </collision>
      <collision name="castor_collision">
        <pose>-0.200 0 -0.12 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>0.04</radius>
          </sphere>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>0</mu>
              <mu2>0</mu2>
              <slip1>1.0</slip1>
              <slip2>1.0</slip2>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <pose>0 0 0.04 0 0 0</pose>
        <geometry>
          <mesh>
            <uri>model://pioneer2dx/meshes/chassis.dae</uri>
          </mesh>
        </geometry>
      </visual>
      <visual name="castor_visual">
        <pose>-0.200 0 -0.12 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>0.04</radius>
          </sphere>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/FlatBlack</name>
          </script>
        </material>
      </visual>
    </link>
    <link name="right_wheel">
      <pose>0.1 -.17 0.11 0 1.5707 1.5707</pose>
      <!-- Note that the following is inertial not inertia! -->
      <inertial>
        <mass>1.5</mass>
        <!-- Note that the following is inertia not inertial! -->
        <inertia>
          <ixx>0.0051</ixx>
          <iyy>0.0051</iyy>
          <izz>0.0090</izz>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyz>0</iyz>
        </inertia>
      </inertial>
      <collision name="collision">
        <geometry>
          <cylinder>
            <radius>0.11</radius>
            <length>0.05</length>
          </cylinder>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>100000.0</mu>
              <mu2>100000.0</mu2>
              <slip1>0.0</slip1>
              <slip2>0.0</slip2>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <geometry>
          <cylinder>
            <radius>0.11</radius>
            <length>0.05</length>
          </cylinder>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/FlatBlack</name>
          </script>
        </material>
      </visual>
    </link>
    <link name="left_wheel">
      <pose>0.1 .17 0.11 0 1.5707 1.5707</pose>
      <!-- Note that the following is inertial not inertia! -->
      <inertial>
        <mass>1.5</mass>
        <!-- Note that the following is inertia not inertial! -->
        <inertia>
          <ixx>0.0051</ixx>
          <iyy>0.0051</iyy>
          <izz>0.0090</izz>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyz>0</iyz>
        </inertia>
      </inertial>
      <collision name="collision">
        <geometry>
          <cylinder>
            <radius>0.11</radius>
            <length>0.05</length>
          </cylinder>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>100000.0</mu>
              <mu2>100000.0</mu2>
              <slip1>0.0</slip1>
              <slip2>0.0</slip2>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <geometry>
          <cylinder>
            <radius>0.11</radius>
            <length ...
(more)
edit retag flag offensive close merge delete