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 | get |
Retrieve transport/topic connection information @param caller_id: ROS caller id @type caller_id: str |
Method | get |
Retrieve transport/topic statistics @param caller_id: ROS caller id @type caller_id: str @return: [publishStats, subscribeStats, serviceStats]: |
Method | get |
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 | get |
Undocumented |
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 |
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 | get |
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 | get |
Undocumented |
Method | param |
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 | publisher |
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 | request |
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 | master |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | protocol |
Undocumented |
Instance Variable | reg |
Undocumented |
Instance Variable | uri |
Undocumented |
Method | _connect |
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 |
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 |
@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 |
Undocumented |
@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
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
Retrieve transport/topic connection information @param caller_id: ROS caller id @type caller_id: str
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]
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]
Get the PID of this server @param caller_id: ROS caller id @type caller_id: str @return: [1, "", serverProcessPID] @rtype: [int, str, int]
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]]]
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]]]
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]
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]
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*]]
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]
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]
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