rapyuta-robotics/zethus

Large Latency in Images

Closed this issue · 5 comments

Our setup:

  • We encapsulate our ROS environment in a docker container which runs rosbridge + a camera node which streams from a USB camera. Port 9090 for rosbridge is exposed.
  • We then run zethus in another container with docker run -p 8080:8080 zethus, and we put the websocket address as 0.0.0.0:9090.

The issue:
While we can connect and visualize our streamed image topic fine, the latency is massive (1-2 second delay). We don't have the same issue when streaming the video out of web_video_server in the ROS container and accessing it on our docker host through the browser, so the issue must be somewhere between rosbridge, and zethus.

Do you have any idea how we could remove the latency, or what the issue might be?

Hi,
Zethus visualizes the topic messages received through rosbridge websocket but web_video_server serves raw video packets to the client over http. The delay might be at roslibjs.

We'll look into it and come up with a solution by tomorrow. Would it be possible to provide more information - the dimensions of image and the frequency it's published at.

Thank you

We're publishing 720p images using cv_camera at 30hz

@WesleyYue I tried to use cv_camera with my webcam:

rosparam set cv_camera/device_id 0
rosrun cv_camera cv_camera_node]

This seems to be working fine without any latency! (although I did not try publishing from the docker env).

Demo: https://i.imgur.com/qrNG1XG.mp4

Couple of questions:

  1. is there a latency only or some lag as well (also what is the FPS shown in Zethus)?
  2. would it be possible to reproduce the environment somehow?

@WesleyYue we are adding an option to display the image stream directly from web_video_server as an option. Should be available tomorrow.

@WesleyYue you can use ImageStream visualization type instead of Image in latest Zethus.
ImageStream takes a stream URL from the web_video_server.

I did find some lag when the video is kept running using the Image viz, and it seems that it can be attributed to the slow link between Zethus and the rosbridge server.