ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

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

asked 2022-03-22 04:03:29 -0500

Hakaishin gravatar image

updated 2022-03-23 03:09:57 -0500

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?

edit retag flag offensive close merge delete

Comments

Maybe you should check your QoS in both publisher and subscriber on the computers?

ljaniec gravatar image ljaniec  ( 2022-03-22 17:53:17 -0500 )edit

I checked that the QOS are the same by using ros2 topic echo /cloud --verbose and setting the once which rviz exposes to the same, namely reliability: RELIABLE, DURABILITY: TRANSIENT_LOCAL,

Hakaishin gravatar image Hakaishin  ( 2022-03-23 09:19:42 -0500 )edit

I assume it was the same on the side of the subscriber, it shouldn't prevent anything from working...

ljaniec gravatar image ljaniec  ( 2022-03-24 11:32:24 -0500 )edit

Well and here we are. I have yet to try in a network without a firewall, there is a possibility that that is a problem. But I doubt it. But I don't have a router atm so I can't try it

Hakaishin gravatar image Hakaishin  ( 2022-03-24 12:06:52 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-23 03:38:11 -0500

mcbed gravatar image

I had the same problem and it was linked to the size of the message. If the message is too big it will not print in the terminal using echo.

edit flag offensive delete link more

Comments

How did you fix that? Because it's a sensor driver, so I can't change the publisher.

Hakaishin gravatar image Hakaishin  ( 2022-03-23 04:05:37 -0500 )edit

I did not need to fix it as when I subscribe to the topic with another node the data is available, it just does not print in the terminal. You could try to subscribe to your /cloud topic using RViz to see if the data is displayed.

mcbed gravatar image mcbed  ( 2022-03-23 05:04:21 -0500 )edit

I tried that at first and it doesn't, then I tried echo. Now I'm not sure which is the more reliable tool to check...

Hakaishin gravatar image Hakaishin  ( 2022-03-23 09:21:29 -0500 )edit

I would use minimal subscriber code with simple callback to check if e.g. header of the message display correctly

ljaniec gravatar image ljaniec  ( 2022-03-24 11:33:49 -0500 )edit

Well isn't echo such a minimal subscriber? I thought that was the point of it, wouldn't I be just rewriting the code in ros2 topic echo?

Hakaishin gravatar image Hakaishin  ( 2022-03-24 12:06:15 -0500 )edit

Overall, yes, ros2 topic echo is quite similar, but I was commenting with @mcbed answer in mind - maybe messages are too big to print in the terminal, in minimal subscriber with printing only a header you could avoid that

ljaniec gravatar image ljaniec  ( 2022-03-24 12:39:22 -0500 )edit

Facing the same issue and I create a simple Node to subscribe the topic but still cannot get the message. When I try to connect both PC to the same router then I can echo the message. However, when I connect my PC B to the router via WIFI and PC A to the router via Ethernet, then I cannot echo any message.

Any additional hints?

[Using cyclonedds and have changed the config according to the scenario that I described above]

BCJ gravatar image BCJ  ( 2023-08-03 22:06:09 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-03-22 04:03:29 -0500

Seen: 1,822 times

Last updated: Mar 23 '22