Ray sensor crashing Gazebo
Hi,
I'm trying to add velodyne sensor to my robot, modelled using URDF. Unfortunately, Gazebo (1.8.6) crashes on startup if there are both horizontal and vertical sections. With horizontal only, it works fine. Is there any problem in my sensor definition or is it bug in the simulator?
<gazebo reference="velodyne_link">
<sensor type="ray" name="ray_sensor">
<always_on>true</always_on>
<update_rate>10.0</update_rate>
<pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<ray>
<scan>
<horizontal>
<samples>21875</samples>
<resolution>1.0</resolution>
<min_angle>-3.14</min_angle>
<max_angle>3.14</max_angle>
</horizontal>
<vertical>
<samples>32</samples>
<resolution>1.0</resolution>
<min_angle>-0.535</min_angle>
<max_angle>0.186132</max_angle>
</vertical>
</scan>
<range>
<min>1.0</min>
<max>20.0</max>
<resolution>0.01</resolution>
</range>
</ray>
<plugin name="gazebo_ros_ray_sensor_controller" filename="libgazebo_ros_block_laser.so">
<gaussianNoise>0.005</gaussianNoise>
<alwaysOn>true</alwaysOn>
<updateRate>10.0</updateRate>
<topicName>velodyne_cloud</topicName>
<frameName>velodyne_link</frameName>
</plugin>
</sensor>
</gazebo>
Removing plugin doesn't change anything (Gazebo still crashes).
UPDATE:
Code snippet from first answer works but, it seems that obstacles are "ignored" by sensor - see picture (can't upload it here because of low karma). Also it seems to be producing just 2D data.
coudl you please supply your urdf? we have having the same problem!