ros1_external_use icon indicating copy to clipboard operation
ros1_external_use copied to clipboard

Services vs topics

Open asmodehn opened this issue 9 years ago • 1 comments

I have been developing normal software that uses ROS for a few months now, and one information that was very useful, but that I had to stumble upon many times before getting it, was this :

  • topics require a ROS node, and therefore a full ROS environment setup, and the software to follow ROS habits ( only one node_init by process, etc. ) to communicate.
  • services are implemented with xmlrpc, and do not require any ROS node or ROS environment setup to communicate, except being able to import the generated python message format.

I think this is an important information that should be somewhere : How to communicate with running ROS system :

  • from inside ros : topics is better ( seems to be ROS devs favorite, and you can even implement service-like behavior on top of them actually : http://wiki.ros.org/rocon_python_comms/Tutorials/indigo/What%20are%20Service%20Pairs%3F )
  • from outside ros : service is better : discover the uri (getting the master uri is another topic - see https://github.com/gerkey/ros1_external_use/issues/9) and connect (message format import).

I am currently working on a package to bridge different multiprocess architectures ( https://github.com/asmodehn/pyros ) but it is overkill if the robot developers take care of exposing the proper services, and the robot users know how to call these services directly ( from outside ).

asmodehn avatar Mar 02 '16 00:03 asmodehn

That's good information. How about submitting a PR with an example and some documentation for this repo?

gerkey avatar Mar 10 '16 01:03 gerkey