Skip to content

Latest commit

 

History

History
125 lines (100 loc) · 4.96 KB

README.md

File metadata and controls

125 lines (100 loc) · 4.96 KB

pcdet_ros2

This is a ROS 2 Wrapper for [OpenPCDet].

Sample Rviz2

Test System

  • Computation: i9-12900K, GPU 4080
  • System Setup:
    • Ubuntu 22.04, ROS 2 Humble
    • CUDA 11.7, CuDNN 8.5.0.96
    • Python 3.10, PyTorch 2.0
  • OpenPCDet Version: v0.6.0

Status

  • Successfully Tested with Kitti 3D Object Detection and nuScenes based models.
  • The package can be used for deployment of the models. For deployment it is not necessary to download the dataset, it will directly work with the input pointcloud.

Content

OpenPCDet Installation

Quick Installation compatible with the setup specified above:

git clone https://github.com/open-mmlab/OpenPCDet
python3 -m pip install torch torchvision torchaudio
python3 -m pip install tensorflow
python3 -m pip install spconv-cu117
cd OpenPCDet
python3 -m pip install -r requirements.txt
python3 setup.py develop
python3 -m pip install kornia open3d
python3 -m pip install pyquaternion

Please refer to OpenPCDet's INSTALL.md for the original installations instructions of OpenPCDet. Try the Quick Demo to verify installations.

  • This project provides a docker installation reference DOCKER_INSTALL.md which is highly recommended.

Installation

Build the Packages

# GOTO the ros 2 workspace
cd src/
git clone https://github.com/Box-Robotics/ros2_numpy -b humble
python3 -m pip install catkin_pkg
sudo apt install ros-humble-ament-cmake-nose -y
python3 -m pip install nose
python3 -m pip install transform3d
git clone https://github.com/pradhanshrijal/pcdet_ros2
cd ..
rosdep install -i --from-path src --rosdistro humble -y
colcon build --symlink-install --packages-select ros2_numpy pcdet_ros2
# Source the workspace

Download the weights
Example:

  • Download the PV-RCNN pre-trained weight for the Kitti Dataset [model-50M].
  • Copy the weight to the checkpoints folder of the pcdet_ros2 package.

Check OpenPCDet's Model Zoo for available models and weights.

P.S. Symlink connections will save a lot of storage space and help organise the files.

Usage

ros2 launch pcdet_ros2 pcdet.launch.py

Parameters

Parameter Description
config_file Local Path to the configuration file for the model.
model_file Local Path to the pre-trained weight for the model.
allow_memory_fractioning Boolean to activate setting a limit to the GPU Usage.
  Used together with device_memory_fraction.
allow_score_thresholding Boolean to activate the removal of low scored detections.
  Used together with threshold_array.
num_features Parameter to specify data transformation of pointcloud.
  For Kitti the value is 4.
  For nuScenes the value is 5.
device_id ID for the GPU to be used.
device_memory_fraction GPU Memory (in GB) used for the detections.
  Used together with allow_memory_fractioning.
threshold_array Threshold values for low scoring detections.
  Used together with allow_score_thresholding.
  See the config_file for the list of detections.

Docker

To make things easier a docker container has been added to this repo which recreates the environment specified in this repository. Here are the usage instructions:

  1. Install Docker
  2. Install nvidia-container-toolkit
  3. Clone this repository into a workspace
  4. Run ./docker/build_container.sh this will take a while and is about ¬20Gb
  5. To run the container run ./docker/run_container.sh
  6. Then run ./run_pcdet.sh

Note you may need to manually run_pcdet.sh

source /opt/ros/humble/setup.bash
source /ros2_ws/install/setup.bash
ros2 launch pcdet_ros2 pcdet.launch.py

Note minor issues with using shared memory for pointcloud transfer. pcdet_ros2 expects a pointcloud on2 /kitti/pointcloud and returns vision_msgs/Detection3DArray.msg on /cloud_detections

License

pcdet_ros2 is released under the MIT License.

Citation

If you find this project useful in your research, please consider citing the original work:

@misc{openpcdet2020,
    title={OpenPCDet: An Open-source Toolbox for 3D Object Detection from Point Clouds},
    author={OpenPCDet Development Team},
    howpublished = {\url{https://github.com/open-mmlab/OpenPCDet}},
    year={2020}
}