使用ros2主题列表时可以看到主题,但无法通过网络回显它?
我有两台计算机(Ubuntu 20.04)在同一网络中,ROS_DOMAIN_ID=1,我有一个名为cloud
的主题,它是来自激光雷达传感器的点云。驱动程序在 PC=A 上运行,我想在 PC=B 上显示云。现在,当我在 PC=AI 上的 ros2 topic echo /cloud
时正常收到消息。当我在PC=BI上的ros2主题列表中看到云主题。我只有在设置 ROS_DOMAIN_ID=1 之后才能看到它,以确保之前没有具有该名称的主题可用。到目前为止一切顺利,但现在当我尝试在 PC=BI 上使用 ros2 topic echo /cloud 时什么也得不到。知道为什么会这样吗?据我了解,消息已到达,如 PC=A 上的 ros2 topic echo /cloud 所示,我可以在 ros2 topic list
显示的 PC=B 上看到它们。有趣的是,ros2 topic info /cloud
工作正常,并告诉我发布者和订阅者分别计数为 1 和 2。另外,在 PC=A 上运行 ros2 run demo_nodes_cpp talker
演示和在 PC=B 上运行 ros2 run demo_nodes_cpp Listener
演示也按预期工作。是否可能是因为传感器是 UDP 而演示侦听器是 tcp?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您好,我记得我在某个地方也遇到过这个问题,这是由 dds 版本不匹配引起的,您在两台电脑上使用相同的 DDS 发行版(ROS2 发行版)吗? ROS2有改变发行版中DDS版本的倾向,两台电脑都是最新的吗?
您可以检查一下您订阅的节点PC=B是否确实获取到了该信息?由于回显可能是错误的,但节点仍然可以接收。
如果您使用发现服务器,请不要忘记您必须是超级客户端。
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.
我刚刚在我的 Ubuntu 20.04 ROS2 Galicate 环境中解决了这个“主题列表有效,主题回显无效”的问题。
我在
使用 CYCLONE DDS 来:
当我将虚拟机网络适配器配置为
时,我可以列出在两个虚拟机上运行的节点的主题ROS2 平台,
但仅回显从 Turtlebot4lite 的 RaspberryPi4 上运行的节点发布的主题。
Create3 发布的主题没有回显。
[我的案例的解决方案]
当我将虚拟机网络适配器更改为
奇迹发生了!主题既列出又回显。
I just solved this "topic list works, topic echo does not" in my Ubuntu 20.04 ROS2 Galactic environment.
I am running
using CYCLONE DDS to:
When I have the virtual machine network adapter configured to
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
Magic happens! Topics both list and echo.
我在 Ubuntu 22.04/ROS 2 Humble 上遇到了同样的问题,除了同一设备上的两个不同 Linux 用户之间的问题。对我来说解决这个问题的方法是将两个用户的 DDS 中间件更改为 Cyclone DDS:
https://docs.ros.org/en/humble/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html
默认情况下,我的 Humble 设置使用
rmw_fastrtps_cpp
(可以通过运行 ps -ax | grep rmw-implementation 来查看),我猜这可能与不同用户存在通信问题。我不知道到底发生了什么,但这对我来说已经足够了。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 runningps -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.