Home | Tutorials | Wiki | Issues
Ask Your Question
0

Ray sensor crashing Gazebo

asked 2013-06-26 05:49:02 -0500

ZdenekM gravatar image

updated 2013-07-02 01:25:18 -0500

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.

edit retag flag offensive close merge delete

Comments

coudl you please supply your urdf? we have having the same problem!

gazer gravatar imagegazer ( 2013-07-10 18:40:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-06-27 18:08:39 -0500

nkoenig gravatar image

Does this SDF world work for you:

<?xml version="1.0" ?>
<sdf version="1.4">
  <world name="default">
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>

    <model name="velodyne">
      <pose>0 0 0.1 0 0 0</pose>
      <link name="link">
        <inertial>
          <mass>0.1</mass>
        </inertial>

        <collision name="collision">
          <geometry>
            <box>
              <size>0.2 0.2 0.2</size>
            </box>
          </geometry>
        </collision>

        <visual name="visual">
          <geometry>
            <box>
              <size>0.2 0.2 0.2</size>
            </box>
          </geometry>
        </visual>

        <sensor name="laser" type="ray">
          <pose>0.01 0 0.0175 0 -0 0</pose>
          <ray>
            <scan>
              <horizontal>
                <samples>640</samples>
                <resolution>1</resolution>
                <min_angle>-2.26889</min_angle>
                <max_angle>2.268899</max_angle>
              </horizontal>
              <vertical>
                <samples>32</samples>
                <resolution>1</resolution>
                <min_angle>-0.535</min_angle>
                <max_angle>0.186132</max_angle>
              </vertical>
            </scan>
            <range>
              <min>0.1</min>
              <max>10</max>
              <resolution>0.01</resolution>
            </range>
          </ray>

          <plugin name="laser" filename="libRayPlugin.so" />
          <always_on>1</always_on>
          <update_rate>30</update_rate>
          <visualize>true</visualize>
        </sensor>
      </link>
    </model>
  </world>
</sdf>
edit flag offensive delete link more

Comments

Hi. Thanks for SDF example. It doesn't crash simulator but, also doesn't work properly. I will update question.

ZdenekM gravatar imageZdenekM ( 2013-07-02 01:19:03 -0500 )edit
1

I know that visualization of vertical laser in Gazebo does not work quite right, but the actual range values may be ok. Maybe you can try subscribing to your laser scan topic and plot of the range values to see if they are correct?

iche033 gravatar imageiche033 ( 2013-07-03 00:06:41 -0500 )edit

Hi. Did you solve this issue? I am having the same problem. Please keep me update as I am looking to implement the swissrangercamera with the libgazeboblock laser plugin. Thanks !

gazer gravatar imagegazer ( 2013-07-03 10:50:01 -0500 )edit

@iche033, I am having the same problem with the vertical laser in Gazebo using the "ros block laser" plugin, removing the vertical will makes the visualization correct. But then using Rviz, the pointclouds published just doesn't make sense

gazer gravatar imagegazer ( 2013-07-10 18:43:47 -0500 )edit

Hi, I am using the above velodyne sensor SDF in order to generate the point cloud data and I am able to visualize in rviz , but the problem is it is not rotating. So can , anyone pplz suggest me how to rotate the velodyne sensor.. Thanks !

anonymous gravatar imageanonymous ( 2014-09-03 23:50:42 -0500 )edit

The above comment about the velodyne sensor has moved to this question

nkoenig gravatar imagenkoenig ( 2014-09-09 19:07:40 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-06-26 05:49:02 -0500

Seen: 1,799 times

Last updated: Jul 02 '13