Network configuration for multi-robots » History » Version 2
Kévin Desormeaux, 2021-06-11 11:02
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 | 2 | Kévin Desormeaux | To configure the environment for multi-robots, ROS_MASTER_URI must design the host machine. So let's say this machine is named "kukarm", then every machine on the network must have this in its environment: |
13 | 1 | Kévin Desormeaux | |
14 | <pre> |
||
15 | 2 | Kévin Desormeaux | export ROS_HOSTNAME=kukarm |
16 | 1 | Kévin Desormeaux | export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 |
17 | </pre> |
||
18 | |||
19 | 2 | Kévin Desormeaux | To finish every non-host machine must provide its IP address to be known on the network. This is done by setting the ROS_IP variable: |
20 | 1 | Kévin Desormeaux | |
21 | 2 | Kévin Desormeaux | <pre> |
22 | export ROS_IP=140.93.16.149 |
||
23 | </pre> |
||
24 | |||
25 | This is not needed for the machine running roscore. |
||
26 | I have added scripts in the package of CM2C/MP2 to set the ROS environment for the computers kukarm and truyere. |
||
27 | I will paste below the configuration i used for the three computers: |
||
28 | |||
29 | |||
30 | <pre> |
||
31 | #personnal laptop running the planning stack (CM2P) |
||
32 | export ROS_HOSTNAME=azjol-nerub |
||
33 | export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 |
||
34 | |||
35 | #kukarm, operating panda_1 |
||
36 | export ROS_IP=140.93.16.149 |
||
37 | export ROS_MASTER_URI=http://Azjol-Nerub:11311 |
||
38 | |||
39 | #truyere, operating panda_2 |
||
40 | export ROS_IP=140.93.16.216 |
||
41 | export ROS_MASTER_URI=http://Azjol-Nerub:11311 |
||
42 | </pre> |
||
43 | |||
44 | 1 | Kévin Desormeaux | |
45 | More informations here: |
||
46 | |||
47 | http://wiki.ros.org/ROS/Tutorials/MultipleMachines |