We also prepared a full tutorial within the ROS Docs:
1 Like
I was re-reading this for a separate thing and I think you may find this interesting, specially Modifying remote servers list at run time. You can read more about it here.
Hi, whatâs in the tutorial works in the localhost setting but not across multiple machines (in the same network). Can you guess what I am missing?
Hi @yjkim046,
I donât know what exactly is that youâre doing but I can tell you what youâd need to modify to make the example work across machines:
- The discovery server should listen in an IP on the same LAN as the other machines. You can specify the serverâs listening address with the
--ip-address
option. - When setting the
ROS_DISCOVERY_SERVER
environment variable, you should set it to the listening address of the server.
Letâs say you have 3 machines with the following IPs:
Machine | IP | Application run |
---|---|---|
A | 192.168.1.10 | Discovery Server |
B | 192.168.1.11 | talker |
C | 192.168.1.12 | listener |
Then, youâd need to run:
Machine A
fastdds discovery -i 0 --ip-address 192.168.1.10
Machine B
export ROS_DISCOVERY_SERVER="192.168.1.10:11811"
ros2 run demo_nodes_cpp talker
Machine C
export ROS_DISCOVERY_SERVER="192.168.1.10:11811"
ros2 run demo_nodes_cpp listener