Reconnection to Rosbridge does not reliably re-advertise topics
See original GitHub issueThis comes from a report from a user of my extension, not sure what version they’re using but it’s fairly recent and on macOS.
My panel has a button that publishes a /bladescript/execute
message. The panel is written as a React functional component like so:
function BladescriptPanel(
{ context }: { context: PanelExtensionContext }
): JSX.Element {
...
// Set up rendering for the panel
useLayoutEffect(() => {
...
// Advertise that we publish scripts
context.advertise?.("/bladescript/execute", "std_msgs/String");
}, [context]);
...
}
Occasionally the user gets a complaint from Rosbridge when pressing the button that it was not expecting the publication of the /bladescript/execute
message. My theory is that this has to do with when the connection is lost and then the connection gets re-established.
Am I misusing the API here?
Issue Analytics
- State:
- Created a year ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Problem of md5sum warning when web is refreshed #138
When web client using roslibjs is refreshed, md5sum warning is occurred. ... Reconnection to Rosbridge does not reliably re-advertise topics ...
Read more >Rosbridge - isConnected() ? - ROS Answers
Hi, I'm working with Rosbridge at the moment, and trying to determine from the ROS side (server) whether the websocket connection is ok....
Read more >roslibpy - Read the Docs
Python ROS Bridge library allows to use Python and IronPython to interact with ROS, the open-source robotic middleware.
Read more >Establishing remote networks for ROS applications via Port ...
PF does not require a bridge or a middle point, instead it creates direct ROS-to-ROS channel as if the connection was local, alibi...
Read more >ROS web tutorial part 1 - rosbridge server and roslibjs
Rosbridge suite is a set of packages that allows to exchange information between ROS and any other application capable of parsing JSON.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In order for rosbridge clients to publish to ROS topics, the rosbridge server has to internally create a ROS publisher which is used to publish to the actual ROS topic. This is done when a client sends an advertise operation to the rosbridge server. Future messages sent from the rosbridge client (via the publish operation) will be published to the ROS topic using the previously created ROS publisher. Note that only a single ROS publisher is created per topic. E.g. when there are more then one rosbridge clients publishing to the same topic, the same ROS publisher is used on the server side.
After all clients that previously published to this topic disconnected (or called the unadvertise operation), the internal ROS publisher is unregistered after a certain timeout (
unregister_timeout
). This leads to the warning messages you mentioned above being logged, which is a consequence of https://github.com/ros/ros_comm/issues/111. So in order to mitigate this, your best option is to avoid unregistering of internal ROS publishers which can be done by setting theunregister_timeout
to a high enough value.It is not a big problem, but these messages cause unnecessary changes to the ros graph so it would be good if we could avoid them.
In #4653, I parameterized the
_setupPublishers
method. This avoids the unnecessary websocket messages and also doesn’t require adding a debounce.