ros2 / ros2

The Robot Operating System, is a meta operating system for robots.
https://docs.ros.org
3.65k stars 682 forks source link

ROS2 jazzy with ROS_DISCOVERY_SERVER and ROS_SUPER_CLIENT [TCP/UDP] 2 PC physical Server and Client ros2 node list - EMPTY by ros2 topic list OK #1617

Open artemprudnikovuae opened 2 weeks ago

artemprudnikovuae commented 2 weeks ago

We have 2 physical machines in one local network

Ubuntu 24.04 ros2 jazzy run on the server

fastdds discovery -i 0 -t 192.168.10.52 -q 42100

1 terminal export ROS_DISCOVERY_SERVER=TCPv4:[192.168.10.52]:42100 export ROS_SUPER_CLIENT=TRUE ros2 run demo_nodes_cpp listener

2 terminal

export ROS_DISCOVERY_SERVER=TCPv4:[192.168.10.52]:42100 export ROS_SUPER_CLIENT=TRUE ros2 run demo_nodes_cpp talker

talker - starts publishing messages and they are visible in the listener terminal

3 terminal export ROS_DISCOVERY_SERVER=TCPv4:[192.168.10.52]:42100 export ROS_SUPER_CLIENT=TRUE ros2 daemon stop ros2 daemon start ros2 topic list /chatter /parameter_events /rosout --- so far so good

ros2 topic list --no-daemon /chatter /parameter_events /rosout -- so good too

BUT when trying to get node list I get empty

ros2 node list - EMPTY response ros2 node list --no-daemon -- so EMPTY too

on 2 physical machine 1 terminal export ROS_DISCOVERY_SERVER=TCPv4:[192.168.10.52]:42100 export ROS_SUPER_CLIENT=TRUE ros2 run demo_nodes_cpp listener

-- we see the published messages of the 1st machine - everything is fine here

2nd terminal export ROS_DISCOVERY_SERVER=TCPv4:[192.168.10.52]:42100 export ROS_SUPER_CLIENT=TRUE ros2 run demo_nodes_cpp talker

after that, the messages of the 2nd talker are published in turn in 2nd listener - everything is fine here

3rd terminal export ROS_DISCOVERY_SERVER=TCPv4:[192.168.10.52]:42100 export ROS_SUPER_CLIENT=TRUE ros2 node list - the answer is EMPTY ros2 node list --no-daemon -- also EMPTY

the problem is inside ROS2 jazzy so as tests showed, with the following settings fastdds discovery and ROS_DISCOVERY_SERVER

TCPv4:[127.0.0.1]:42100 - ros2 node list or ros2 node list --no-daemon - EMPTY TCPv4:[192.168.10.52]:42100 - ros2 node list or ros2 node list --no-daemon- EMPTY

UDP 127.0.0.1:11811 - ros2 node list - OK - that's how it works but with ros2 node list --no-daemon - EMPTY 192.168.10.52:11811 - ros2 node list - OK - that's how it works but with ros2 node list --no-daemon - EMPTY

on 2 machines, just in case, we check that the port is available and repeat the test nc -uv 192.168.10.52 11811 Connection to 192.168.10.52 11811 port [udp/*] succeeded!

export ROS_SUPER_CLIENT=TRUE export ROS_DISCOVERY_SERVER=192.168.10.52:11811

ros2 node list - answer EMPTY ros2 node list --no-daemon -- also EMPTY

try to solve the problem of displaying the node list because I need to use rviz2 on a remote machine

Bug report

Required Info:

fujitatomoya commented 2 weeks ago

@artemprudnikovuae

this can be reproducible with latest rolling build.

i think this is related to https://docs.ros.org/en/rolling/Tutorials/Advanced/Discovery-Server/Discovery-Server.html#fast-dds-discovery-server-v2, that i think daemon or ros2cli commands are left unmatched since they are not actually starting the communication with other endpoints? i may be wrong...

@MiguelCompany @Mario-DL any thoughts? can the server discovery fall back to v1 behavior?