fkie / multimaster_fkie

ROS stack with FKIE packages for multi-robot (discovering, synchronizing and management GUI)
BSD 3-Clause "New" or "Revised" License
272 stars 106 forks source link

Is this hack still needed? #128

Closed MJohnson459 closed 4 years ago

MJohnson459 commented 4 years ago

https://github.com/fkie/multimaster_fkie/blob/81a9d18c5100094b7f64abab249ed76b6383f41a/fkie_master_sync/src/fkie_master_sync/sync_thread.py#L435

Hi! I've been using FKIE with a large number of shared connections and I'm hitting an issue where if a new master connects, there is a huge flurry of publisherUpdates being performed. This in turn is causes issues by (what seems like) overloading some of the masters. This flurry is ultimately caused by the above code.

Looking at the ROS master API docs, it seems like this might not be required anymore. wiki.ros.org/ROS/Master_API

Subscribe the caller to the specified topic. In addition to receiving a list of current publishers, the subscriber will also receive notifications of new publishers via the publisherUpdate API.

I'm happy to supply a PR for the change but before I even tried removing it, I was hoping someone could help me understand why it exists in the first place.

atiderko commented 4 years ago

Why the hack is there: If we register a new publisher using 'registerPublisher' of wiki.ros.org/ROS/Master_API all subscriber are notified about master_api.py#L758 On subscriber registration using 'registerSubscriber' we get only the list of subscriber master_api.py#L703 and not publisher are notified. Therefore no connection between local publisher and remote subscriber will be established.

Perhaps it is possible to use publisherUpdate to reduce the overloading of masters.

I'm happy about PR ;-)

atiderko commented 4 years ago

replaced the hack by publisherUpdate call

akifh commented 1 year ago

Hi @atiderko, seems like this change did not make it to melodic-devel releases. Is there any specific reason for this? Thanks