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

Revision history [back]

The best choice is going to depend on your particular application.

A few rules of thumb:

  • If you need to guarantee that the other node got the message, use a service
  • If you need a response, use a service (or an action)
  • If you need speed, use a topic
  • If you don't care if every message goes through, use a topic
  • If you are interacting with some existing topic/service API, use whatever that API already uses

Note that it also doesn't have to be one or the other. Some nodes (such as move_base) provide both a topic and action API for the same thing.