module documentation

ROS Master API.

L{ROSMasterHandler} provides the API implementation of the Master. Python allows an API to be introspected from a Python class, so the handler has a 1-to-1 mapping with the actual XMLRPC API.

API return convention: (statusCode, statusMessage, returnValue)

  • statusCode: an integer indicating the completion condition of the method.
  • statusMessage: a human-readable string message for debugging
  • returnValue: the return value of the method; method-specific.

Current status codes:

  • -1: ERROR: Error on the part of the caller, e.g. an invalid parameter
  • 0: FAILURE: Method was attempted but failed to complete correctly.
  • 1: SUCCESS: Method completed successfully.

Individual methods may assign additional meaning/semantics to statusCode.

Class ROSMasterHandler 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.
Function apivalidate ROS master/slave arg-checking decorator. Applies the specified validator to the corresponding argument and also remaps each argument to be the value returned by the validator. Thus, arguments can be simultaneously validated and canonicalized prior to actual function call...
Function mloginfo Info-level master log statements. These statements may be printed to screen so they should be user-readable. @param msg: Message string @type msg: str @param args: arguments for msg if msg is a format string...
Function mlogwarn Warn-level master log statements. These statements may be printed to screen so they should be user-readable. @param msg: Message string @type msg: str @param args: arguments for msg if msg is a format string...
Function publisher_update_task Contact api.publisherUpdate with specified parameters @param api: XML-RPC URI of node to contact @type api: str @param topic: Topic name to send to node @type topic: str @param pub_uris: list of publisher APIs to send to node @type pub_uris: [str]...
Function service_update_task Contact api.serviceUpdate with specified parameters @param api: XML-RPC URI of node to contact @type api: str @param service: Service name to send to node @type service: str @param uri: URI to send to node @type uri: str...
Constant LOG_API Undocumented
Constant MSG Undocumented
Constant NUM_WORKERS Undocumented
Constant STATUS Undocumented
Constant VAL Undocumented
Variable _logger Undocumented
def apivalidate(error_return_value, validators=()):

ROS master/slave arg-checking decorator. Applies the specified validator to the corresponding argument and also remaps each argument to be the value returned by the validator. Thus, arguments can be simultaneously validated and canonicalized prior to actual function call. @param error_return_value: API value to return if call unexpectedly fails @param validators: sequence of validators to apply to each

arg. None means no validation for the parameter is required. As all api methods take caller_id as the first parameter, the validators start with the second param.

@type validators: sequence

def mloginfo(msg, *args):

Info-level master log statements. These statements may be printed to screen so they should be user-readable. @param msg: Message string @type msg: str @param args: arguments for msg if msg is a format string

def mlogwarn(msg, *args):

Warn-level master log statements. These statements may be printed to screen so they should be user-readable. @param msg: Message string @type msg: str @param args: arguments for msg if msg is a format string

def publisher_update_task(api, topic, pub_uris):

Contact api.publisherUpdate with specified parameters @param api: XML-RPC URI of node to contact @type api: str @param topic: Topic name to send to node @type topic: str @param pub_uris: list of publisher APIs to send to node @type pub_uris: [str]

def service_update_task(api, service, uri):

Contact api.serviceUpdate with specified parameters @param api: XML-RPC URI of node to contact @type api: str @param service: Service name to send to node @type service: str @param uri: URI to send to node @type uri: str

LOG_API: bool =

Undocumented

Value
False
MSG: int =

Undocumented

Value
1
NUM_WORKERS: int =

Undocumented

Value
3
STATUS: int =

Undocumented

Value
0
VAL: int =

Undocumented

Value
2
_logger =

Undocumented