Closed stertingen closed 5 years ago
I used socket.gethostname()
for hostname detection.
I changed it now and use the hostname from ros masteruri. Please, try again!
Nope, does not help; still the same error.
The output from avahi-browse -a -t -r
is interesting:
+ enp0s3 IPv6 hostbar _ros-master._tcp local
= enp0s3 IPv6 hostbar _ros-master._tcp local
hostname = [hostbar.local]
address = [fd78:9d42:7594::56f]
port = [11311]
txt = ["network_id=0" "rpcuri=http://hostbar:11911" "zname=/master_discovery" "master_uri=http://hostbar:11311/" "timestamp_local=1554903303.730091095" "timestamp=1554903303.730091095"]
While the hostname is correcty set to hostbar.local, the values master_uri and rpcuri in the txt array are propably not.
Interesting: setting ROS_MASTER_URI=http://hostbar.local:11311
explicitly on hostbar (analog on hostfoo) does not help either.
This might be a problem with the ROS Master API (http://wiki.ros.org/ROS/Master_API).
The discovery node calls getUri()
, which returns the local hostname without the .local suffix.
I'm not sure whether this is intended behavior; if it is, the discovery node might have to do a workaround for this.
I added afqdn
parameter. You have to set this parameter to true
.
rosrun master_discovery_fkie zeroconf _fqdn:=true
Regarding your post, I'm afraid that the ROS-topic communication will not work anyway. But you can try it out!
Thank you very much!
Well, the discovery works fine now, but since the nodes itself do not use the FQDN, I have to set ROS_HOSTNAME=$(hostname -f)
explicitly (see https://github.com/ros/ros_comm/issues/138).
Since I'm bound to an IPv6-only network, there were still a few things missing:
ROS_IPV6
=on in the environment. (undocumented feature)::1
(/etc/hosts
)For better IPv6 compatibility it would be nice if the MasterMonitor was initialized in IPv6 mode
I've got a setung running now with:
/etc/hosts
(localhost name resolution) and environmentWell, it's not that undocumented: http://www.ros.org/news/2012/06/ipv6-support-for-ros-nodes.html
Problem
Using the zeroconf discovery, SyncThread on local host
hostfoo
throws errors about being unable to resolve the hostname of a remote hosthostbar
:Notes:
Debugging
My
/etc/nsswitch.conf
(relevant line):The parameters for the zeroconf node are default; the zeroconf nodes discover each other perfectly.
Manual hostname resolution fails with:
Manual hostname resolution works with:
I'm not sure, it might be a better idea to use
hostbar.local
instead?