Project

General

Profile

Network configuration for multi-robots » History » Version 3

Kévin Desormeaux, 2021-06-11 11:07

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 3 Kévin Desormeaux
!network_conf2.png!
31
32
33 2 Kévin Desormeaux
<pre>
34
#personnal laptop running the planning stack (CM2P)
35
export ROS_HOSTNAME=azjol-nerub
36
export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311
37
38
#kukarm, operating panda_1
39
export ROS_IP=140.93.16.149
40
export ROS_MASTER_URI=http://Azjol-Nerub:11311
41
42
#truyere, operating panda_2
43
export ROS_IP=140.93.16.216
44
export ROS_MASTER_URI=http://Azjol-Nerub:11311
45
</pre>
46
47 1 Kévin Desormeaux
48
More informations here: 
49
50
http://wiki.ros.org/ROS/Tutorials/MultipleMachines