class documentation

class ROSHandler(XmlRpcHandler):

Constructor: ROSHandler(name, master_uri)

View In Hierarchy

Base handler for both slave and master nodes. API methods generally provide the capability for establishing point-to-point connections with other nodes.

Instance methods are XML-RPC API methods, so care must be taken as to what is added here.

Class Method remappings @internal @param cls: class to register remappings on @type cls: Class: class to register remappings on @return: parameters (by pos) that should be remapped because they are names @rtype: list
Method __init__ Base constructor for ROS nodes/masters @param name: ROS name of this node @type name: str @param master_uri: URI of master node, or None if this node is the master @type master_uri: str
Method getBusInfo Retrieve transport/topic connection information @param caller_id: ROS caller id @type caller_id: str
Method getBusStats Retrieve transport/topic statistics @param caller_id: ROS caller id @type caller_id: str @return: [publishStats, subscribeStats, serviceStats]:
Method getMasterUri Get the URI of the master node. @param caller_id: ROS caller id @type caller_id: str @return: [code, msg, masterUri] @rtype: [int, str, str]
Method getName Undocumented
Method getPid Get the PID of this server @param caller_id: ROS caller id @type caller_id: str @return: [1, "", serverProcessPID] @rtype: [int, str, int]
Method getPublications Retrieve a list of topics that this node publishes. @param caller_id: ROS caller id @type caller_id: str @return: list of topics published by this node. @rtype: [int, str, [ [topic1, topicType1]...[topicN, topicTypeN]]]...
Method getSubscriptions Retrieve a list of topics that this node subscribes to. @param caller_id: ROS caller id @type caller_id: str @return: list of topics this node subscribes to. @rtype: [int, str, [ [topic1, topicType1].
Method getUri Undocumented
Method paramUpdate Callback from master of current publisher list for specified topic. @param caller_id: ROS caller id @type caller_id: str @param parameter_key str: parameter name, globally resolved @type parameter_key: str @param parameter_value New parameter value @type parameter_value: XMLRPC-legal value @return: [code, status, ignore]...
Method publisherUpdate Callback from master of current publisher list for specified topic. @param caller_id: ROS caller id @type caller_id: str @param topic str: topic name @type topic: str @param publishers: list of current publishers for topic in the form of XMLRPC URIs @type publishers: [str] @return: [code, status, ignore] @rtype: [int, str, int]...
Method requestTopic Publisher node API method called by a subscriber node.
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]
Instance Variable done Undocumented
Instance Variable masterUri Undocumented
Instance Variable name Undocumented
Instance Variable protocol_handlers Undocumented
Instance Variable reg_man Undocumented
Instance Variable uri Undocumented
Method _connect_topic Connect subscriber to topic. @param topic: Topic name to connect. @type topic: str @param pub_uri: API URI of topic publisher. @type pub_uri: str @return: [code, msg, numConnects]. numConnects is the number...
Method _custom_validate Implements validation rules that require access to internal ROSHandler state. @param validation: name of validation rule to use @type validation: str @param param_name: name of parameter being validated @type param_name: str @param param_value str: value of parameter @type param_value: str @param caller_id: value of caller_id parameter to API method @type caller_id: str @raise ParameterInvalid: if the parameter does not meet validation @return: new value for parameter, after validation...
Method _is_registered @return: True if slave API is registered with master. @rtype: bool
Method _ready @param uri: XML-RPC URI @type uri: str callback from ROSNode to inform handler of correct i/o information
Method _shutdown @param reason: human-readable debug string @type reason: str
Class Variable _remap_table Undocumented
@classmethod
def remappings(cls, methodName):

@internal @param cls: class to register remappings on @type cls: Class: class to register remappings on @return: parameters (by pos) that should be remapped because they are names @rtype: list

def __init__(self, name, master_uri):

Base constructor for ROS nodes/masters @param name: ROS name of this node @type name: str @param master_uri: URI of master node, or None if this node is the master @type master_uri: str

@apivalidate([])
def getBusInfo(self, caller_id):

Retrieve transport/topic connection information @param caller_id: ROS caller id @type caller_id: str

@apivalidate([])
def getBusStats(self, caller_id):

Retrieve transport/topic statistics @param caller_id: ROS caller id @type caller_id: str @return: [publishStats, subscribeStats, serviceStats]:

publishStats: [[topicName, messageDataSent, pubConnectionData]...[topicNameN, messageDataSentN, pubConnectionDataN]]
    pubConnectionData: [connectionId, bytesSent, numSent, connected]* .
subscribeStats: [[topicName, subConnectionData]...[topicNameN, subConnectionDataN]]
    subConnectionData: [connectionId, bytesReceived, dropEstimate, connected]* . dropEstimate is -1 if no estimate.
serviceStats: not sure yet, probably akin to [numRequests, bytesReceived, bytesSent]
@apivalidate('')
def getMasterUri(self, caller_id):

Get the URI of the master node. @param caller_id: ROS caller id @type caller_id: str @return: [code, msg, masterUri] @rtype: [int, str, str]

@apivalidate('')
def getName(self, caller_id):

Undocumented

@apivalidate((-1))
def getPid(self, caller_id):

Get the PID of this server @param caller_id: ROS caller id @type caller_id: str @return: [1, "", serverProcessPID] @rtype: [int, str, int]

@apivalidate([])
def getPublications(self, caller_id):

Retrieve a list of topics that this node publishes. @param caller_id: ROS caller id @type caller_id: str @return: list of topics published by this node. @rtype: [int, str, [ [topic1, topicType1]...[topicN, topicTypeN]]]

@apivalidate([])
def getSubscriptions(self, caller_id):

Retrieve a list of topics that this node subscribes to. @param caller_id: ROS caller id @type caller_id: str @return: list of topics this node subscribes to. @rtype: [int, str, [ [topic1, topicType1]...[topicN, topicTypeN]]]

@apivalidate('')
def getUri(self, caller_id):

Undocumented

@apivalidate((-1), (global_name('parameter_key'), None))
def paramUpdate(self, caller_id, parameter_key, parameter_value):

Callback from master of current publisher list for specified topic. @param caller_id: ROS caller id @type caller_id: str @param parameter_key str: parameter name, globally resolved @type parameter_key: str @param parameter_value New parameter value @type parameter_value: XMLRPC-legal value @return: [code, status, ignore]. If code is -1 ERROR, the node is not subscribed to parameter_key @rtype: [int, str, int]

@apivalidate((-1), (is_topic('topic'), is_publishers_list('publishers')))
def publisherUpdate(self, caller_id, topic, publishers):

Callback from master of current publisher list for specified topic. @param caller_id: ROS caller id @type caller_id: str @param topic str: topic name @type topic: str @param publishers: list of current publishers for topic in the form of XMLRPC URIs @type publishers: [str] @return: [code, status, ignore] @rtype: [int, str, int]

@apivalidate([], (is_topic('topic'), non_empty('protocols')))
def requestTopic(self, caller_id, topic, protocols):

Publisher node API method called by a subscriber node.

Request that source allocate a channel for communication. Subscriber provides a list of desired protocols for communication. Publisher returns the selected protocol along with any additional params required for establishing connection. For example, for a TCP/IP-based connection, the source node may return a port number of TCP/IP server. @param caller_id str: ROS caller id @type caller_id: str @param topic: topic name @type topic: str @param protocols: list of desired

protocols for communication in order of preference. Each protocol is a list of the form [ProtocolName, ProtocolParam1, ProtocolParam2...N]

@type protocols: [[str, XmlRpcLegalValue*]] @return: [code, msg, protocolParams]. protocolParams may be an empty list if there are no compatible protocols. @rtype: [int, str, [str, XmlRpcLegalValue*]]

@apivalidate(0, (None))
def shutdown(self, caller_id, msg=''):

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]

done: bool =

Undocumented

masterUri =

Undocumented

name =

Undocumented

protocol_handlers =

Undocumented

reg_man =

Undocumented

uri =

Undocumented

def _connect_topic(self, topic, pub_uri):

Connect subscriber to topic. @param topic: Topic name to connect. @type topic: str @param pub_uri: API URI of topic publisher. @type pub_uri: str @return: [code, msg, numConnects]. numConnects is the number

of subscribers connected to the topic.

@rtype: [int, str, int]

def _custom_validate(self, validation, param_name, param_value, caller_id):

Implements validation rules that require access to internal ROSHandler state. @param validation: name of validation rule to use @type validation: str @param param_name: name of parameter being validated @type param_name: str @param param_value str: value of parameter @type param_value: str @param caller_id: value of caller_id parameter to API method @type caller_id: str @raise ParameterInvalid: if the parameter does not meet validation @return: new value for parameter, after validation

def _is_registered(self):

@return: True if slave API is registered with master. @rtype: bool

def _ready(self, uri):

@param uri: XML-RPC URI @type uri: str callback from ROSNode to inform handler of correct i/o information

def _shutdown(self, reason=''):

@param reason: human-readable debug string @type reason: str

_remap_table: dict =

Undocumented