Class MasterXmlRpcEndpointImpl
- All Implemented Interfaces:
MasterXmlRpcEndpoint,ParameterServerXmlRpcEndpoint,XmlRpcEndpoint
- Author:
- damonkohler@google.com (Damon Kohler)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteParam(String callerId, String key) Deletes a parameter.Retrieve parameter value from server.getParamNames(String callerId) Gets the list of all parameter names stored on this server.Get the PID for the master process.getPublishedTopics(String callerId, String subgraph) Get list of topics that can be subscribed to.getSystemState(String callerId) Retrieve list representation of system state (i.e.getTopicTypes(String callerId) Get a list of all topic types.Get the URI of the the master.Check if parameter is stored on server.lookupNode(String callerId, String nodeName) Get the XML-RPC URI of the node with the associated name/caller_id.lookupService(String callerId, String serviceName) Lookup all provider of a particular service.registerPublisher(String callerId, String topicName, String topicMessageType, String callerSlaveUri) Register the caller as a publisher the topic.registerService(String callerId, String serviceName, String serviceUri, String callerSlaveUri) Register the caller as a provider of the specified service.registerSubscriber(String callerId, String topicName, String topicMessageType, String callerSlaveUri) Subscribe the caller to the specified topic.searchParam(String callerId, String key) Searches for a parameter key on theParameterServer.Sets a parameter.subscribeParam(String callerId, String callerSlaveUri, String key) Retrieves the parameter value from server and subscribe to updates to that param.unregisterPublisher(String callerId, String topicName, String callerSlaveUri) Unregister the caller as a publisher of the topic.unregisterService(String callerId, String serviceName, String serviceUri) Unregister the caller as a provider of the specified service.unregisterSubscriber(String callerId, String topicName, String callerSlaveUri) Unregister the caller as a publisher of the topic.unsubscribeParam(String callerId, String callerSlaveUri, String key) Unsubscribes from updates to the specified param.
-
Constructor Details
-
MasterXmlRpcEndpointImpl
-
-
Method Details
-
getPid
Description copied from interface:MasterXmlRpcEndpointGet the PID for the master process.- Specified by:
getPidin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller ID- Returns:
- The pid of the process.
-
getPublishedTopics
Description copied from interface:MasterXmlRpcEndpointGet list of topics that can be subscribed to. This does not return topics that have no publishers. See getSystemState() to get more comprehensive list.- Specified by:
getPublishedTopicsin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDsubgraph- Restrict topic names to match within the specified subgraph. Subgraph namespace is resolved relative to the caller's namespace. Use empty string to specify all names.- Returns:
- Topics is in list representation [[topic, message type], [topic, message type] ...]
-
getTopicTypes
Description copied from interface:MasterXmlRpcEndpointGet a list of all topic types.- Specified by:
getTopicTypesin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller ID- Returns:
- The types are in the list representation [[topic, message type], [topic, message type] ...]
-
getSystemState
Description copied from interface:MasterXmlRpcEndpointRetrieve list representation of system state (i.e. publishers, subscribers, and services).- Specified by:
getSystemStatein interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller ID- Returns:
- 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]] ... ]
-
getUri
Description copied from interface:MasterXmlRpcEndpointGet the URI of the the master.- Specified by:
getUriin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller ID- Returns:
- URI of the the master
-
lookupNode
Description copied from interface:MasterXmlRpcEndpointGet 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.- Specified by:
lookupNodein interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDnodeName- Name of node to lookup- Returns:
- URI of the node
-
registerPublisher
public List<Object> registerPublisher(String callerId, String topicName, String topicMessageType, String callerSlaveUri) Description copied from interface:MasterXmlRpcEndpointRegister the caller as a publisher the topic.- Specified by:
registerPublisherin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDtopicName- fully-qualified name of topic to registertopicMessageType- topic type, must be a package-resource name, i.e. the .msg name.callerSlaveUri- API URI of publisher to register- Returns:
- list of current subscribers of topic in the form of XML-RPC URIs
-
unregisterPublisher
Description copied from interface:MasterXmlRpcEndpointUnregister the caller as a publisher of the topic.- Specified by:
unregisterPublisherin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDtopicName- Fully-qualified name of topic.callerSlaveUri- API URI of publisher to unregister. Unregistration will only occur if current registration matches.- Returns:
- 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.
-
registerSubscriber
public List<Object> registerSubscriber(String callerId, String topicName, String topicMessageType, String callerSlaveUri) Description copied from interface:MasterXmlRpcEndpointSubscribe 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.- Specified by:
registerSubscriberin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDtopicName- Fully-qualified name of topictopicMessageType- topic type, must be a package-resource name, i.e. the .msg namecallerSlaveUri- API URI of subscriber to register. Will be used for new publisher notifications- Returns:
- publishers as a list of XMLRPC API URIs for nodes currently publishing the specified topic
-
unregisterSubscriber
Description copied from interface:MasterXmlRpcEndpointUnregister the caller as a publisher of the topic.- Specified by:
unregisterSubscriberin interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDtopicName- Fully-qualified name of topic.callerSlaveUri- API URI of service to unregister. Unregistration will only occur if current registration matches.- Returns:
- 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.
-
lookupService
Description copied from interface:MasterXmlRpcEndpointLookup all provider of a particular service.- Specified by:
lookupServicein interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDserviceName- Fully-qualified name of service- Returns:
- service URL is provides address and port of the service. Fails if there is no provider.
-
registerService
public List<Object> registerService(String callerId, String serviceName, String serviceUri, String callerSlaveUri) Description copied from interface:MasterXmlRpcEndpointRegister the caller as a provider of the specified service.- Specified by:
registerServicein interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDserviceName- Fully-qualified name of serviceserviceUri- XML-RPC URI of caller node- Returns:
- ignore
-
unregisterService
Description copied from interface:MasterXmlRpcEndpointUnregister the caller as a provider of the specified service.- Specified by:
unregisterServicein interfaceMasterXmlRpcEndpoint- Parameters:
callerId- ROS caller IDserviceName- Fully-qualified name of serviceserviceUri- API URI of service to unregister. Unregistration will only occur if current registration matches.- Returns:
- 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.
-
setParam
Description copied from interface:ParameterServerXmlRpcEndpointSets a 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.
- Specified by:
setParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller IDkey- Parameter name.value- Parameter value.- Returns:
- void
-
setParam
- Specified by:
setParamin interfaceParameterServerXmlRpcEndpoint
-
setParam
- Specified by:
setParamin interfaceParameterServerXmlRpcEndpoint
-
setParam
- Specified by:
setParamin interfaceParameterServerXmlRpcEndpoint
-
setParam
- Specified by:
setParamin interfaceParameterServerXmlRpcEndpoint
-
setParam
- Specified by:
setParamin interfaceParameterServerXmlRpcEndpoint
-
getParam
Description copied from interface:ParameterServerXmlRpcEndpointRetrieve parameter value from server.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.
- Specified by:
getParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller IDkey- Parameter name. If key is a namespace, getParam() will return a parameter tree.- Returns:
- the parameter value
-
searchParam
Description copied from interface:ParameterServerXmlRpcEndpointSearches for a parameter key on theParameterServer.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). If code is not 1, foundKey should be ignored.
- Specified by:
searchParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller IDkey- Parameter name to search for.- Returns:
- the found key
-
subscribeParam
Description copied from interface:ParameterServerXmlRpcEndpointRetrieves the parameter value from server and subscribe to updates to that param. See paramUpdate() in the Node API.If code is not 1, parameterValue should be ignored. parameterValue is an empty dictionary if the parameter has not been set yet.
- Specified by:
subscribeParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller IDcallerSlaveUri- Node API URI of subscriber for paramUpdate callbacks.- Returns:
- the parameter value
-
unsubscribeParam
Description copied from interface:ParameterServerXmlRpcEndpointUnsubscribes from updates to the specified param. See paramUpdate() in the Node API.A return value of zero means that the caller was not subscribed to the parameter.
- Specified by:
unsubscribeParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller IDcallerSlaveUri- Node API URI of subscriberkey- Parameter name- Returns:
- the number of parameters that were unsubscribed
-
deleteParam
Description copied from interface:ParameterServerXmlRpcEndpointDeletes a parameter.- Specified by:
deleteParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller IDkey- parameter name- Returns:
- void
-
hasParam
Description copied from interface:ParameterServerXmlRpcEndpointCheck if parameter is stored on server.- Specified by:
hasParamin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller ID.key- Parameter name.- Returns:
trueif the parameter exists
-
getParamNames
Description copied from interface:ParameterServerXmlRpcEndpointGets the list of all parameter names stored on this server.- Specified by:
getParamNamesin interfaceParameterServerXmlRpcEndpoint- Parameters:
callerId- ROS caller ID.- Returns:
- a
Collectionof parameter names
-