Skip to content

Commit 2707fb7

Browse files
Xiaomi0707nevalsar
andauthored
Add Velodyne VLP-16 LiDAR Setup Guide (#245)
Adds a new sensing tutorial page for end-to-end Velodyne VLP-16 setup on Ubuntu 24.04 + ROS 2 Jazzy, including network configuration, driver installation, RViz2/Foxglove visualization, and rosbag record/replay workflow. --------- Co-authored-by: Nevin Valsaraj <5763537+nevalsar@users.noreply.github.com>
1 parent ca3abce commit 2707fb7

3 files changed

Lines changed: 345 additions & 0 deletions

File tree

_data/navigation.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ wiki:
106106
url: /wiki/sensing/computer-vision-considerations/
107107
- title: Delphi ESR Radar
108108
url: /wiki/sensing/delphi-esr-radar/
109+
- title: Velodyne VLP-16 LiDAR Setup Guide
110+
url: /wiki/sensing/lidar-vlp16-setup/
111+
- title: Point Cloud Library, 3D Sensors and Applications
112+
url: /wiki/sensing/pcl/
113+
- title: Photometric Calibration
114+
url: /wiki/sensing/photometric-calibration/
115+
- title: Speech Recognition
116+
url: /wiki/sensing/speech-recognition/
117+
- title: Stereo Vision in OpenCV
118+
url: /wiki/sensing/opencv-stereo/
119+
- title: Camera-IMU Calibration using kalibr
120+
url: /wiki/sensing/camera-imu-calibration/
109121
- title: DWM1001 UltraWideband Positioning System
110122
url: /wiki/sensing/ultrawideband-beacon-positioning/
111123
- title: Fiducial Markers

wiki/sensing/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ This section dives into various sensing modalities such as GPS modules, fiducial
8686
- **[Tracking vehicles using a static traffic camera](/wiki/sensing/trajectory-extraction-static-camera/):**
8787
Describes a system for extracting vehicle trajectories using static traffic cameras, incorporating detection, tracking, and homography estimation.
8888

89+
- **[DWM1001 UltraWideband Positioning System](/wiki/sensing/ultrawideband-beacon-positioning/):**
90+
Covers the setup and calibration of the DWM1001 UWB system for accurate indoor positioning.
91+
92+
- **[Velodyne VLP-16 LiDAR Setup Guide](/wiki/sensing/lidar-vlp16-setup/):**
93+
Covers VLP-16 setup, including static IP configuration, driver installation, point cloud visualization in RViz2 and Foxglove Studio, and bag recording for data replay.
94+
8995
### Resources
9096

9197
- [Adafruit GPS](https://www.adafruit.com/product/746)

wiki/sensing/lidar-vlp16-setup.md

Lines changed: 327 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,327 @@
1+
---
2+
date: 2026-04-29
3+
title: Velodyne VLP-16 LiDAR Setup Guide
4+
---
5+
6+
The Velodyne VLP-16 ("Puck") is a 16-channel 3D LiDAR widely used in robotics for mapping, localization, and obstacle detection. This tutorial covers the full setup on Ubuntu 24.04 with ROS 2 Jazzy — from hardware connection to point cloud visualization.
7+
8+
## Hardware Requirements
9+
10+
Before beginning, confirm you have the following:
11+
12+
**Hardware:**
13+
- Velodyne VLP-16 Lidar
14+
- Velodyne interface cable (provides both power and Ethernet breakout)
15+
- DC power supply (check the voltage and current requirement on the VLP16 user manual)
16+
- A PC with a physical Ethernet port, or a USB-to-Ethernet adapter
17+
18+
**Software (on host PC):**
19+
- Ubuntu 24.04
20+
- ROS 2 Jazzy (installation instructions at [docs.ros.org](https://docs.ros.org/en/jazzy/Installation.html))
21+
22+
> **Note:** This guide is based on Ubuntu 24.04 and ROS 2 Jazzy. The general steps apply to other Ubuntu/ROS 2 combinations, but package names, file paths, and commands may differ slightly.
23+
24+
---
25+
26+
## Step 1: Physical Connection and Power-Up
27+
28+
1. Connect the VLP-16's interface cable to your PC's Ethernet port (or USB-to-Ethernet adapter).
29+
2. Connect the power leads to your DC power supply.
30+
3. Power on the supply.
31+
32+
Within a few seconds of power-up, the sensor should begin spinning. The status LEDs will be turned on once the sensor is operational. If the unit does **not** spin, double-check if the power source provides correct voltage level and supply current.
33+
34+
---
35+
36+
## Step 2: Configure a Static IP Address on Ubuntu
37+
All data is streamed over **UDP/IP Ethernet**. Check the sensor's default IP address in the user manual, and set your PC to a static IP on the same subnet to receive packets.
38+
39+
The commands in the steps below use `192.168.1.201` as the lidar's IP and `192.168.1.100` as the PC's IP.
40+
41+
42+
### 2.1 Identify Your Ethernet Interface
43+
44+
With the Ethernet cable **not yet connected** to the LiDAR, run:
45+
46+
```bash
47+
ip a
48+
```
49+
50+
Look for an interface name such as `enp0s31f6`, `eth0`, `eno1`, or, for USB adapters, something like `enx144fd7c114ac`.
51+
52+
Note this name, and we will call it `<iface>` below. We will use `<iface>` as a placeholder for the actual network interface name in the below commands.
53+
54+
### 2.2 Assign a Temporary Static IP (Command Line)
55+
56+
```bash
57+
sudo ip addr flush dev <iface>
58+
sudo ip addr add 192.168.1.100/24 dev <iface>
59+
sudo ip link set <iface> up
60+
```
61+
62+
For example, if your interface is `enx144fd7c114ac`:
63+
64+
```bash
65+
sudo ip addr flush dev enx144fd7c114ac
66+
sudo ip addr add 192.168.1.100/24 dev enx144fd7c114ac
67+
sudo ip link set enx144fd7c114ac up
68+
```
69+
70+
Verify the address was applied:
71+
72+
```bash
73+
ip a show <iface>
74+
```
75+
76+
You should see `inet 192.168.1.100/24` in the output.
77+
78+
### 2.3 (Optional) Make the Static IP Permanent
79+
80+
The `ip addr` commands above are temporary — they will be lost after a reboot. If you want to persist the configuration, edit your Netplan configuration:
81+
82+
```bash
83+
sudo nano /etc/netplan/01-netcfg.yaml
84+
```
85+
86+
Add or modify the section for your interface:
87+
88+
```yaml
89+
network:
90+
version: 2
91+
ethernets:
92+
<iface>:
93+
dhcp4: no
94+
addresses:
95+
- 192.168.1.100/24
96+
```
97+
98+
Apply the configuration:
99+
100+
```bash
101+
sudo netplan apply
102+
```
103+
104+
---
105+
106+
## Step 3: Verify the Network Connection
107+
108+
Now **connect the Ethernet cable to the LiDAR** and ping the sensor's default IP:
109+
110+
```bash
111+
ping 192.168.1.201
112+
```
113+
114+
A successful response confirms network connectivity. If ping fails, check:
115+
- The Ethernet cable is seated in both the LiDAR interface box and the PC
116+
- The sensor is powered and spinning
117+
- Your IP was correctly assigned
118+
119+
120+
### 3.1 Verify UDP Data Packets (No ROS Required)
121+
122+
Even before installing any ROS packages, you can confirm the sensor is transmitting data using `tcpdump`:
123+
124+
```bash
125+
sudo tcpdump -i <iface> udp port 2368
126+
```
127+
128+
If the sensor is working, you will see a rapid flood of UDP packets. This step is highly recommended as it isolates hardware/network issues from ROS configuration issues. If `tcpdump` shows packets but ROS does not receive data, the problem is software-side. If `tcpdump` shows nothing, the problem is hardware or network.
129+
130+
### 3.2 Access the Velodyne Web Interface
131+
132+
The VLP-16 hosts a small configuration web page you can access from any browser:
133+
134+
```
135+
http://192.168.1.201
136+
```
137+
138+
From this page you can:
139+
- Change the sensor's IP address
140+
- Adjust the motor RPM (300–1200 RPM; lower RPM = denser point cloud per rotation)
141+
- Switch return mode: **Strongest**, **Last**, or **Dual** (dual doubles packet rate)
142+
- Update firmware
143+
144+
> If you change the sensor IP here, remember to update your static IP assignment and all ROS launch configurations to match the new address.
145+
146+
---
147+
148+
## Step 4: Install the Velodyne ROS 2 Driver
149+
150+
Install the Velodyne driver packages from the ROS 2 apt repository:
151+
152+
```bash
153+
sudo apt update
154+
sudo apt install ros-$ROS_DISTRO-velodyne*
155+
```
156+
157+
This installs three packages:
158+
- `velodyne_driver` — reads raw UDP packets from the sensor and publishes `VelodyneScan` messages
159+
- `velodyne_pointcloud` — converts raw scans into standard `sensor_msgs/PointCloud2` messages
160+
- `velodyne_msgs` — message type definitions
161+
162+
Source your ROS 2 environment (add to `~/.bashrc` if you haven't already):
163+
164+
```bash
165+
source /opt/ros/$ROS_DISTRO/setup.bash
166+
```
167+
168+
---
169+
170+
## Step 5: Launch the Driver and Verify Topics
171+
172+
Launch all Velodyne nodes with the VLP-16 configuration:
173+
174+
```bash
175+
ros2 launch velodyne velodyne-all-nodes-VLP16-launch.py
176+
```
177+
178+
In a second terminal, list the active topics:
179+
180+
```bash
181+
ros2 topic list
182+
```
183+
184+
You should see at minimum:
185+
186+
```
187+
/velodyne_packets
188+
/velodyne_points
189+
```
190+
191+
Confirm data is flowing:
192+
193+
```bash
194+
ros2 topic echo /velodyne_points --once
195+
```
196+
197+
If you see a large block of point data printed to the terminal, your hardware and driver are fully functional.
198+
199+
---
200+
201+
## Step 6: Visualize Point Clouds in RViz2
202+
203+
RViz2 is the standard 3D visualization tool bundled with ROS 2. It is the fastest way to inspect your point cloud data.
204+
205+
Launch RViz2:
206+
207+
```bash
208+
rviz2
209+
```
210+
211+
In the RViz2 interface, configure the following:
212+
213+
1. **Fixed Frame:** In the "Global Options" panel on the left, set the `Fixed Frame` to `velodyne`. This tells RViz2 to render everything relative to the LiDAR's own coordinate frame.
214+
215+
2. **Add a PointCloud2 display:** Click the **Add** button at the bottom of the Displays panel, select **By topic**, and choose `/velodyne_points` of type `PointCloud2`.
216+
217+
You should now see a live, rotating 360° ring of points around the sensor. Moving objects will update in real time. If you see a static or partial scan, check the rotation rate — at 300 RPM the update is slower but each scan is denser.
218+
219+
---
220+
221+
## Step 7: Visualize Point Clouds in Foxglove Studio
222+
223+
[Foxglove Studio](https://foxglove.dev/) is a modern, web-based (and installable) visualization tool that works with ROS 2 and is particularly useful when you want a richer interface than RViz2, or when working with recorded bag files.
224+
225+
### 7.1 Install Foxglove Studio
226+
227+
Download the desktop application from [foxglove.dev/download](https://foxglove.dev/download), or use the web version at [studio.foxglove.dev](https://studio.foxglove.dev).
228+
229+
Install the Foxglove bridge for ROS 2:
230+
231+
```bash
232+
sudo apt install ros-$ROS_DISTRO-foxglove-bridge
233+
```
234+
235+
### 7.2 Launch the Bridge
236+
237+
With your Velodyne driver already running in one terminal, open a second terminal and start the bridge:
238+
```bash
239+
source /opt/ros/$ROS_DISTRO/setup.bash
240+
ros2 launch foxglove_bridge foxglove_bridge_launch.xml
241+
```
242+
243+
By default, this exposes a WebSocket server on port `8765`.
244+
245+
### 7.3 Connect and Visualize
246+
247+
1. Open Foxglove Studio (desktop or browser).
248+
2. Click **Open connection****Rosbridge / Foxglove WebSocket**.
249+
3. Enter the address `ws://localhost:8765` (or replace `localhost` with your PC's IP if connecting from another machine on the network).
250+
4. Once connected, click the **+** button to add a **3D** panel.
251+
5. In the panel settings, add `/velodyne_points` as a topic. The point cloud will render in 3D immediately.
252+
253+
Foxglove offers several advantages over RViz2 for data exploration: you can overlay multiple sensor streams, adjust color maps, and use the timeline scrubber when replaying bag files — all from a clean, browser-style interface.
254+
255+
---
256+
257+
## Step 8: Record and Replay Data with ROS 2 Bags
258+
259+
Recording sensor data is essential for algorithm development and debugging, as it lets you replay exactly what the sensor captured during a real-world run.
260+
261+
### 8.1 Record a Bag File
262+
263+
Navigate to the directory where you want to store the bag, then run:
264+
265+
```bash
266+
ros2 bag record /velodyne_points
267+
```
268+
269+
This records the `/velodyne_points` topic. To record multiple topics simultaneously:
270+
271+
```bash
272+
ros2 bag record /velodyne_points /velodyne_packets /tf
273+
```
274+
275+
Press `Ctrl+C` to stop recording. The output will be a directory named:
276+
277+
```
278+
rosbag2_YYYY_MM_DD-HH_MM_SS/
279+
```
280+
281+
### 8.2 Replay a Bag File
282+
283+
```bash
284+
ros2 bag play rosbag2_YYYY_MM_DD-HH_MM_SS
285+
```
286+
287+
While the bag is playing, you can open RViz2 or Foxglove Studio exactly as described above — they will receive the replayed topic data just as if the physical sensor were connected.
288+
289+
Useful replay options:
290+
291+
```bash
292+
# Play at half speed (useful for slow-motion inspection)
293+
ros2 bag play rosbag2_YYYY_MM_DD-HH_MM_SS --rate 0.5
294+
295+
# Loop the bag continuously
296+
ros2 bag play rosbag2_YYYY_MM_DD-HH_MM_SS --loop
297+
```
298+
299+
### 8.3 Inspect Bag Contents
300+
301+
```bash
302+
ros2 bag info rosbag2_YYYY_MM_DD-HH_MM_SS
303+
```
304+
305+
This prints the recording duration, number of messages per topic, and storage format, which is a useful way to verify if a ROS bag is corrupted.
306+
307+
---
308+
309+
310+
## Summary
311+
312+
This tutorial covered VLP-16 setup: hardware connection, static IP configuration, ROS 2 driver setup, and point cloud visualization.
313+
- [Point Cloud Library (PCL), 3D Sensors and Applications](/wiki/sensing/pcl/)
314+
— Next step after getting the sensor running: processing and filtering the point cloud data in your pipeline.
315+
- [Cartographer SLAM ROS Integration](/wiki/state-estimation/cartographer-ros-integration/)
316+
— A LiDAR-based SLAM algorithm that consumes `/velodyne_points` directly for map building and localization.
317+
- [ROS Mapping and Localization](/wiki/common-platforms/ros/ros-mapping-localization/)
318+
— Overview of ROS mapping packages (gmapping, Hector Mapping) compatible with LiDAR data.
319+
- [ROS 2 Humble Intra-Process Communication Bag Recorder](/wiki/tools/ros2-humble-ipc-recorder/)
320+
— Optimized bag recording for high-bandwidth sensors like LiDAR, reducing CPU overhead vs. standard `ros2 bag record`.
321+
- [Stream Rviz Visualizations as Images](/wiki/tools/stream-rviz/)
322+
— How to stream your RViz2 point cloud view as an image topic, useful for remote monitoring or logging.
323+
324+
## Further Reading
325+
- [Velodyne VLP-16 User Manual](https://ouster.com/downloads/velodyne-downloads)
326+
- [ROS 2 Velodyne Driver Documentation](https://docs.ros.org/en/jazzy/p/velodyne_driver/)
327+
- [Foxglove Studio Documentation](https://docs.foxglove.dev/)

0 commit comments

Comments
 (0)