Ask Your Question

Using Hokuyo Lidar on model in Gazebo-7 and RViz

asked 2020-02-14 14:06:32 -0600

John999991 gravatar image

updated 2020-02-15 05:51:31 -0600

Dear all, I am trying to add a Lidar (Hokuyo) on my model using the following configuration:

-- ROS Kinetic

-- Gazebo 7.0

-- Ubuntu 16.04

The code I added at the URDF file is:

  <link name="lidar">
      <origin xyz="0 0 0.01" rpy="0 0 0" />
      <mass value="0.01" />
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
      <origin xyz="0 0 0.005" rpy="0 0 0" />
        <cylinder radius="0.01" length="0.01"/>
      <material name="">
        <color rgba="0 0 0 1" />
      <origin xyz="0 0 0" rpy="0 0 0" />
        <cylinder radius="0.01" length="0.01"/>

  <joint name="TB_Lidar" type="fixed">
  <axis xyz="0.0 0.0 1.0"/>
    <parent link="TB"/>
    <child link="lidar"/>
    <origin xyz="0 0 0" rpy="0.0 0.0 0.0" />


    <gazebo reference = "laser_scanner">
       <sensor type="ray" name="head_hokuyo_sensor"> 
        <pose> 0 0 0 0 0 0 </pose>
         <plugin name="gpu_laser" filename="">

But I cannot see the /scan topic or any publishers at this topic. The Lidar is not working. Any Ideas why?

edit retag flag offensive close merge delete


I have located the at /opt/ros/kinetic/lib/

John999991 gravatar imageJohn999991 ( 2020-02-15 05:50:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-02-15 11:25:08 -0600

John999991 gravatar image

updated 2020-02-15 13:12:26 -0600

ok, so apparently the problems were:

<plugin name="gpu_laser" filename="">

I cannot use the gpu version for some reason... The correct (that worked for me) was:

<plugin filename="" name="gazebo_ros_head_hokuyo_controller">


 <!-- Hokuyo Laser -->
 <link name="hokuyo_link">
      <origin xyz="0 0 0" rpy="0 0 0" />
        <box size="0.01 0.01 0.01"/>

Here I used <link name="lidar"> which doesn't match the one from <gazebo reference="hokuyo_link">. Further more on the same <link>, I defined the <inertial> and <visual> part which was also not expected. Only the <collision> should be present.

Finally also the <plugin name="gpu_laser" filename=""> could be a problem since i think Gazebo expects <plugin filename="" name="gazebo_ros_head_hokuyo_controller"> but not 100% sure about that.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-02-14 14:06:32 -0600

Seen: 16 times

Last updated: Feb 15