Skip to content

LiDAR Driver

The LiDAR driver produces 3D cone positions on the live path. Hesai UDP returns become a short list of centroids on /cones for point_to_pixel. Cameras do not create those positions.

On kumar, LiDAR UDP uses port 2368. A second process bound to that port starves or conflicts with the driver.

Receive and compute run on separate threads with a lock-free ring so packet intake is not blocked by clustering.

  1. UDP packets land in the ring and are decoded to 3D returns (mm internally).
  2. Points are binned into an angular-segment × range-bin grid (compile-time sizes; see table below).
  3. As each angular segment completes, Grace & Conrad removes ground-like returns.
  4. After the sweep cutoff, DBSCAN clusters the remaining cloud and emits one centroid per cluster.
  5. Centroids publish on /cones in metres (interfaces/msg/Points).

Cutoffs and DBSCAN/GnC thresholds are the usual levers when /cones is empty or noisy. Correction (.dat on bags, PTC live) belongs upstream of clustering: bad angles look like sparse or skewed cones even when UDP is healthy.

TopicType / notes
/conesinterfaces/msg/Points, metres. Contract into point-to-pixel and planning
/lidar/ground_filteredpoint cloud. Post-GnC viz; check here when filtering may have removed cones
/lidar/logLidarLog. Drops, timing, health. Use ros2 interface show for fields
/lidar/raw_pointswhen published. Converted returns for debug
/cone_arrayConeArray. Same centroids, debug only; coloring still uses /cones

Params file: package config/params.yaml. YAML values are metres; the node converts to millimetres internally.

ParameterEffect
x/y/z/radius_cutoffBounding volume before / during processing. Too tight → sparse /cones
height_threshold, upper_height_thresholdGnC keep-band above the fitted ground line
min_points, epsilonDBSCAN density. Too high min_points or too small epsilon → missed cones
dbscan2_on, epsilon2Optional second pass on centroids (mostly lidar-dev)
prodlidar-dev
Angular segments3220
Range bins1025

Segment width is 180/Nsegments180^\circ / N_{\text{segments}}. Finer grids change GnC locality and cost; they are compile-time, not ROS params.

SymptomLikely cause
No /cones, no UDPPort 2368, ethernet, driver not up
UDP ok, empty /cones, empty ground-filteredCutoffs, correction, or everything classified as ground
Ground-filtered still has cone-like blobs, empty /conesDBSCAN (min_points / epsilon)
Steady hz but climbing drops in /lidar/logCPU / ring overflow / competing binders
High process timeLoose cutoffs (too many points through GnC/DBSCAN)

Operator checklist: ops. Stack context: architecture.

Terminal window
cd driverless_ws
colcon build --symlink-install --packages-select custom_ros_driver
source /opt/ros/humble/setup.bash && source install/setup.bash

On trees that renamed the package, select lidar_driver instead.