0
$\begingroup$

Rosanswers logo

Basically, I have a node that is subscribed to 6 other nodes.

I have an initialize routine that needs a response from each node that they're done initializing. I get a fine response from 3 of them, but not the other 3. The weird thing is, they actually publish their message and can see it if I echo on the topic in the terminal, but the node receiving does not actually receive it. The even weirder part is, that if I publish to the topic with the message through the terminal, the receiving node actually reacts as it should.

I hope this makes sense.

Thanks in advance!


Originally posted by MrSnail on ROS Answers with karma: 3 on 2013-05-25

Post score: 0


Original comments

Comment by Ben_S on 2013-05-25:
Are all nodes running on the same machine? Network set up correctly?

Comment by MrSnail on 2013-05-25:
Yes, same machine.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The six nodes send out one message each when they are done with initialization?

Then my first guess would be that there's some timing issue. Possibilities are e.g.

  • The "supervision node" starts listening only after the first messages are already sent
  • The three nodes publish immediately after advertising their publisher, before the "supervision node" is completely subscribed

First attempt at a solution: in the six nodes, include a delay of one or two seconds between creation of the publisher and publishing the first message. Start the supervision node first, then the other nodes. If this works, you found your culprit.

Also, you could enable latching:

When a connection is latched, the last message published is saved and automatically sent to any future subscribers that connect. This is useful for slow-changing to static data like a map. Note that if there are multiple publishers on the same topic, instantiated in the same node, then only the last published message from that node will be sent, as opposed to the last published message from each publisher on that single topic.


If both do not work, check if the subscriber and the publishers use the exact same message type. Differences (e.g. publishing std_msgs::Pose, subscribing to std_msgs::PoseStamped) might lead to not receiving anything.


Originally posted by Philip with karma: 990 on 2013-05-25

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by MrSnail on 2013-05-25:
Latching worked! Thank you.

$\endgroup$

Your Answer

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