ROS_IP and ROS_HOSTNAME
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
- Why are there two environmental variables
ROS_IP
andROS_HOSTNAME
, even though both are treated almost same? - Is it better to always use
ROS_HOSTNAME
to avoid network troubles? I've seen some people have troubles because they set both variables andROS_IP
doesn't work as they expected.
Thanks in advance.
As a general comment, whenever I've had ROS networking issues exporting
ROS_HOSTNAME=$ROS_IP
fixes them.