Network configuration for multi-robots » History » Version 1
Kévin Desormeaux, 2021-06-09 11:26
1 | 1 | Kévin Desormeaux | h1. Network configuration for multi-robots |
---|---|---|---|
2 | |||
3 | All the machines must be on the same network. So for example laas-secure. |
||
4 | One machine must be the host, hence running roscore, and every other machine must know which machine is the host. For that we need to configure the bashrc of every machine. |
||
5 | By default your ROS configuration in a bashrc look like this: |
||
6 | |||
7 | <pre> |
||
8 | export ROS_HOSTNAME=localhost |
||
9 | export ROS_MASTER_URI=http://localhost:11311 |
||
10 | </pre> |
||
11 | |||
12 | You should configure it like this: |
||
13 | |||
14 | <pre> |
||
15 | export ROS_HOSTNAME=HOST_NAME for example export ROS_HOSTNAME=art-kukarm.laas.fr |
||
16 | export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 |
||
17 | </pre> |
||
18 | |||
19 | So to summarize, every machine must have the same ROS_HOSTNAME that is the IP of the machine running roscore. |
||
20 | ROS_MASTER_URI is usually the ROS_HOSTNAME with the port 11311. But to be sure you can run roscore on the host machine and look at the prints in the terminal. |
||
21 | |||
22 | Sometimes the name of the host machine cannot be resolved. You can try to ping it. If it fails try to directly ping the IP of the machine. If it works, you might want to replace ROS_HOSTNAME with ROS_IP. |
||
23 | |||
24 | More informations here: |
||
25 | |||
26 | http://wiki.ros.org/ROS/Tutorials/MultipleMachines |