Localhost vs. 0.0.0.0
I've had problems troubleshooting IP addresses with my setup and want to verify some questions, if you could help:
Should I use localhost or 0.0.0.0 when referring to myself, or does it have to be a real URI?
I have read that if you don't have a DNS name, you must use ROS_IP and not ROS_HOSTNAME, yet I see many examples where an ip address is used for ROS_HOSTNAME. For example, here: http://emanual.robotis.com/docs/en/pl... near the end you will see ROS_HOSTNAME=192.168.9.100
Can I omit both ROS_IP and ROS_HOSTNAME usually - unless I have more than one network adapter. If I have more than one then by default ROS would use all of them. But by specifying ROS_IP or ROS_HOSTNAME I can limit ROS to a specific one.
Followup
- 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?
Thanks!
Do you have links for these examples?
You can use either
ROS_IP
orROS_HOSTNAME
. If you have both set,ROS_HOSTNAME
will take precedence. See https://wiki.ros.org/ROS/EnvironmentV...Here's one example specifying an IP address with ROS_HOSTNAME: http://emanual.robotis.com/docs/en/pl... (you have to look for it near the end of that page.)
Also what about localhost vs. 0.0.0.0?
That tutorial that you linked to is incorrect.
ROS_HOSTNAME
is for hostnames such aslocalhost
, not IP addresses as that's whatROS_IP
is for.