Gazebo | Ignition | Community
Ask Your Question

Inaccurate Laser scan from the Hokuyo sensor Gazebo

asked 2015-03-11 10:01:31 -0600

Naman91 gravatar image

updated 2015-03-12 14:52:27 -0600

Hi all,

I have been working on setting up the simulation environment in Gazebo and I have a simple mobile base with the hokuyo sensor on top of it. The laser scan coming out of it seems inaccurate.image description
I know I am doing some thing silly but I am not able to figure it out. I have attached the necessary code for the Hokuyo sensor. Please let me know if you need anything else from my side.


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

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

            <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" />


 <!-- hokuyo -->
    <gazebo reference="base_laser_link">
        <sensor type="gpu_ray" name="head_hokuyo_sensor">
            <pose>0 0 0 0 0 0</pose>

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


Update: I have attached the image after View->Collisions image description

Update 2: It turns out that even if I have only the sensor (no mobile robot), I get the same inaccurate laser scan. So, I think the type of sensor is wrong because when I change the type of sensor to "ray" from "gpuray" and plugin to from, I get the accurate laser scan as shown:

image description

But I cant use the new plugin if I want to interface gazebo with ros and get the laser scan data on a ros topic (For example /base_scan). Does anyone have any insights into this?

Any help will be appreciated.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2015-03-16 15:53:19 -0600

Stefan Kohlbrecher gravatar image

What you observe is a issue due to your graphics card driver. uses the graphics card for generating the simulated laser scan. The other plugin you now employ uses the physics engine (I believe ODE collision checking) for generating the laser scan and is thus unaffected by the GPU rendering issue.

edit flag offensive delete link more

answered 2016-12-27 04:02:56 -0600

I solved this issue by following THIS tutorial, at the bottom of the page they explain what to change to switch between gpu and non-gpu laser scanners. I think the difference between the two of them is that one of them is graphic card based and the other is physics based. Hope this helps

edit flag offensive delete link more

answered 2015-03-11 10:12:22 -0600

nkoenig gravatar image

Can you enable collisions: View->Collisions? There might be a collision that is incorrectly sized.

edit flag offensive delete link more


Hi, Thanks for the reply.I have updated the original question by adding the image after enabling collisions.

Naman91 gravatar imageNaman91 ( 2015-03-11 10:42:31 -0600 )edit

answered 2015-03-12 15:08:48 -0600

Naman91 gravatar image


So, I used another plugin called "" and everything seems to be working now with perfect laser scan and correct interaction between Gazebo and ROS. Can anyone throw some light on the differences between the two plugins: "" and "" ? Thanks.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-11 10:01:31 -0600

Seen: 5,717 times

Last updated: Mar 16 '15