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:
- Run the command to install Velodyne packages on ROS Melodic:
$ sudo apt-get install ros-melodic-velodyne-simulator
- 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
- 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.
- 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.
You can add some obstacles around the sensor for testing, as shown in the following screenshot:
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:
We will now interface Velodyne sensors with ROS.