XML-RPC handler for ROS master APIs. API routines for the ROS Master Node. The Master Node is a superset of the Slave Node and contains additional API methods for creating and monitoring a graph of slave nodes.
By convention, ROS nodes take in caller_id as the first parameter of any API call. The setting of this parameter is rarely done by client code as ros::msproxy::MasterProxy automatically inserts this parameter (see ros::client::getMaster()).
Method | __init__ |
ctor. |
Method | delete |
Parameter Server: delete parameter @param caller_id: ROS caller id @type caller_id: str @param key: parameter name @type key: str @return: [code, msg, 0] @rtype: [int, str, int] |
Method | get |
Retrieve parameter value from server. @param caller_id: ROS caller id @type caller_id: str @param key: parameter to lookup. If key is a namespace, getParam() will return a parameter tree. @type key: str getParam() will return a parameter tree. |
Method | get |
Get list of all parameter names stored on this server. This does not adjust parameter names for caller's scope. |
Method | get |
Get the PID of this server @param caller_id: ROS caller id @type caller_id: str @return: [1, "", serverProcessPID] @rtype: [int, str, int] |
Method | get |
Get list of topics that can be subscribed to. This does not return topics that have no publishers. See L{getSystemState()} to get more comprehensive list. @param caller_id: ROS caller id @type caller_id: str @param subgraph: Restrict topic names to match within the specified subgraph... |
Method | get |
Retrieve list representation of system state (i.e. publishers, subscribers, and services). @param caller_id: ROS caller id @type caller_id: str @rtype: (int, str, [[str,[str]], [str,[str]], [str,[str]]]) @return: (code, statusMessage, systemState). |
Method | get |
Retrieve list topic names and their types. @param caller_id: ROS caller id @type caller_id: str @rtype: (int, str, [[str,str]] ) @return: (code, statusMessage, topicTypes). topicTypes is a list of [topicName, topicType] pairs. |
Method | get |
Get the XML-RPC URI of this server. @param caller_id str: ROS caller id @return [int, str, str]: [1, "", xmlRpcUri] |
Method | has |
Check if parameter is stored on server. @param caller_id str: ROS caller id @type caller_id: str @param key: parameter to check @type key: str @return: [code, statusMessage, hasParam] @rtype: [int, str, bool]... |
Method | lookup |
Get the XML-RPC URI of the node with the associated name/caller_id. This API is for looking information about publishers and subscribers. Use lookupService instead to lookup ROS-RPC URIs. @param caller_id: ROS caller id @type caller_id: str @param node: name of node to lookup @type node: str @return: (code, msg, URI) @rtype: (int, str, str)... |
Method | lookup |
Lookup all provider of a particular service. @param caller_id str: ROS caller id @type caller_id: str @param service: fully-qualified name of service to lookup. @type: service: str @return: (code, message, serviceUrl)... |
Method | param |
Contact api.paramUpdate with specified parameters @param caller_id: caller ID @type caller_id: str @param caller_api: XML-RPC URI of node to contact @type caller_api: str @param param_key: parameter key to pass to node @type param_key: str @param param_value: parameter value to pass to node @type param_value: str... |
Method | register |
Register the caller as a publisher the topic. @param caller_id: ROS caller id @type caller_id: str @param topic: Fully-qualified name of topic to register. @type topic: str @param topic_type: Datatype for topic... |
Method | register |
Register the caller as a provider of the specified service. @param caller_id str: ROS caller id @type caller_id: str @param service: Fully-qualified name of service @type service: str @param service_api: Service URI @type service_api: str @param caller_api: XML-RPC URI of caller node @type caller_api: str @return: (code, message, ignore) @rtype: (int, str, int)... |
Method | register |
Subscribe the caller to the specified topic. In addition to receiving a list of current publishers, the subscriber will also receive notifications of new publishers via the publisherUpdate API. @param caller_id: ROS caller id @type caller_id: str @param topic str: Fully-qualified name of topic to subscribe to... |
Method | search |
Search for parameter key on parameter server. Search starts in caller's namespace and proceeds upwards through parent namespaces until Parameter Server finds a matching key. |
Method | set |
Parameter Server: set parameter. NOTE: if value is a dictionary it will be treated as a parameter tree, where key is the parameter namespace. For example:: |
Method | shutdown |
Stop this server @param caller_id: ROS caller id @type caller_id: str @param msg: a message describing why the node is being shutdown. @type msg: str @return: [code, msg, 0] @rtype: [int, str, int] |
Method | subscribe |
Retrieve parameter value from server and subscribe to updates to that param. See paramUpdate() in the Node API. @param caller_id str: ROS caller id @type caller_id: str @param key: parameter to lookup... |
Method | unregister |
Unregister the caller as a publisher of the topic. @param caller_id: ROS caller id @type caller_id: str @param topic: Fully-qualified name of topic to unregister. @type topic: str @param caller_api str: API URI of service to... |
Method | unregister |
Unregister the caller as a provider of the specified service. @param caller_id str: ROS caller id @type caller_id: str @param service: Fully-qualified name of service @type service: str @param service_api: API URI of service to unregister... |
Method | unregister |
Unregister the caller as a subscriber of the topic. @param caller_id: ROS caller id @type caller_id: str @param topic: Fully-qualified name of topic to unregister. @type topic: str @param caller_api: API URI of service to unregister... |
Method | unsubscribe |
Retrieve parameter value from server and subscribe to updates to that param. See paramUpdate() in the Node API. @param caller_id str: ROS caller id @type caller_id: str @param key: parameter to lookup... |
Instance Variable | done |
Undocumented |
Instance Variable | param |
Undocumented |
Instance Variable | param |
Undocumented |
Instance Variable | ps |
Undocumented |
Instance Variable | publishers |
Undocumented |
Instance Variable | reg |
Undocumented |
Instance Variable | services |
Undocumented |
Instance Variable | subscribers |
Undocumented |
Instance Variable | thread |
Undocumented |
Instance Variable | topics |
Undocumented |
Instance Variable | uri |
Undocumented |
Method | _notify |
Generic implementation of callback notification @param registrations: Registrations @type registrations: L{Registrations} @param task: task to queue @type task: fn @param key: registration key @type key: str @param value: value to pass to task @type value: Any... |
Method | _notify |
Notify parameter subscribers of new parameter value @param updates [([str], str, any)*]: [(subscribers, param_key, param_value)*] @param param_value str: parameter value |
Method | _notify |
Notify subscribers with new publisher list @param topic: name of topic @type topic: str @param pub_uris: list of URIs of publishers. @type pub_uris: [str] |
Method | _ok |
Undocumented |
Method | _ready |
Initialize the handler with the XMLRPC URI. This is a standard callback from the XmlRpcNode API. |
Method | _shutdown |
Undocumented |
Parameter Server: delete parameter @param caller_id: ROS caller id @type caller_id: str @param key: parameter name @type key: str @return: [code, msg, 0] @rtype: [int, str, int]
Retrieve parameter value from server. @param caller_id: ROS caller id @type caller_id: str @param key: parameter to lookup. If key is a namespace, getParam() will return a parameter tree. @type key: str getParam() will return a parameter tree.
- @return: [code, statusMessage, parameterValue]. If code is not
- 1, parameterValue should be ignored. If key is a namespace, the return value will be a dictionary, where each key is a parameter in that namespace. Sub-namespaces are also represented as dictionaries.
@rtype: [int, str, XMLRPCLegalValue]
Get list of all parameter names stored on this server. This does not adjust parameter names for caller's scope.
@param caller_id: ROS caller id @type caller_id: str @return: [code, statusMessage, parameterNameList] @rtype: [int, str, [str]]
Get the PID of this server @param caller_id: ROS caller id @type caller_id: str @return: [1, "", serverProcessPID] @rtype: [int, str, int]
def getPublishedTopics(self, caller_id, subgraph): ¶
Get list of topics that can be subscribed to. This does not return topics that have no publishers. See L{getSystemState()} to get more comprehensive list. @param caller_id: ROS caller id @type caller_id: str @param subgraph: Restrict topic names to match within the specified subgraph. Subgraph namespace
is resolved relative to the caller's namespace. Use '' to specify all names.
@type subgraph: str @return: (code, msg, [[topic1, type1]...[topicN, typeN]]) @rtype: (int, str, [[str, str],])
Retrieve list representation of system state (i.e. publishers, subscribers, and services). @param caller_id: ROS caller id @type caller_id: str @rtype: (int, str, [[str,[str]], [str,[str]], [str,[str]]]) @return: (code, statusMessage, systemState).
- System state is in list representation::
- [publishers, subscribers, services].
- publishers is of the form::
- [ [topic1, [topic1Publisher1...topic1PublisherN]] ... ]
- subscribers is of the form::
- [ [topic1, [topic1Subscriber1...topic1SubscriberN]] ... ]
- services is of the form::
- [ [service1, [service1Provider1...service1ProviderN]] ... ]
Retrieve list topic names and their types. @param caller_id: ROS caller id @type caller_id: str @rtype: (int, str, [[str,str]] ) @return: (code, statusMessage, topicTypes). topicTypes is a list of [topicName, topicType] pairs.
Get the XML-RPC URI of this server. @param caller_id str: ROS caller id @return [int, str, str]: [1, "", xmlRpcUri]
Check if parameter is stored on server. @param caller_id str: ROS caller id @type caller_id: str @param key: parameter to check @type key: str @return: [code, statusMessage, hasParam] @rtype: [int, str, bool]
Get the XML-RPC URI of the node with the associated name/caller_id. This API is for looking information about publishers and subscribers. Use lookupService instead to lookup ROS-RPC URIs. @param caller_id: ROS caller id @type caller_id: str @param node: name of node to lookup @type node: str @return: (code, msg, URI) @rtype: (int, str, str)
Lookup all provider of a particular service. @param caller_id str: ROS caller id @type caller_id: str @param service: fully-qualified name of service to lookup. @type: service: str @return: (code, message, serviceUrl). service URL is provider's
ROSRPC URI with address and port. Fails if there is no provider.
@rtype: (int, str, str)
Contact api.paramUpdate with specified parameters @param caller_id: caller ID @type caller_id: str @param caller_api: XML-RPC URI of node to contact @type caller_api: str @param param_key: parameter key to pass to node @type param_key: str @param param_value: parameter value to pass to node @type param_value: str
def registerPublisher(self, caller_id, topic, topic_type, caller_api): ¶
Register the caller as a publisher the topic. @param caller_id: ROS caller id @type caller_id: str @param topic: Fully-qualified name of topic to register. @type topic: str @param topic_type: Datatype for topic. Must be a package-resource name, i.e. the .msg name. @type topic_type: str @param caller_api str: ROS caller XML-RPC API URI @type caller_api: str @return: (code, statusMessage, subscriberApis). List of current subscribers of topic in the form of XMLRPC URIs. @rtype: (int, str, [str])
def registerService(self, caller_id, service, service_api, caller_api): ¶
Register the caller as a provider of the specified service. @param caller_id str: ROS caller id @type caller_id: str @param service: Fully-qualified name of service @type service: str @param service_api: Service URI @type service_api: str @param caller_api: XML-RPC URI of caller node @type caller_api: str @return: (code, message, ignore) @rtype: (int, str, int)
def registerSubscriber(self, caller_id, topic, topic_type, caller_api): ¶
Subscribe the caller to the specified topic. In addition to receiving a list of current publishers, the subscriber will also receive notifications of new publishers via the publisherUpdate API. @param caller_id: ROS caller id @type caller_id: str @param topic str: Fully-qualified name of topic to subscribe to. @param topic_type: Datatype for topic. Must be a package-resource name, i.e. the .msg name. @type topic_type: str @param caller_api: XML-RPC URI of caller node for new publisher notifications @type caller_api: str @return: (code, message, publishers). Publishers is a list of XMLRPC API URIs
for nodes currently publishing the specified topic.
@rtype: (int, str, [str])
Search for parameter key on parameter server. Search starts in caller's namespace and proceeds upwards through parent namespaces until Parameter Server finds a matching key.
searchParam's behavior is to search for the first partial match. For example, imagine that there are two 'robot_description' parameters:
/robot_description /robot_description/arm /robot_description/base /pr2/robot_description /pr2/robot_description/base
If I start in the namespace /pr2/foo and search for 'robot_description', searchParam will match /pr2/robot_description. If I search for 'robot_description/arm' it will return /pr2/robot_description/arm, even though that parameter does not exist (yet).
@param caller_id str: ROS caller id @type caller_id: str @param key: parameter key to search for. @type key: str @return: [code, statusMessage, foundKey]. If code is not 1, foundKey should be
ignored.
@rtype: [int, str, str]
def setParam(self, caller_id, key, value): ¶
Parameter Server: set parameter. NOTE: if value is a dictionary it will be treated as a parameter tree, where key is the parameter namespace. For example::
{'x':1,'y':2,'sub':{'z':3}}
will set key/x=1, key/y=2, and key/sub/z=3. Furthermore, it will replace all existing parameters in the key parameter namespace with the parameters in value. You must set parameters individually if you wish to perform a union update.
@param caller_id: ROS caller id @type caller_id: str @param key: parameter name @type key: str @param value: parameter value. @type value: XMLRPCLegalValue @return: [code, msg, 0] @rtype: [int, str, int]
Stop this server @param caller_id: ROS caller id @type caller_id: str @param msg: a message describing why the node is being shutdown. @type msg: str @return: [code, msg, 0] @rtype: [int, str, int]
def subscribeParam(self, caller_id, caller_api, key): ¶
Retrieve parameter value from server and subscribe to updates to that param. See paramUpdate() in the Node API. @param caller_id str: ROS caller id @type caller_id: str @param key: parameter to lookup. @type key: str @param caller_api: API URI for paramUpdate callbacks. @type caller_api: str @return: [code, statusMessage, parameterValue]. If code is not
1, parameterValue should be ignored. parameterValue is an empty dictionary if the parameter has not been set yet.
@rtype: [int, str, XMLRPCLegalValue]
def unregisterPublisher(self, caller_id, topic, caller_api): ¶
Unregister the caller as a publisher of the topic. @param caller_id: ROS caller id @type caller_id: str @param topic: Fully-qualified name of topic to unregister. @type topic: str @param caller_api str: API URI of service to
unregister. Unregistration will only occur if current registration matches.
@type caller_api: str @return: (code, statusMessage, numUnregistered).
If numUnregistered is zero it means that the caller was not registered as a publisher. The call still succeeds as the intended final state is reached.
@rtype: (int, str, int)
def unregisterService(self, caller_id, service, service_api): ¶
Unregister the caller as a provider of the specified service. @param caller_id str: ROS caller id @type caller_id: str @param service: Fully-qualified name of service @type service: str @param service_api: API URI of service to unregister. Unregistration will only occur if current
registration matches.
@type service_api: str @return: (code, message, numUnregistered). Number of unregistrations (either 0 or 1).
If this is zero it means that the caller was not registered as a service provider. The call still succeeds as the intended final state is reached.
@rtype: (int, str, int)
def unregisterSubscriber(self, caller_id, topic, caller_api): ¶
Unregister the caller as a subscriber of the topic. @param caller_id: ROS caller id @type caller_id: str @param topic: Fully-qualified name of topic to unregister. @type topic: str @param caller_api: API URI of service to unregister. Unregistration will only occur if current
registration matches.
@type caller_api: str @return: (code, statusMessage, numUnsubscribed).
If numUnsubscribed is zero it means that the caller was not registered as a subscriber. The call still succeeds as the intended final state is reached.
@rtype: (int, str, int)
def unsubscribeParam(self, caller_id, caller_api, key): ¶
Retrieve parameter value from server and subscribe to updates to that param. See paramUpdate() in the Node API. @param caller_id str: ROS caller id @type caller_id: str @param key: parameter to lookup. @type key: str @param caller_api: API URI for paramUpdate callbacks. @type caller_api: str @return: [code, statusMessage, numUnsubscribed].
If numUnsubscribed is zero it means that the caller was not subscribed to the parameter.
@rtype: [int, str, int]
Generic implementation of callback notification @param registrations: Registrations @type registrations: L{Registrations} @param task: task to queue @type task: fn @param key: registration key @type key: str @param value: value to pass to task @type value: Any
Notify parameter subscribers of new parameter value @param updates [([str], str, any)*]: [(subscribers, param_key, param_value)*] @param param_value str: parameter value
Notify subscribers with new publisher list @param topic: name of topic @type topic: str @param pub_uris: list of URIs of publishers. @type pub_uris: [str]