Home | Tutorials | Wiki | Issues
Ask Your Question
2

How to simulate a Velodyne sensor?

asked 2013-11-25 10:29:30 -0600

fmder gravatar image

How would you simulate a velodyne sensor or any other 3d laser sensor?

I've tried to use the block laser plugin combined with a horizontal+vertical ray sensor but it looks like the vertical tag is bugged in the 1.9 branch of gazebo. At least, when I put more than 3 samples in the vertical block It takes forever to load on my i7 computer. (I attached parts of my sdf to the question)

I was wondering if anybody has been able to simulate such a 3d laser sensor.

<gazebo reference="laser_frame">
  <sensor name="velodyne" type="ray">
    <always_on>true</always_on>
    <update_rate>5</update_rate>
    <visualize>false</visualize>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-3.14159</min_angle>
          <max_angle>3.14159</max_angle>
        </horizontal>
        <vertical>
          <samples>3</samples>
          <resolution>1</resolution>
          <min_angle>-0.43284</min_angle>
          <max_angle>0.03490</max_angle>
        </vertical>
      </scan>
      <range>
        <min>0.22</min>
        <max>50</max>
        <resolution>0.02</resolution>
      </range>
    </ray>
    <plugin name="laser_controller" filename="libgazebo_ros_block_laser.so">
      <frameName>laser_link</frameName>
      <topicName>scan</topicName>
      <gaussianNoise>0.02</gaussianNoise>
      <updateRate>5</updateRate>
    </plugin>
  </sensor>
</gazebo>

Thanks for sharing your solutions

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-11-25 19:41:52 -0600

scpeters gravatar image

The vertical tag has recently been fixed in the default branch of gazebo, though it is probably still broken in 1.9.

An alternative approach for modeling the Velodyne is to mount a ray sensor on a spinning link, so that each scan occurs at a different time step as the laser spins.

edit flag offensive delete link more

Comments

I guess that modeling the Velodyne as a spinning vertical 2D laser would be even more realistic than using block laser.

ZdenekM gravatar imageZdenekM ( 2013-12-05 05:08:42 -0600 )edit

Thanks, that is what I did, I'll publish my code later this week for the spinning hokuyo.

fmder gravatar imagefmder ( 2013-12-15 08:52:56 -0600 )edit

Still have that code for the spinning hokuyo?

lba5 gravatar imagelba5 ( 2014-10-12 21:17:09 -0600 )edit

Any code for the spinning hokuyo? Thanks.

awesomebytes gravatar imageawesomebytes ( 2015-03-09 10:12:02 -0600 )edit
0

answered 2015-11-24 05:44:03 -0600

I know this answer is very late one, but I will post just for a reference.

The following worked for me on Gazebo5.1, although it took a bit of time to load.
It might be a good idea to reduce the number of samples at first.

This worked, but the data seemed to have a weird orientation and were published as sensor_msgs/Pointcloud, not Pointcloud2.
I couldn't withstand the inconvenience so I modified the source of plugin in the end.

<sensor name="sensor_ray" type="ray">
    <visualize>true</visualize>
    <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose>
    <ray>
      <scan>
        <horizontal>
          <samples>500</samples>
          <min_angle>0</min_angle>
          <max_angle>6.24</max_angle>
        </horizontal>
        <vertical>
          <samples>16</samples>
          <min_angle>-0.2617993878</min_angle>
          <max_angle>0.2617993878</max_angle>
        </vertical>
      </scan>
      <range>
        <min>0.05</min>
        <max>50.0</max>
      </range>
    </ray>
    <plugin name="plugin_1" filename="libgazebo_ros_block_laser.so">
      <gaussianNoise>0.00</gaussianNoise>
      <hokuyoMinIntensity>1</hokuyoMinIntensity>
      <alwaysOn>true</alwaysOn>
      <updateRate>5</updateRate>
      <topicName>gazebo_vlp</topicName>
      <frameName>base_link</frameName>
    </plugin>
  </sensor>
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2013-11-25 10:29:30 -0600

Seen: 3,575 times

Last updated: Nov 25 '13