Publishing only Compressed Images only to decrease latency

asked 2020-03-23 12:36:11 -0500

zulfiz gravatar image

I am currently using ROS kinetic and haave tried video_stream_opencv and usb_cam packages to publish images from my camera. The problem with these packages are that they publish raw and theora topics as well in addition to compressed image topic. I only want to publish compressed images as I want to send the video stream over wi-fi to a remote location. I get a lot of latency when I am publishing so many extra topics. Is there a way to only publish compressed images?

edit retag flag offensive close merge delete

Comments

I get a lot of latency when I am publishing so many extra topics

Can you clarify how you've determined this?

If there are no subscribers, no data is sent over your wireless link.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-23 13:14:51 -0500 )edit

I run a rqt_image_view from my remote location and see that the video is delayed.

zulfiz gravatar image zulfiz  ( 2020-03-23 13:22:08 -0500 )edit

I specifically asked about how you determined you were "publishing so many extra topics".

Again: if there are no subscribers, there is no data transfer.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-23 13:23:15 -0500 )edit

Using rostopic list. Also on rqt_image_view I can see /image_raw, /theora and /compressed_image options. Selecting any one of them gives me an image feed

zulfiz gravatar image zulfiz  ( 2020-03-23 13:34:37 -0500 )edit

Yes, but the availability of topics does not mean there is any actual data transfer.

rqt_image_view is showing you the "index" or "table of contents". Only after a node has created an actual subscription will actual data be transferred. Before that, nothing is transmitted.

You could use a tool like Wireshark to check this.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-23 13:37:58 -0500 )edit