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

Setting endpoints in Pub/Sub in rclpy ROS2

asked 2018-06-10 06:52:50 -0600

vishal_rawat gravatar image

I am trying to run the demo example from rclpy client library .

My question is I am able to run the publisher and subriber example from the client library on the same machine. But Now I want to run these two on different machine for example I want to run my publisher on my windows host machine and the listener on Linux vitrual machine. Where can I set the endpoints for pub&sub in rclpy lib so that my publisher on windows can send data to the listener running on Linux VM.

Any help would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-06-10 06:56:13 -0600

gvdhoorn gravatar image

Where can I set the endpoints for pub&sub in rclpy lib so that my publisher on windows can send data to the listener running on Linux VM.

I believe you're misunderstanding how publish-subscribe works. In contrast to approaches where there are clients and servers, pub-sub systems are (comparable to) peer-to-peer. DDS (the default middleware for ROS2) then adds auto-discovery of domain participants (ie: nodes (but really: publishers and subscribers)).

So to answer your question: you don't.

The only thing you need to do is make sure that all involved hosts are on the same network segment and things "should just work".

edit flag offensive delete link more

Comments

Two additional comments:

  1. there are definitely ways to 'route' DDS traffic to specific IPs, but I don't believe that is necessary here
  2. using regular IP routing can also be used in case participants are not on the same network. Some special care will need to be taken as this is all UDP based.
gvdhoorn gravatar image gvdhoorn  ( 2018-06-10 06:58:20 -0600 )edit

So in that case you mean, I can just run a talker on windows using rclpy and run the listener on a Linux based VM where ROS2 is installed and they should automatically communicate by DDS's auto discovery ? @gvdhoorn

vishal_rawat gravatar image vishal_rawat  ( 2018-06-10 07:19:03 -0600 )edit

Yes, provided that the network configuration of the VM is correct (ie: probably in bridge mode) and the firewall configuration on both sides is correct (ie: not blocking things).

gvdhoorn gravatar image gvdhoorn  ( 2018-06-10 08:23:30 -0600 )edit

This is what i am trying to configure. As soon as i succeed, Ill give you an update...thanks

vishal_rawat gravatar image vishal_rawat  ( 2018-06-10 08:26:12 -0600 )edit

I have configured the network...i can now communicate between ROS2 talker on windows and ROS2 listener on Linux. Now how can i run the demo talker on windows using rclpy API. When I try to run demo_nodes_py talker.py from the terminal it throws up an error : rclpy module not found.

vishal_rawat gravatar image vishal_rawat  ( 2018-06-10 10:43:14 -0600 )edit

That would seem to be an entirely different issue. I recommend you open a new question to diagnose that.

gvdhoorn gravatar image gvdhoorn  ( 2018-06-10 10:58:04 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-10 06:52:50 -0600

Seen: 462 times

Last updated: Jun 10 '18