Tuesday, 2 February 2016

Setup ROS for multiple machines

1. Pre-request

  • Setup ssh for all computers, usually ssh-client is installed but not ssh-server.
      sudo apt-get install openssh-server
      sudo service ssh status
      sudo ufw allow ssh
    
  • Set host IP for each computer:
    • Get the IP:
        hostname -I
      
    • set IP for ROS_IP
        export ROS_IP=$IP_ADDR$
      

2. Master

There will be a computer run as master machine where roscore will be run.
  • Set ROS_MASTER_URI
      export ROS_MASTER_URI=http://localhost:11311
    
  • Start roscore
  • Start test program
      rosrun rospy_tutorials listener.py
    

3. Slaves (other machines)

  • ssh to remote PC
  • Set ROS_MASTER_URI
      export ROS_MASTER_URI=http://$MASTER_IP_HERE$:11311
    
  • Start test program
      rosrun rospy_tutorials talker.py
    
We should see in the master the message sent by slave is received.
http://nootrix.com/software/ros-networking/

No comments:

Post a Comment