ROS2 camera image publish rate is not stable (lower than expected)

asked 2020-09-20 08:08:26 -0500

kzym53 gravatar image

updated 2020-09-23 23:12:48 -0500

Environment
PC: lattepanda alpha 864s(Core m3-8100Y)
OS: Ubuntu 18.04
distro: ROS2 dashing
camera: logicool c270n

I want to publish camera image at 640x480 at 30 FPS so I tried

ros2 run image_tools cam2image -f 30 -x 640 -y 480

It's sometimes worked well but most of times it's publish late is less than expected (around 20FPS, or 15 FPS or 7 FPS at the worst).
I tried:
- Changed package to publish. I tried ros2_usb_camera and opencv_cam but the same issue happened.
- Checked QOS setting. Its reliability setting is "best effort" and it seems good.
- Checked CPU and memory usage. CPU is around 10% and memory is 20%.
On ROS1 melodic I can do that stably on same environment so I'm investigating the difference from ROS1 but I have no idea.
If you have an idea, please help.
Thank you in advance.

edit retag flag offensive close merge delete