Rosanswers logo


I have a question about topic subscription.

There are 3 nodes named camera_driver,tracker and estimator.

The tracker sends a std_msg/float32 topic message only once to the estimator when it completes its initialization.

The camera_driver keeps publishing image msg.

If I run nodes in order tracker -> estimator -> camera_driver then estimator is able to subscribe the std_msg/float32 type message.

However, when I execute camera_driver->tracker->estimator order, the estimator can't subscribe any topic.

Furthermore, "rostopic echo" can subscribe the message in the latter case.

I am using groovy on 12.04 Ubuntu 64bits.

Is there anyone faced similar symptom?


Originally posted by enddl22 on ROS Answers with karma: 177 on 2013-08-01

Post score: 0


1 Answer 1


Rosanswers logo

Does your camera_driver publish or subscribe to the same topic? But with another message type?

Then the topic's message type is fixed to that type, and any new node cannot use that topic but with another type (might be the correct or not).

Another guess: Be means of "only once", I assume you mean you only publish one message. Do you latch them?

When you start the publisher first, and then the subscriber, the latter might not receive that message when the publisher does not latch. It's not even a real race condition, but a simple sequence.

Originally posted by felix k with karma: 1650 on 2013-08-01

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by enddl22 on 2013-08-27:
Thank you felix. It works with changing, advertise<std_msgs::Float32MultiArray>("PolePoseInit", 1); to advertise<std_msgs::Float32MultiArray>("PolePoseInit", 1,1);

Enable latch for publisher.


Comment by felix k on 2013-08-29:
Though you should prefer true' over 1`.


Your Answer

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