This node converts 3D point clouds (PointCloud2) to 2D laser scans (LaserScan) with configurable height, angle, and range filtering. It applies a 3D transform to points before projection. This node is cross-compatible with ROS1 and ROS2 (the build automatically detects the ROS version).
- ROS: ROS1 Noetic or ROS2 Humble/Iron
- System Packages:
# Ubuntu/Debian sudo apt install build-essential cmake libgoogle-glog-dev libgflags-dev \ liblua5.1-0-dev libeigen3-dev
-
Clone this repository.
-
For ROS1: Add to your
~/.bashrc:echo "export ROS_PACKAGE_PATH=$(pwd):\$ROS_PACKAGE_PATH" >> ~/.bashrc source ~/.bashrc
-
For ROS2: Add to your
~/.bashrc:echo "export AMENT_PREFIX_PATH=$(pwd)/install:\$AMENT_PREFIX_PATH" >> ~/.bashrc source ~/.bashrc
-
Build:
make
Edit config/highbeams.lua to configure:
- range_min/max: Distance filtering (m)
- angle_min/max: Angular range (rad)
- height_min/max: Z-axis filtering (m)
- num_ranges: Number of laser scan rays
- Topics: Input PointCloud2 and output LaserScan topic names
# Start the converter
./bin/pointcloud_to_laserscan --config=config/highbeams.lua
# With verbose output
./bin/pointcloud_to_laserscan --config=config/highbeams.lua --v=1