Ask Your Question
4

ROS_IP and ROS_HOSTNAME

asked 2016-11-18 17:15:58 -0600

otamachan gravatar image

Hello,

In my understanding according to the wiki, ROS_IP is for the IP address of the host machine where a ROS node runs and ROS_HOSTNAME is for a resolvable host name. But I'm confused because an IP address is also a resolvable name(maybe resolved name?). So even when I set an IP address to ROS_HOSTNAME, everything works well.

I saw the source codes and found that both are treated almost same(rocpp, rospy).

So my questions are

  1. Why are there two environmental variablesROS_IP and ROS_HOSTNAME, even though both are treated almost same?
  2. Is it better to always use ROS_HOSTNAME to avoid network troubles? I've seen some people have troubles because they set both variables and ROS_IP doesn't work as they expected.

Thanks in advance.

edit retag flag offensive close merge delete

Comments

As a general comment, whenever I've had ROS networking issues exporting ROS_HOSTNAME=$ROS_IP fixes them.

spmaniato gravatar imagespmaniato ( 2016-11-19 18:09:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-12-08 19:09:22 -0600

130s gravatar image

updated 2017-12-08 20:52:03 -0600

Not an answer, but IMO this is a worthwhile thing to discuss as a possible improvement in ros_comm, so I opened a ticket.

The example section in the NetworkSetup wiki explains when having both variables are useful, but the usecases there don't sound convincing enough to me that we have to have 2 different variables.

If there are actually usecases where separate variables are needed, I/we'd appreciate if you share the story in the linked ticket.

edit flag offensive delete link more

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: 2016-11-18 17:15:58 -0600

Seen: 1,798 times

Last updated: Dec 08 '17