Skip to content

BEVFusion-ROS-TensorRT-CPP real time inference including ros1 & ros2.

Notifications You must be signed in to change notification settings

wk123467/BEVFusion-ROS-TensorRT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BEVFusion-ROS-TensorRT-CPP

This repository contains source code and models for BEVFusion online real-time inference using CUDA, TensorRT & ROS.

Supports ROS2. please switch to the galactic-devel branch

1 依赖安装

  • ubuntu-20.04,noetic,cuda-11.3, cudnn-8.6.0, TensorRT-8.5
  1. 默认已安装noetic, cuda, cudnn, 已下载TensorRT源码

  2. ros依赖

# 1. 建立ros工作空间
mkdir -p bevfusion_ws/src

# 2. 进入bevfusion_ws/src目录,拉取源码
cd bevfusion_ws/src
git clone https://github.com/linClubs/BEVFusion-ROS-TensorRT.git

# 3. 进入bevfusion_ws工作空间一键安装功能包需要ros依赖
cd .. 
rosdep install -r -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
  1. 模型下载参考

  2. 模型导出参考

  • 修改./tool/environment.shcuda tensorrt cudnn的路径, 运行./tool/build_trt_engine.sh生成tensorrt推理模型
./tool/build_trt_engine.sh
  1. ros包准备
  • bevfusion官方提供了已训练好的nuscenes模型参数

  • rosbag数据转换参考nuscenes2rosbag功能包

  • nuscenes传感器之间的参数已给出,无需标定

如果需接真实的传感器进行场景测试,需提前完成训练标定工作

传感器标定参考

2 编译运行

  1. 编译前需要修改CMakeLists.txtTensorRTCUDA路径,修改如下
...
# cuda
set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda-11.3) # CUDA修改这一行
set(CUDA_INSTALL_TARGET_DIR targets/x86_64-linux)
set(CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/${CUDA_INSTALL_TARGET_DIR}/include)
set(CUDA_LIBS ${CUDA_TOOLKIT_ROOT_DIR}/${CUDA_INSTALL_TARGET_DIR}/lib)

# TENSORRT
set(TensorRT_ROOT /home/lin/software/TensorRT-8.5.3.1)  # TensorRT修改这一行
# set(TensorRT_ROOT ~/share/TensorRT-8.5.3.1)           
set(TensorRT_INCLUDE_DIRS ${TensorRT_ROOT}/include)
set(TensorRT_LIBS ${TensorRT_ROOT}/lib/)
...
  1. 编译运行
  • bevfusion_node.launch修改model_nameprecision参数值

model_name: resnet50/resnet50int8/swint precision: fp16/int8 swint + int8模式不能工作

# 1. 编译
catkin_make

# 2. source工作空间
source devel/setup.bash

# 3. 运行bevfusion_node
roslaunch bevfusion bevfusion_node.launch

# 4. 播放数据集
 rosbag play 103.bag 
  1. 运行报错tool/simhei.ttf找不到, 全局搜索tool/simhei.ttf或者UseFont关键字

/src/common/visualize.cu中修改UseFont的值即可,改成simhei.ttf正确的路径即可


References

  • bevfusion

  • Lidar_AI_Solution

  • bev感知交流群-472648720, 欢迎各位小伙伴进群一起学习讨论bev相关知识!!!^_^

About

BEVFusion-ROS-TensorRT-CPP real time inference including ros1 & ros2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 59.3%
  • C++ 22.4%
  • Cuda 16.8%
  • Shell 1.1%
  • Other 0.4%