Skip to content

The idea of this repo is to demonstrate how to deploy a ROS system across multiple machines

Notifications You must be signed in to change notification settings

arghadeep25/ROS_Multiple_Devices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Deploy ROS on Multiple Devices

In the field of robotics, we often encounter scenarios where it is necessary to run the ROS master on a server and connect embedded or edge devices to that server. This repository demonstrates how to connect single or multiple embedded or edge devices to the server

Single Publisher and Single Subscriber

Things to follow

  • Both devices are on the same network (either physically or virtually).
  • Get the IP address of the publisher (Linux: ifconfig, Windows: ipconfig)

Considering the above example,

IP Address of Publisher: 192.168.0.25 IP Address of Subscriber: 192.168.0.35

To ensure that both devices can reach each other, try pinging from both devices. If they can't communicate despite being on the same network, check the firewall settings.

Publisher

Usually, roscore runs on the local host when no IP address is specified. In this scenario, other devices cannot reach the publisher. Since the intention is to run a single roscore that other devices can connect to, it is necessary to start it by explicitly specifying the IP Address and Port Number. To do that,

DEVICE_IP="192.168.0.25"
export ROS_MASTER_URI="http://${DEVICE_IP}:11311"
export ROS_IP=${DEVICE_IP}

Local vs IP Address

roscore Lcoal

started roslaunch server http://arghadeep:44065/
ROS_MASTER_URI=http://arghadeep:11311/

roscore IP

started roslaunch server http://192.168.0.25:34961/
ROS_MASTER_URI=http://192.168.0.25:11311

Subscriber

As the roscore is running on another device that is connected to the same network, we can connect to the roscore by using

PUBLISHER_IP="192.168.0.25"
export ROS_MASTER_URI="http://${PUBLISHER_IP}:11311"

Single Publisher and Multiple Subscriber

Publisher

The steps are same for multiple devices

DEVICE_IP="192.168.0.25"
export ROS_MASTER_URI="http://${DEVICE_IP}:11311"
export ROS_IP=${DEVICE_IP}

Subscriber

The following command needs to be executed on every device that wishes to connect to the roscore.

PUBLISHER_IP="192.168.0.25"
export ROS_MASTER_URI="http://${PUBLISHER_IP}:11311"

Sample

To test the functionality, try the following repositories.

Publisher

Subscriber

Note: Don't forget to change the IP address in the run.sh scripts

About

The idea of this repo is to demonstrate how to deploy a ROS system across multiple machines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published