RobotWebTools / rosbridge_suite

Server Implementations of the rosbridge v2 Protocol
https://robotwebtools.github.io
BSD 3-Clause "New" or "Revised" License
866 stars 506 forks source link

Subscriber to topic throughput decrease eventually #930

Open oriolorra opened 1 month ago

oriolorra commented 1 month ago

Hi,

I have encountered some odd behavior. At some point, a subscriber topic decrease throughput, when the publishing topic does not decrease the throughput.

  1. I have a cpp node publishing a string representing a base64 image at 10Hz, which its rate does not decrease over time. Checked via ros2 topic hz /b64_image.
  2. Rosbridge_server is launched too, via ros2 launch rosbridge_server rosbridge_websocket_launch.xml.
  3. A webpage is receiving /b64_image with roslibjs, and the image is rendered into a canvas. Eventually, the frame rate (fps) of message received decrease almost to 0 fps (image attached). If, I refresh manually, the webpage returns to 10fps but return to 0 fps a few seconds later.

Roslibjs topic is configured like this:

 var listener = new ROSLIB.Topic({
    ros : ros,
    name : '/b64_image',
    messageType : 'std_msgs/String',
    queue_size: 1,
    throttle_rate: 10
    })

image

Expected Behavior I expect to get an almost constant frame rate at 10 fps at the webpage, let's say forever.

Actual Behavior Webpage has 10 fps during only a few seconds/minuts.

Thanks