Break ros2_v4l2_camera as two standalone packages. (If we further stress on efficiency instead of flexibility, we should consider merging them in the future).
The ros2_v4l2_camera stays the same as in the main. But I do not recommend launching the camera drivers with image_transport (which automatically use CPU encoding).
As part of integration research, we will test the code on work on both x64 CPUs but also on Jetson machines. The base platform will be the Adlink ROSCube 580&58g.
We are first going to make sure we are actually using GPU/NVEncoder to compress the data.
Then we will benchmark the results.
Hopefully, all ROSCube/Orin-related projects should be using the GPU encoder instead of the CPU encoder.
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:
Firstly, it works on ROSCube 58g and it boosts up NVJPEG.
Comparing the decompressing capability of image_transport and our PR. Testing against 20Hz of 1920*1440 image streams. ROS2 image_transport will use 60%-80% of CPU. This PR uses 20%-30% of CPU. We can see a significant reduction on the CPU time.
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:
sensor_msgs/Image
sensor_msgs/CameraInfo
sensor_msgs/CompressedImage
sensor_msgs/Image
sensor_msgs/CompressedImage
npp
,opencv_cpu
,opencv_gpu
.Test going to implement:
Quick Testing Use of this PR:
Testing: