Inaccurate Laser scan from the Hokuyo sensor Gazebo
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.
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
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:
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