ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

How do I make a ROS2 node communicate with a remote ROS2 node network?

asked 2018-08-27 12:53:36 -0500

sccg gravatar image

updated 2018-08-27 15:01:13 -0500

I currently have ros1(kinetic) communicating via a rosbridge with a ros2 node, and I'd like to send data from those ros2 nodes to remote ros2 nodes. I read here that since there's no roscore, you need to use ROS_DOMAIN_ID to communicate with other nodes on the same network. What if you're not on the same network though? Also, how would you set up them to communicate if you were?

edit retag flag offensive close merge delete

Comments

1

I read here that since there's no roscore, you need to use ROS_DOMAIN_IP [..]

just a note: the name of the environment variable is ROS_DOMAIN_ID, not IP.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-27 14:53:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-01-19 06:43:08 -0500

Raza Rizvi gravatar image

If the nodes are running on separate machines, but are in the same network, you can just use the ROS_DOMAIN_ID as a unique identifier of the ROS_DOMAIN they should use to communicate.

So, from both the machines, export the ROS_DOMAIN_ID as an environment variable, which will be used as a identifier.

For example, run the following command on both the machines.

export ROS_DOMAIN_ID=42

And you should now be able to list / echo / publish / subscribe, to ROS Topics easily.

For separate networks, I am not sure how it will work. Never tried.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-08-27 12:53:36 -0500

Seen: 792 times

Last updated: Jan 19 '22