[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

Mikael Arguedas via ros-users


I like have a try on topic publish/subscribe across a ip network, where can I get a example or instructions for such case? thanks.





---
[Visit Topic](https://discourse.ros.org/t/how-to-run-example-talker-listener-on-2-machines-with-different-ipaddr/2106/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

Mikael Arguedas via ros-users


Hi @jwang11

ROS2 (and more precisely DDS) uses UDP multicast to communicate the metadata allowing different node to discover each other and establish communication.
Additionaly DDS allows you to specify a domain ID that is a logical barrier to segregate networks.

If your two machines are on the same network and your network configuration allows UDP multicast communication you should be able to run talker/listener across machines by running:
On machine 1:

```
source <YOUR_ROS2_WORKSPACE>/setup.bash
ros2 run demo_nodes_cpp talker
```

On machine 2:
```
source <YOUR_ROS2_WORKSPACE>/setup.bash
ros2 run demo_nodes_cpp listener
```

If you don't want to interfere with other DDS systems on the same network you can set a domain ID, the domain ID is a number between 0 and 255, I'll use 42 in the following example:
On machine 1:
```
export ROS_DOMAIN_ID=42
source <YOUR_ROS2_WORKSPACE>/setup.bash
ros2 run demo_nodes_cpp talker
```
On machine 2:
```
export ROS_DOMAIN_ID=42
source <YOUR_ROS2_WORKSPACE>/setup.bash
ros2 run demo_nodes_cpp listener
```





---
[Visit Topic](https://discourse.ros.org/t/how-to-run-example-talker-listener-on-2-machines-with-different-ipaddr/2106/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

Mikael Arguedas via ros-users
In reply to this post by Mikael Arguedas via ros-users


Got it, thanks a  lot.





---
[Visit Topic](https://discourse.ros.org/t/how-to-run-example-talker-listener-on-2-machines-with-different-ipaddr/2106/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

Mikael Arguedas via ros-users
In reply to this post by Mikael Arguedas via ros-users


Hi, marguedas

I'm trying the similar thing, to get ros2_talker in my host to send messages to ros2_listener in virtualbox.
Host: macOS, using ROS2_beta1
VBox: Lubuntu16.04, using ROS2_beta2

I used the "Bridged" network setup on VBox and I was able to ping them on both sides.
I tried export ROS_DOMAIN_ID=42, but it doesn't seem to be working in my case. Do you have any ideas?





---
[Visit Topic](https://discourse.ros.org/t/how-to-run-example-talker-listener-on-2-machines-with-different-ipaddr/2106/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

Mikael Arguedas via ros-users
In reply to this post by Mikael Arguedas via ros-users


many things have changed "under the hood" between beta1 and beta2 so it is expected that they don't communicate out-of-the-box. Please try using beta2 on both machines and see if that fixes it.





---
[Visit Topic](https://discourse.ros.org/t/how-to-run-example-talker-listener-on-2-machines-with-different-ipaddr/2106/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] How to run example talker/listener on 2 machines with different ipaddr?

Mikael Arguedas via ros-users
In reply to this post by Mikael Arguedas via ros-users


Hi dhood,

Thank you. Beta2 on both sides works!





---
[Visit Topic](https://discourse.ros.org/t/how-to-run-example-talker-listener-on-2-machines-with-different-ipaddr/2106/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>