rapyuta-robotics / zethus

Realtime robot data visualization in the browser
https://rapyuta-robotics.github.io/zethus/
Apache License 2.0
118 stars 18 forks source link

Large Latency in Images #67

Closed WesleyYue closed 4 years ago

WesleyYue commented 4 years ago

Our setup:

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?

seadeep42 commented 4 years ago

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

WesleyYue commented 4 years ago

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

tocttou commented 4 years ago

@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?
tocttou commented 4 years ago

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

tocttou commented 4 years ago

@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.