UbiquityRobotics / raspicam_node

ROS node for camera module of Raspberry Pi
BSD 3-Clause "New" or "Revised" License
293 stars 162 forks source link

Video Latency of 3-4 seconds and is it possible to have a raw video/images instead of compressed? #118

Open astronaut71 opened 2 years ago

astronaut71 commented 2 years ago

Hi Im using raspberry Pi 4 B and Camera Module V2 , so Im able to compile and run it but even the law resolution and 30fps launch file has a Video Latency of 3-4 seconds. Is it possible to reduce it and have in some how real time? Is that because is compressed video/image or? Can i display as a raw video/image, would that help to reduce the Video Latency?

Thanks

alvgaona commented 2 years ago

Hi @astronaut71, I've tested this on a Raspberry Pi 4 with a Raspberry Pi Camera Module v2.1. I was able to run the kinetic branch on a ROS Noetic distro, and I had no problem whatsoever with latency. The node is publishing at ~80 Hz for a 640x480 resolution. And, by the way, you can enable a raw image topic by setting the enable_raw:=true parameter.

astronaut71 commented 2 years ago

can you tell me what have you done to run it without any latency?

alvgaona commented 2 years ago

Nothing out of the ordinary @astronaut71. My set-up is Raspberry Pi 4 with a Raspberry Pi Camera Module v2.1 on Ubuntu Mate 20.04 with ROS Noetic. Let me correct myself on my last comment. This node only performs at ~45 Hz for a 640x480 resolution.

To allow my camera to work, I first had to install a few libraries by running:

sudo apt install libraspberrypi-dev

One question though. When you refer to latency, is this something related to low FPS? Or is it just a fixed delay?

astronaut71 commented 2 years ago

oh. Im not using Ubuntu mate. ROS melodic on Raspbian. I refer to a delay. At the delay is not fixed. Its increase with the time. FPS is fixed, its 30

alvgaona commented 2 years ago

Why don't you try an arm64 architecture OS? Raspian OS is 32 bit. Also, I believe ROS works much better with Debian based distros.

anfederman commented 2 years ago

As far as I know raspicam_node can be built and run in ARM64 Rasperry Pi 4 Ubuntu 20.04. The steps are to start with an Ubuntu 20.04 server sd card distro, add wifi via netplan configuration, lubuntu desktop and ros-noetic-desktop-full. apt install libraspberrypi-dev and -bin. make sure gpu_mem=128, start_x=1 in /boot/firmware/config.txt

After creating a catkin_ws git clone the raspicam_node and make it. you should be able to lanch the node and view the video via rqt_image_view.

if sending video over wifi, make sure it is compressed and wifi is at 5 not 2.4.

PS: raspicam node will also work on the ARM32 Ubuntu for RPi.

On Tue, Sep 7, 2021 at 10:50 AM Alvaro Gaona @.***> wrote:

Why don't you try an arm64 architecture? Raspian OS is 32 bit. Also, I believe ROS works much better with Debian distros.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/UbiquityRobotics/raspicam_node/issues/118#issuecomment-914503792, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHZ372E3PYP45L36IEQPLLUAZGG7ANCNFSM5CNQWZYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.