THIS repository is not NVIDIA's original repository.
Prerequisites:
ROS2(tested on galactic, Ubuntu 22.04LTS)
rclcpp
sensor_msgs
CUDA >= 11.3
TensorRT >= 8.4
To compile:
colcon build
Original repo uses data from .bin binary files. But to build a stream processing package, this package adapt loadData() function from main.cpp.
The PointPillars model input takes serialized lidar data. the data is serialized point by point. The points are featured and the domains must be 'x', 'y', 'z', 'intensity'. As the PointPillars algorithm input only takes original
Another tough thing to adapt to ROS2 is to build with CUDA, especially ROS2's ament system. Yet finally I succeeded in editing CMakeLists.txt and build with colcon build command.
find_package(CUDA REQUIRED)
set(TENSORRT_INCLUDE_DIRS /usr/include/x86_64-linux-gnu/)
set(TENSORRT_LIBRARY_DIRS /usr/lib/x86_64-linux-gnu/)
cuda_add_executable(pc_process src/pc_process.cpp src/cuda_pp_ros.cpp
src/cuda_pp_ros.cpp
src/pillarScatter.cpp
src/pointpillar.cpp
src/postprocess.cpp
src/preprocess.cpp
src/postprocess_kernels.cu
src/pillarScatterKernels.cu
src/preprocess_kernels.cu
)
Original Readme.md file can be found at
https://github.com/NVIDIA-AI-IOT/CUDA-PointPillars
This repository contains sources and model for pointpillars inference using TensorRT. The model is created with OpenPCDet and modified with onnx_graphsurgeon.
Overall inference has four phases:
- Convert points cloud into 4-channle voxels
- Extend 4-channel voxels to 10-channel voxel features
- Run TensorRT engine to get 3D-detection raw data
- Parse bounding box, class type and direction
The demo use the velodyne data from KITTI Dataset. The onnx file can be converted from pre-trained model with given script under "./tool".
To build the pointpillars inference, TensorRT with PillarScatter layer and CUDA are needed. PillarScatter layer plugin is already implemented as a plugin for TRT in the demo.
- GenerateVoxels has random output since GPU processes all points simultaneously while points selection for a voxel is random.
- The demo will cache the onnx file to improve performance. If a new onnx will be used, please remove the cache file in "./model".
- MAX_VOXELS in params.h is used to allocate cache during inference. Decrease the value to save memory.