Robotics StackExchange | Archived questions

fkie_master_discovery: A master can't detect the other one while the other one detects the master

Hello there,

I am new to ROS and robotics and now, i have 2 computers in the same local network which i am trying to make them to talk each other on ROS:

Laptop


127.0.0.1              localhost

127.0.0.1              laptop-linux

192.XXX.XXX.ab         laptop-linux

192.XXX.XXX.dc         pc-linux

PC


export ROS_HOSTNAME=pc-linux

export ROS_MASTER_URI=http://pc-linux:11311

export ROS_IP=192.XXX.XXX.dc
127.0.0.1              localhost

127.0.0.1              pc-linux

192.XXX.XXX.ab         laptop-linux

192.XXX.XXX.ae         laptop-windows    

192.XXX.XXX.dc         pc-linux

I can ping from both computer to each other. When, i ping i get such an output in laptop-linux:

> From 192.XXX.XXX.ae icmp_seq=1
> Redirect Network(New nexthop:
> cd.XXX.XXX.192) 64 bytes from pc-linux
> (192.XXX.XXX.dc): icmp_seq=1 ttl=64
> time=1.27 ms 64 bytes from pc-linux
> (192.XXX.XXX.dc): icmp_seq=1 ttl=63
> time=1.27 ms (DUP!) 64 bytes from
> pc-linux (192.XXX.XXX.dc): icmp_seq=1
> ttl=64 time=1.49 ms (DUP!) 64 bytes
> from pc-linux (192.XXX.XXX.dc):
> icmp_seq=1 ttl=63 time=1.49 ms (DUP!)
> 1 packets transmitted, 1 received, +3
> duplicates, +1 errors, 0% packet loss

this is the output at the linux-pc:

> From 192.XXX.XXX.ae icmp_seq=1
> Redirect Network(New nexthop:
> laptop-linux (192.XXX.XXX.ab)) 64 bytes from laptop-linux
> (192.XXX.XXX.ab): icmp_seq=1 ttl=64
> time=1.27 ms 64 bytes from laptop-linux
> (192.XXX.XXX.ab): icmp_seq=1 ttl=63
> time=1.27 ms (DUP!) 64 bytes from
> laptop-linux (192.XXX.XXX.ab): icmp_seq=1
> ttl=64 time=1.49 ms (DUP!) 64 bytes
> from laptop-linux (192.XXX.XXX.ab):
> icmp_seq=1 ttl=63 time=1.49 ms (DUP!)
> 1 packets transmitted, 1 received, +3
> duplicates, 0% packet loss

When, i start masterdiscovery and mastersync on both nodes they start without any issue and when i enter rosservice call /master_discovery/list at pc-linux i see the following output:

masters:

-

    name: "pc-linux"
    uri: "http://pc-linux:11311/"
    last_change:
       secs: 1685085416
       nsecs: 802117824
    last_change_local:
       secs: 1685085416
       nsecs: 802117824
    online: True
    discoverer_name: "/master_discovery"
    monitoruri: "http://192.XXX.XXX.dc:11611"

-

    name: "laptop-linux"
    uri: "http://laptop-linux:11311"
    last change:
       secs: 1685085293
       nsecs: 37087202
    last_change_local:
       secs: 1685085293
       nsecs: 37087202
    online: True
    discoverer_name: "/master_discovery"
    monitoruri: "http://192.XXX.XXX.ab:11611"

As you can see from the output the master_discovery node on pc-linux can detect the master in laptop-linux. But, when i enter the same command in the laptop-linux, i get the following output:

masters: 
  - 
    name: "laptop-linux"
    uri: "http://laptop-linux:11311/"
    last_change: 
      secs: 1685085293
      nsecs:  37087202
    last_change_local: 
      secs: 1685085293
      nsecs:  37087202
    online: True
    discoverer_name: "/master_discovery"
    monitoruri: "http://192.XXX.XXX.ab:11611"

As you can see masterdiscovery on laptoplinux can't detect the master in pc-linux. Can you help me on this issue please?

Thanks in advance.

Asked by mericgeren on 2023-05-26 04:38:16 UTC

Comments

Answers