Hakaishin
Hakaishin

Reputation: 2942

Can see topic when using ros2 topic list, but can't echo it over the network?

I have two computers(Ubuntu 20.04) in the same network with ROS_DOMAIN_ID=1 and I have a topic called cloud which is a pointcloud from a lidar sensor. The driver is running on the PC=A and I want to show the clouds on PC=B. Now when I ros2 topic echo /cloud on PC=A I receive the msgs as normal. When I ros2 topic list on PC=B I see the cloud topic. I only see it after setting the ROS_DOMAIN_ID=1 to make sure no prior topic with that name is available. So far so good, but now when I try to ros2 topic echo /cloud on PC=B I get nothing. Any idea why this could be? In my understanding the msgs are arriving, as shown by ros2 topic echo /cloud on PC=A and I can see them on PC=B shown by ros2 topic list. Funny enough ros2 topic info /cloud works fine and tells me that the publisher and subscriber count at 1 and 2 respectively. Also running the ros2 run demo_nodes_cpp talker demo on PC=A and ros2 run demo_nodes_cpp listener demo on PC=B works as intended. Is it maybe because the sensor is UDP and the demo listener is tcp?

Upvotes: 2

Views: 5764

Answers (3)

quieronachos
quieronachos

Reputation: 1

I encountered this same issue on Ubuntu 22.04/ROS 2 Humble, except between two different Linux users on the same device. What fixed it for me was changing the DDS middleware to Cyclone DDS for both users:

https://docs.ros.org/en/humble/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html

By default my Humble setup was using rmw_fastrtps_cpp (can see by running ps -ax | grep rmw-implementation), which I guess can have this communication issue with different users. I don't know the underlying details of what's really going on, but it's good enough for me.

Upvotes: 0

Cyclical Obsessive
Cyclical Obsessive

Reputation: 326

I just solved this "topic list works, topic echo does not" in my Ubuntu 20.04 ROS2 Galactic environment.

I am running

  • ROS2 Galactic, over
  • Ubuntu 20.04 LTS Desktop as a
  • virtual machine in VMware Fusion 12.2.4 on a
  • Mac Mini 2018 running
    • macOS Monterey 12.6.1

using CYCLONE DDS to:

  • TurtleBot4lite RaspberryPi4 and
  • Create3

When I have the virtual machine network adapter configured to

  • "Bridged Adapter: WiFi" (with advanced option: Generated MAC ID)

I can list topics from nodes running on both of the ROS2 platforms,
but only echo topics published from nodes running on the Turtlebot4lite's RaspberryPi4.
Topics published by the Create3 do not echo.

[SOLUTION in my case] When I changed the virtual machine network adapter to

  • "Bridged Adapter: Ethernet" (with advanced option: Generated MAC ID same as Generated WiFI MAC ID),

Magic happens! Topics both list and echo.

Upvotes: 0

Robin
Robin

Reputation: 51

Hello I can remember i had this problem as well somewhere, which was caused by dds mismatch versions, do you use the same DDS distros(ROS2 distros) on both pc's? ROS2 has the tendency to change the DDS version in the distro, are both pc's up to date?

Can you check if your subscribed node PC=B does indeed get the information? As echo can be wrong, but the node could still receive.

If you use the discovery server, do not forget that you have to be a super client.

Upvotes: 0

Related Questions