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

Revision history [back]

click to hide/show revision 1
initial version

The simple solution is what I'm currently doing which is to create a publisher using String. and don't bother defining the string. Sends an empty message and it triggers the event I want.

There is an Empty message in std_msgs, perhaps you could use that. You'd still be publishing something, it just doesn't have any contents.

Although if you're not looking for fire-and-forget semantics, using a service may be better. There's Empty there as well, and Trigger.

However, I can't imagine there isnt a simple signal that can be linked like pub/sub that doesn't require a data_class, unlike Publishers.

I'm not entirely sure how to take this comment. Nodes can communicate in three ways:

  1. topics
  2. services
  3. actions (sort-of a hybrid, or asynchronous services with feedback)

in all cases, something will have to be exchanged. There is no other way.

And all of it is only done because the publisher or client has the intention to communicate.

Even in Qt (which I believe you're referring to in your question), there is data exchanged. It may not be visible to you at the API/application level, but it's certainly there (invoking a function / method is essentially data exchange).

Publish-subscribe can be used to implement an Observer pattern, but it's not the same thing.