Simulating the Velodyne LIDAR

The Velodyne LIDAR is becoming an integral part of a self-driving car. Because of high demand, there are enough software modules available to work with this sensor. We are going to simulate two popular models of Velodyne, called HDL-32E and VLP-16. Let's see how to do it in ROS and Gazebo.

In ROS Melodic, we can install from a binary package or compile from source code by following these steps:

  1. Run the command to install Velodyne packages on ROS Melodic:
$ sudo apt-get install ros-melodic-velodyne-simulator
  1. To install it from source code, just clone the source package to the ROS workspace using the following command:
$ git clone https://bitbucket.org/DataspeedInc/velodyne_simulator.git 
  1. After cloning the package, you can build it using the catkin_make command. Here is the ROS wiki page of the Velodyne imulator: http://wiki.ros.org/velodyne_simulator.
  2. Now that we have installed the packages, it's time to start the simulation of the Velodyne sensor. You can start the simulation using the following command:
$ roslaunch velodyne_description example.launch 

This command will launch the sensor simulation in Gazebo.

Note that this simulation will consume a lot of the RAM of your system; your system should have at least 8 GB before you start the simulation.

You can add some obstacles around the sensor for testing, as shown in the following screenshot:

Simulation of Velodyne in Gazebo

You can visualize the sensor data in RViz by adding display types such as PointCloud2 and Robot Model to visualize sensor data and sensor models. You have to set the Fixed Frame to velodyne. You can clearly see the obstacles around the sensor in the following screenshot:

Visualization of a Velodyne sensor in RViz

We will now interface Velodyne sensors with ROS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.182.179