Project

General

Profile

Network configuration for multi-robots » History » Revision 2

Revision 1 (Kévin Desormeaux, 2021-06-09 11:26) → Revision 2/3 (Kévin Desormeaux, 2021-06-11 11:02)

h1. Network configuration for multi-robots 

 All the machines must be on the same network. So for example laas-secure.  
 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. 
 By default your ROS configuration in a bashrc look like this: 

 <pre> 
 export ROS_HOSTNAME=localhost 
 export ROS_MASTER_URI=http://localhost:11311 
 </pre> 

 To You should 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: it like this: 

 <pre> 
 export ROS_HOSTNAME=kukarm ROS_HOSTNAME=HOST_NAME    for example export ROS_HOSTNAME=art-kukarm.laas.fr 
 export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 
 </pre> 

 To finish So to summarize, every non-host machine must provide its IP address to be known on have the network. This same ROS_HOSTNAME that is done by setting the ROS_IP variable:  

 <pre> 
 export ROS_IP=140.93.16.149 
 </pre> 

 This is not needed for IP of the machine running roscore.  
 I have added scripts in 
 ROS_MASTER_URI is usually the package of CM2C/MP2 ROS_HOSTNAME with the port 11311. But to set be sure you can run roscore on the ROS environment for the computers kukarm host machine and truyere.  
 I will paste below look at the configuration i used for prints in the three computers: 


 <pre> 
 #personnal laptop running terminal. 

 Sometimes the planning stack (CM2P) 
 export ROS_HOSTNAME=azjol-nerub 
 export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311 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. 

 #kukarm, operating panda_1 
 export ROS_IP=140.93.16.149 
 export ROS_MASTER_URI=http://Azjol-Nerub:11311 

 #truyere, operating panda_2 
 export ROS_IP=140.93.16.216 
 export ROS_MASTER_URI=http://Azjol-Nerub:11311 
 </pre> 


 More informations here:  

 http://wiki.ros.org/ROS/Tutorials/MultipleMachines