I want to communicate between 2 ROS systems using the rosbridge

asked 2020-09-30 02:26:07 -0600

ThomasR155 gravatar image

Im using ROS melodic and ubuntu 18.04 for my 2 ROS systems and want to code in Python. To start the rosbridge: roslaunch rosbridge_server rosbridge_websocket.launch To use websocket as a protocol I know I need to send JSON files and convert them back to ROS instructions Ive found 2 libraries that should be capable: http://wiki.ros.org/rosbridge_library and https://roslibpy.readthedocs.io/en/la.... The roslibpy seems more straight forward but isn't the official library I think? I need to publish/subscribe topics and call services. Which one do I need to use?

edit retag flag offensive close merge delete

Comments

This is not a use-case for rosbridge_server. Or at least not one for which it was designed afaik.

The bridge is supposed to be between ROS and a non-ROS application. There is no special support for the case where you have two ROS systems.

Could you perhaps clarify why you want to use rosbridge specifically for this?

gvdhoorn gravatar image gvdhoorn  ( 2020-09-30 13:16:57 -0600 )edit

thx for your answer :) I want to use the rosbridge because I don't have access to the other ROS system(lets call it ROS B) right now(no code etc.) However I need to be able to publish/subscribe topics on the ROS B via using ROS A (my own ROS system I have access to) Also ROS B is currently managed by a basic Website using roslibjs to transfer ROS commands via JSON and websocket. So in conclusion I want to replace this control website by a ros node in my ROS A system. I hope its more understandable now, feel free to let me know where I'm wrong. Im a ROS beginner.

ThomasR155 gravatar image ThomasR155  ( 2020-10-01 05:37:21 -0600 )edit

I'm not aware of there being built-in support for this scenario in rosbridge.

You'll have to write a node yourself, which essentially forwards the topics/services you're interested in from your ROS A to your ROS B and vice-versa.

Does ROS B (the closed-off ROS if I understand correctly) sit behind a firewall or make it difficult to reach ports on which it operates? If it doesn't, and you can reach the ROS B master, that would be much more convenient than trying to fiddle around with rosbridge to do this.

In essence you're sort-of trying to setup a multi-master setup, but without actually running one. You may want to look at how implementations such as multimaster_fkie do this (although because of the rosbridge involvement it may have to be implemented somewhat differently).

gvdhoorn gravatar image gvdhoorn  ( 2020-10-02 01:44:19 -0600 )edit