[Documentation] [TitleIndex] [WordIndex

See also:

Using XMLRPC

The Master API is implemented via XMLRPC, which has good library support in a variety of languages. For example, in Python:

import os
import xmlrpclib
caller_id = '/script'
m = xmlrpclib.ServerProxy(os.environ['ROS_MASTER_URI'])
code, msg, val = m.getSystemState(caller_id)
if code == 1:
  pubs, subs, srvs = val
else:
  print "call failed", code, msg

API Listing

Language-specific client APIs as well as tools may define convenience methods that make it unnecessary to call these APIs directly.

register/unregister methods

registerService(caller_id, service, service_api, caller_api)

unregisterService(caller_id, service, service_api)

registerSubscriber(caller_id, topic, topic_type, caller_api)

unregisterSubscriber(caller_id, topic, caller_api)

registerPublisher(caller_id, topic, topic_type, caller_api)

unregisterPublisher(caller_id, topic, caller_api)

Name service and system state

lookupNode(caller_id, node_name)

getPublishedTopics(caller_id, subgraph)

getTopicTypes(caller_id)

getSystemState(caller_id)

getUri(caller_id)

lookupService(caller_id, service)


2024-12-07 13:04