Kinetic to Melodic migration question
As my first post, I apologise if this question has been asked before, it is just that my searches here and with google pointed at the site:answers.ros.org did not reveal any insight into my challenge.
OVERVIEW
In both scenarios I use a ROS Master (robot), and a ROS Client/Slave (Laptop)
WiFi network provides DHCP on router without DNS registration or DNS services
I have also tried static IP's on both with a cable directly between both robot and laptop and get same error
No firewalls on either versions of Ubuntu
Multicast DNS is what is relied upon using avahi-daemon in default config
For the purpose of this question the FQDN of Robot and Laptop are as below:
Robot FQDN: rosbot.local Robot hostname: rosbot
Laptop FQDN: laptop.local Laptop hostname: laptop
Robot .bashrc entries:
ROS_MASTER_URI=http://rosbot.local:11311
ROS_HOSTNAME=rosbot.local
Laptop .bashrc entries:
ROS_MASTER_URI=http://rosbot.local:11311
ROS_HOSTNAME=laptop.local
WORKING ROBOT
In the Kinetic/Ubuntu 16.04 scenario all is working fine
On Robot I launch roscore and on the Laptop I run roswtf, rviz, rqt graph all work fine and as expected
Network validation checks have been completed as per http://wiki.ros.org/ROS/NetworkSetup
NOT WORKING ROBOT
In the Melodic/Ubuntu 18.04 scenario, it seems hostname and NOT FQDN is now the preferred choice for the likes of roswtf, rviz, and rqt graph
Network validation checks have once again been completed as before
As per Kinetic, I launch roscore and on laptop I run roswtf and get the following error message:
running graph rules...
ERROR: Unknown host [rosbot] for node [/rosout]
... done running graph rules
ERROR Errors connecting to the following services:
* service [/rosout/set_logger_level] appears to be malfunctioning: Unable to communicate with service [/rosout/set_logger_level], address [rosrpc://rosbot:53773]
* service [/rosout/get_loggers] appears to be malfunctioning: Unable to communicate with service [/rosout/get_loggers], address [rosrpc://rosbot:53773]
Launching rviz and rqt_graph also not working
During this testing, I did the following as a temporary fix and this proved my suspicion about hostname and NOT FQDN being used in Melodic:
I added a host IP entry for the name rosbot into the /etc/hosts file of the laptop
After doing this roswtf, rviz, and rqt graph all work again
Unfortunately in a dynamic IP environment, writing a script workaround on the laptop to do this every time the robot gets a new IP is not the preferred direction I would like to take.
Something has obviously changed between Kinetic and Melodic, and any assistance in identifying what it is and some direction I can take from here would really be appreciated.
Respectfully,
Ant
Are you sure that this is a difference in the ROS code and not in Ubuntu?
Is this your personal wifi network, or from a school or corporation? It's really unusual that it would not provide DNS lookup for the DHCP-assigned hosts.
@Humpelstilzchen - I am not sure at this stage. I can tell you that both kinetic and melodic systems are simple build installs which I completed myself. The only modifications to system have been for the robot usb assignments.
But since the issue is occurring on the laptop, the build method follows these simple steps:
Install Ubuntu desktop from USB (made using rufus and ISO)
During build I set hostname and timezone and leave all else at defaults
Install ROS using respective instructions on ros.org website
Install required ROS packages
@Mike Scheutzow - Its a maker space workshop, which we have no control over the gateway. I agree it is unusual, but its not the only place I have encountered this. Besides, Kinetic scenario is working at this location, and Melodic is not?
Since the first indication of issues is seen when I run roswtf on the laptop:
running graph rules...
ERROR: Unknown host [rosbot] for node [/rosout]
... done running graph rules
I started to look into differences in the roswtf python files.
These can be found in the following path (note that [distro] refers to version of ROS):
/opt/ros/[distro]/lib/python2.7/dist-packages/roswtf/
I can see that the error message above from running roswtf is generated from environment.py
I can also see differences in 6 out of the 13 files in that folder, including a file called network.py
What I am unable to do is determine in detail why it appears that Kinetic uses the FQDN and Melodic uses just the hostname when roswtf is run.
I do not speak python, and do not really have any experience with it. If I can find a way to ...(more)
As pointed out by Mike Scheutzow in the answer it is probably a difference in name resolution in Ubuntu, not in ROS, so no need to go through python files. What does happen when you simply do "ping rosbot" on Ubuntu 16 and 18?
"ping rosbot" fails on both versions as there is no local DNS.
NOTE: Kinetic roswtf works, but Melodic roswtf does not?!