Ask Your Question
0

When should roscors's ros_master_uri not just be localhost?

asked 2018-07-22 19:05:30 -0600

pitosalas gravatar image

updated 2018-07-23 08:34:40 -0600

On the computer running roscore, I understand that this is almost always sufficient.

export ROS_MASTER_URI=http://localhost:11311

Under what special circumstances does that computer need a specific IP address of ROS_MASTER? And does it ever need ROS_IP or ROS_HOSTNAME? My reasoning is that MASTER_URI points to roscore, which is itself, so localhost should always be good enough. I can't think of other scenarios, but they probably do exist!

edit retag flag offensive close merge delete

Comments

Are you asking if there are conditions when you should use an IP address in ROS_MASTER_URI instead of a hostname? (E.g., export ROS_MASTER_URI=http://192.168.0.0:11311 instead of export ROS_MASTER_URI=http://myrobot:11311.)

jayess gravatar imagejayess ( 2018-07-23 01:18:20 -0600 )edit

Note specifically I am talking about the computer running Roscore. My reasoning is that MASTER_URI points to roscore, which is itself, so localhost should always be good enough. I can't think of other scenarios, but they probably do exist!

pitosalas gravatar imagepitosalas ( 2018-07-23 08:33:59 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-07-23 11:23:06 -0600

jayess gravatar image

Using localhost is not always good enough for your ROS_MASTER_URI. It may be for many situations (especially when only using one computer), but not always. ROS_MASTER_URI needs to be accessible to every computer that you're going to be using and that's just not possible if you set ROS_MASTER_URI to localhost because every machine will be looking for roscore at its own localhost instead of the one that you intend.

Therefore, if you're going to be doing anything over a network, the address needs to be accessible over that network.

Check out the tutorial for running ROS on multiple machines.

edit flag offensive delete link more

Comments

1

I believe @pitosalas is wondering whether there are any situations in which you would configure ROS_MASTER_URI with a different value than localhost for the master itself (ie: the machine running roscore).

gvdhoorn gravatar imagegvdhoorn ( 2018-07-23 11:24:25 -0600 )edit
0

answered 2018-07-22 22:13:32 -0600

hamid gravatar image

updated 2018-07-22 22:14:23 -0600

ROS is a distributed computing environment. A running ROS system can comprise dozens, even hundreds of nodes, spread across multiple machines. Depending on how the system is configured, any node may need to communicate with any other node, at any time. this Tutorials explains how to start a ROS system using two machines

edit flag offensive delete link more

Comments

See comment above

pitosalas gravatar imagepitosalas ( 2018-07-23 08:34:07 -0600 )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

2 followers

Stats

Asked: 2018-07-22 19:05:30 -0600

Seen: 303 times

Last updated: Jul 23 '18