How epvelasco/pc2image works
Project type and purpose
• This is a small ROS (Robot Operating System) package named “pc2image.”
• Purpose: Subscribe to a Velodyne VLP-16 3D‐LiDAR point cloud, convert it into a 16-bit mono depth image, and publish it for downstream consumers (e.g., visualization or computer vision nodes).
File structure
• Top‐level files:
• CMakeLists.txt & package.xml → ROS build/config metadata
• README.md & LICENSE → documentation and licensing
• images/ → sample output GIF demonstrating functionality
• launch/VLP16_image.launch → ROS launch file to start this node
• src/ directory:
• pc2image.cpp → main node: subscribes to sensor_msgs/PointCloud2, converts to mono16 image, publishes sensor_msgs/Image
• interpolated_lidar.cpp → alternative or helper algorithm: performs interpolation to fill missing depth samples
• No frontend/backend split – this is a single‐service middleware component in a robotics stack.
README for additional insights
• Dependencies: ROS Kinetic/Melodic, velodyne-pointcloud driver (publishes raw PointCloud2), PCL (Point Cloud Library).
• Run instructions:
1. Build via catkin_make
2. Launch via roslaunch pc2image VLP16_image.launch
a. Main components:
• Velodyne VLP-16 sensor (external hardware)
• velodyne_pointcloud_node (ROS driver)
• ROS Master (core)
• pc2image node (this package)
• (Optional) image_view or custom consumer node
• PCL library (internal processing library)
b. Relationships and interactions:
• Velodyne sensor streams raw data to the velodyne driver → publishes on /velodyne_points (sensor_msgs/PointCloud2)
• pc2image node subscribes to /velodyne_points → processes points (interpolation or direct mapping) → publishes on /depth_image (sensor_msgs/Image mono16)
• Downstream nodes (e.g., rviz, image_view) subscribe to /depth_image
• All nodes register with ROS Master for service discovery
c. Architectural patterns and design principles:
• Modular node‐based architecture – each ROS node handles one responsibility (separation of concerns)
• Pub/Sub messaging for loose coupling and run‐time reconfiguration
• Use of PCL for heavy point‐cloud computations (leverage existing library rather than reimplement)
d. Technologies, frameworks, libraries:
• ROS (Kinetic/Melodic) – communication and orchestration
• velodyne_pointcloud driver – raw data acquisition
• PCL – point cloud processing
• OpenCV (via cv_bridge) – image encoding/decoding (implicit)
Essential details to capture
• The launch file’s role in bringing up velodyne driver and pc2image.
• The two processing modes (pc2image.cpp vs. interpolated_lidar.cpp) if both are used.
• All topic names, message types, and node names.
• Dependency on PCL and cv_bridge for conversion routines.