Rosanswers logo

I have two Nodes who communicate with a Float32 message topic.

The typical sequence of events are:

  1. Node A starts
  2. Node B starts
  3. Node A waits to subscribe to topic T
  4. Node B creates topic T publisher
  5. Node A successfully subscribes to topic T
  6. Node B sends messages continually on topic T
  7. Node A receives messages on topic T and runs a callback function

But sometimes (maybe 50% of times) everything happens except step 7. Node A says it is subscribed to topic T, Node B says it is publishing on topic T, but the callback is not executed.

Debugging with ros2 topic info /topicT -v says that topic T has 1 subscribers but 0 publishers YET I can see values of /topicT in rqt using the plot plugin. So data IS being published but some subscribers can sometimes not receive the data.

Is this a known error?

My ROS application and all terminals used to run ros2 and rqt use a ROS_DOMAIN_ID and this error only happens some of the time. Mind you, Node A and Node B does a whole lot of other stuff in between each step described above.

Originally posted by Fubbis on ROS Answers with karma: 3 on 2022-10-06

Post score: 0

Original comments

Comment by ravijoshi on 2022-10-11:
Can you please provide a minimal reproducible example? It will help us better understand the problem and provide you with more reasonable support.

Comment by Fubbis on 2022-10-18:
@ravijoshi Sorry but I don't think I can do that. I have found the cause of this problem. It seems to work fine if I remove some of the publishers in Node B. It had two imageTransport camera, two imageTransport, and three other publishers, totalling in 17 topics. Is this too much for a single ROS node?


1 Answer 1


Rosanswers logo

I am quoting the comment received above.

It had two imageTransport camera, two imageTransport, and three other publishers, totalling in 17 topics.

This is an interesting bug with ROS Foxy. Please see a detailed report in the following link: https://github.com/ros2/ros2/issues/1301

If possible, please upgrade your ROS distribution. For example, this issue does not occur in ROS Galactic. Or else just reduce the number of ROS publishers.

Originally posted by ravijoshi with karma: 1744 on 2022-10-18

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by Fubbis on 2022-10-18:
Insanely helpful answer. Thanks a lot!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.