tier4 / ros2_v4l2_camera

Forked from https://gitlab.com/boldhearts/ros2_v4l2_camera
Apache License 2.0
40 stars 17 forks source link

ROS2: GPU/NVEncoder Acceleration #20

Closed Owen-Liuyuxuan closed 4 months ago

Owen-Liuyuxuan commented 4 months ago

This PR is the ROS2 refinement of https://github.com/tier4/ros2_v4l2_camera/pull/11.

It is still under-test.

Basic idea

Parameteres and Topics Changes:

Topics Direction Launch Parameters Description
/image_raw subscribe ${input_image_topic} Input raw image with RGB8 encoding sensor_msgs/Image
/camera_info subscribe ${camera_info_topic} The camera calibration information sensor_msgs/CameraInfo
/image_raw/compressed publish ${input_image_topic}/compressed The compressed output sensor_msgs/CompressedImage
/image_rect publish ${input_image_topic}/image_rect The rectified raw image sensor_msgs/Image
/image_rect/compressed publish ${input_image_topic}/image_rect/compressed The output compressed rectified image sensor_msgs/CompressedImage
Parameters default Description
rect_impl npp select rectifier implementation from npp, opencv_cpu, opencv_gpu.
use_opencv_map_init False select implementation of rectifier mapping, from OpenCV or NPP
alpha 0.0 The free scaling parameter for rectification; see OpenCV Documentation
input_image_topic image_raw Input image topic, will also influence the output
camera_info_topic camera_info Input camera info topic

Test going to implement:

Quick Testing Use of this PR:

# Beforehand, set up ROS2 download/paths and CUDA download/paths;
# Then under a workspace
cd  src
git clone --branch galactic https://github.com/tier4/ros2_v4l2_camera.git
git clone jetson_process
cd ../
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release

Testing:

image

Owen-Liuyuxuan commented 4 months ago

With the new commit, I have tested with x86-64 computers and the decompress process works well. (At least it is not dying and libturbojpeg works fine)

Owen-Liuyuxuan commented 4 months ago

https://github.com/tier4/accelerated_image_processor/tree/perf/modify_cuda_utilization によってcloseします。