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

Inconsistent topic subscription.

asked 2013-08-01 04:49:16 -0500

enddl22 gravatar image

Hello,

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?

Cheers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-08-01 07:25:11 -0500

felix k gravatar image

updated 2013-08-01 07:30:43 -0500

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.

edit flag offensive delete link more

Comments

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. Cheers.

enddl22 gravatar image enddl22  ( 2013-08-27 05:44:24 -0500 )edit
1

Though you should prefer `true' over `1`.

felix k gravatar image felix k  ( 2013-08-29 04:33:07 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-01 04:49:16 -0500

Seen: 216 times

Last updated: Aug 01 '13