Why does it get the hostname of the machine when ROS_HOSTNAME is not specified?

asked 2020-12-28 00:33:19 -0500

takanotume24 gravatar image

updated 2020-12-28 10:48:46 -0500

I tried to connect to another machine by using the machine option in the <node> tag of the launch file.

I noticed that if the destination machine does not have ROS_HOSTNAME in its env.sh file, it uses the machine's hostname as URI. For example, if the hostname of the machine is pi, it will try to use http://pi:[port].

There are a few questions here.
1. is this a function that expects name resolution to be written in /etc/hosts?
2. env.sh is erased when I run catkin clean. Is there any good solution?
2. sorry, this may be an unnecessary suggestion, but how about using avahi-daemon (expecting avahi-daemon to be installed) to access pi.local by default?

Thank you.

edit retag flag offensive close merge delete