Gazebo | Ignition | Community
Ask Your Question
0

Inaccurate Laser scan from the Hokuyo sensor Gazebo

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

Naman91 gravatar image

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

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.

drsim.xacro

<!-- Hokuyo Laser -->
    <link name="base_laser_link">
        <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://drsim_control/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>

drsim.gazebo

 <!-- hokuyo -->
    <gazebo reference="base_laser_link">
        <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>
                    <vertical>
                        <samples>1</samples>
                        <resolution>1</resolution>
                        <min_angle>0</min_angle>
                        <max_angle>0</max_angle>
                    </vertical>
                </scan>
                <range>
                    <min>0.10</min>
                    <max>30.0</max>
                    <resolution>0.01</resolution>
                </range>
                <noise>
                <type>gaussian</type>
                    <mean>0.0</mean>
                    <stddev>0.01</stddev>
                </noise>
          </ray>

          <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
            <topicName>/base_scan</topicName>
            <frameName>base_laser_link</frameName>
          </plugin>

        </sensor>
    </gazebo>

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 libRayPlugin.so from libgazeborosgpulaser.so, 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.
Thanks!
Naman

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
2

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

Stefan Kohlbrecher gravatar image

What you observe is a issue due to your graphics card driver. libgazebo_ros_gpu_laser.so 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
0

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

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
0

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

Naman91 gravatar image

Hi,

So, I used another plugin called "libgazeboroslaser.so" 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: "libgazeboroslaser.so" and "libgazeborosgpu_laser.so" ? Thanks.
Naman

edit flag offensive delete link more
0

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

nkoenig gravatar image

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

edit flag offensive delete link more

Comments

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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 5,824 times

Last updated: Mar 16 '15