ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Hokuyo Laser Scanner not working in Gazebo using ROS Kinetic

asked 2016-12-21 09:37:21 -0600

ClarkGrissom gravatar image

updated 2016-12-21 10:31:17 -0600

I am trying to use the Hokuyo Laser scanner on my mobile robot using ROS Kinetic and it does NOT detect any object in it's field of vision.

I added the following code snippet in my .xacro file

<joint name="hokuyo_joint" type="fixed">
<axis xyz="0 1 0" />
<origin xyz=".15 0 .1" rpy="0 0 0"/>
<parent link="chassis"/>
<child link="hokuyo"/>
</joint>

<!-- Hokuyo Laser -->
<link name="hokuyo">
<collision>
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <geometry>
<box size="0.1 0.1 0.1"/>
  </geometry>
</collision>

<visual>
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <geometry>
    <mesh filename="package://mybot_description/meshes/hokuyo.dae"/>
  </geometry>
</visual>

<inertial>
  <mass value="1e-5" />
  <origin xyz="0 0 0" rpy="0 0 0"/>
  <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>
</link>

and the following code snippet in my .gazebo file.

<!-- hokuyo -->
  <gazebo reference="hokuyo">
    <sensor type="gpu_ray" name="head_hokuyo_sensor">
      <pose>0 0 0 0 0 0</pose>
      <visualize>true</visualize>
      <update_rate>40</update_rate>
   <ray>
    <scan>
      <horizontal>
        <samples>720</samples>
        <resolution>1</resolution>
        <min_angle>-1.570796</min_angle>
        <max_angle>1.570796</max_angle>
      </horizontal>
    </scan>
    <range>
      <min>0.10</min>
      <max>30.0</max>
      <resolution>0.01</resolution>
    </range>
    <noise>
      <type>gaussian</type>
      <!-- Noise parameters based on published spec for Hokuyo laser
           achieving "+-30mm" accuracy at range < 10m.  A mean of 0.0m and
           stddev of 0.01m will put 99.7% of samples within 0.03m of the true
           reading. -->
      <mean>0.0</mean>
      <stddev>0.01</stddev>
    </noise>
  </ray>
  <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
    <topicName>/mybot/laser/scan</topicName>
    <frameName>hokuyo</frameName>
  </plugin>
</sensor>
</gazebo>

I have created a hokuyo.dae file as well. I will post that if needed, however the issue is that the laser scanner is not detecting any object in it's field of vision. Where is the problem?

The following picture says it all.

edit retag flag offensive close merge delete

Comments

gpu_laser only work for Nvidia card, see here

achmad_fathoni gravatar image achmad_fathoni  ( 2018-06-02 02:25:02 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
6

answered 2017-03-11 18:54:11 -0600

Dan.K gravatar image

Try the using the non-GPU version of the laser. Change the line <sensor type="gpu_ray" name="head_hokuyo_sensor"> to <sensor type="ray" name="head_hokuyo_sensor"> and replace <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so"> with <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">

edit flag offensive delete link more

Comments

Thank you. Only this option worked for me.

utkuolcar gravatar image utkuolcar  ( 2020-12-01 14:45:07 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2016-12-21 09:37:21 -0600

Seen: 5,449 times

Last updated: Dec 21 '16