Skip to content

Running Velodyne Lidars (VLP16)

Hateley123 edited this page Aug 8, 2022 · 4 revisions

Refer to the following notes for general instructions for running VLP16 Velodyne lidars.

Running VLP 16 Puck only:

  1. How to config network:
    • Do not plug into a router or switch, as it will result in network disruptions
    • Plug in directly to computer
    • Manually set your ethernet port to an IP: - sudo ifconfig enp2s0 192.168.1.100
    • Create a route to lidar’s IP: - sudo route add 192.168.1.201 enp2s0

The above actions must be performed every time the connected computer or network is restarted; as well as in the case that the Velodyne itself is unplugged or restarted. NOTE: Ubuntu's network manager will sometimes try to reconnect randomly and will mess up the configuration. To avoid this, you can turn off the network manager once the lidars are connected by running: sudo service network-manager stop

  1. To configure two lidars simultaneously, scripts have been made that can do this automatically

How to run lidar in ROS and view data:

  1. Convert calibration file into .yaml format:
  • Execute in order to be able to run any ros code:
    • roscore
  • rosrun velodyne_pointcloud gen_calibration.py /path/to/Velodyne/VLP16_High_Res/VeloView-VLP-16-HiRes.xml
  • Run:
    • roslaunch velodyne_pointcloud VLP16_points.launch calibration:=/path/to/velodyne/velodyne_pointcloud/params/VLP-16-Lite.yaml
  • Run:
    • rviz with topic: /velodyne_points and fixed frame velodyne

How to View VLP 16 PucK Lidar Data Through Rviz

  • Start roscore inorder to execute ros files
    • roscore
  • Execute the following command to start running VLP 16 Puck
    • roslaunch velodyne_pointcloud VLP16_points.launch
      • If you have a roslaunch error or roscore error that means that you need to execute the following command
        • source devel/setup.bash
  • To view the data being read by the lidar using RVIZ, which is launched using the following command
    • rosrun rviz rviz

The above command will open an application window. On the far right you will see a label called "Fixed Frame". Click it and go down to the bottom left and click on the "Add" button. This will open up a new window. Go to the second tab labeled "By Topic". Scroll down and you will see an option labeled "Point Cloud". Select it and it will open up a new option on the left bar of the main RVIZ application, but it will be red. To fix this problem, go back to the Fixed Frame option and change its name to "velodyne". You should now see the lidar data on the RVIZ application.

How to store VLP 16 Puck Data into a Rosbag

  • Launch the lidar using the commands shown in the previous section

  • Create a directory to story the bag data and enter the directory

    • mkdir -p ~/bagfiles && cd ~/bagfiles
  • The important lidar data is stored in the velodyne topiclabeled /velodyne_points. To record this data into a rosbag for later analysis use the following command to store the relevent data into file_name.bag

    • rosbag record -O file_name.bag /velodyne_points
  • Record as long as you want and then exit the recording by using Ctrl + C.

How to view Velodyne bag data through RVIZ

  • Make sure roscore is running or the following commands will not work.
  • Open RVIZ using the commands discussed above
  • Click on Fixed Frame and the 'Add" button on the bottom left of the screen. On the first tab scrop down and click on 'Point Cloud 2'
  • In Point Cloud tab, change the topic to '/velodyne_points'
  • Change the fixed frame name to 'velodyne'
  • In a blank terminal enter the following commands
    • cd ~/bagfiles
    • rosbag play --clock filename.bag

Running two Velodynes:

  1. When running two Velodynes, each lidar requires a different IP address and port number. The following configuration is feasible combination:
  • Vertical Lidar:
    • 192.168.1.201
    • Port 2368
  • Horizontal Lidar:
    • 192.168.1.202
    • Port 2369
  1. Ensure that the port number is set correctly in the launch file as well as on the web server of the lidar (enter IP address of Lidar into the browser when you are connected to the sensor to view web server settings)

Author: Nick Charron and John Hateley

Last Edited: 08 Aug 2022

Clone this wiki locally