Ask Your Question

ROS Multiple Computers - adding a 2nd master

asked 2016-04-09 17:41:28 -0500

jacksonkr_ gravatar image

Current Scenario

  • Robot + Camera
  • Laptop

The robot runs roscore and the laptop runs rosrun rviz rviz. On the laptop I'm able to see the camera footage from the robot just fine.


I want to add another robot + camera to the equation. How can I make my laptop listen to the roscore's of each robot?

edit retag flag offensive close merge delete


excuse me i don't know the response. i want to ask you how laptop like node communicate on WiFi with Robot?

Emilien gravatar image Emilien  ( 2016-04-09 18:55:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-09 22:48:04 -0500

al-dev gravatar image

You can launch the roscore on your laptop (or any ROS device that stays connected during the experiment. it could be one of the robots) and then launch your two robots with roslaunch commands. If they are on the same network and you have correctly specified the ROS_MASTER_URI you should have no issues.

By default, the current version of ROS does not allow to have multiple ROS masters on the same network, but efforts have been made to implement this feature, you can have a look at the following packages :

This being said you might want to start working with a single master first and transition to multiple master only if needed. If you are working with a reliable network you probably don't need multiple masters.

Also, if you have multiple robots, make sure that you launch them in separate namespaces (e.g /robot1/,/robot2/ to avoid confusions and conflicts ...

edit flag offensive delete link more


I would really like to go with one master idea but I'm finding that the camera only streams if it's connect to a machine running roscore (aka a "master"). Is it possible to go the other way?

jacksonkr_ gravatar image jacksonkr_  ( 2016-04-10 07:37:36 -0500 )edit

After I wrote the previous comment I thought I something I might be doing wrong. I made the change and now everything works as I wanted with only one master. The issue was that I have to specify my ROS_IP for each machine in the system.

jacksonkr_ gravatar image jacksonkr_  ( 2016-04-10 07:58:55 -0500 )edit

dear jack I have been facing a similar problem. how can I specify my ROS_IP to have two devices working with one master?

MAlShamsi2323 gravatar image MAlShamsi2323  ( 2016-04-11 08:37:20 -0500 )edit

Just make sure that each device has the environment variable ROS_IP set to its own unique IP on the network interface that you are using, and ROS_MASTER_URI set to the IP of the ROS master.

al-dev gravatar image al-dev  ( 2016-04-11 11:40:41 -0500 )edit

What al-dev said. Additional simplification: ROS_IP should be different for each device. ROS_MASTER_URI should be the same for each device.

jacksonkr_ gravatar image jacksonkr_  ( 2016-04-11 19:13:13 -0500 )edit

This is a bit off topic, but wouldn't there be a problem if the robot has a robot_state_publisher node since tf does not support namespacing? (Two robots would both want to publish to the tf topic.)

raequin gravatar image raequin  ( 2018-08-01 12:22:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-04-09 17:41:28 -0500

Seen: 4,356 times

Last updated: Apr 09 '16