package documentation

rosnode implements the rosnode command-line tool and also provides a library for retrieving ROS Node information.

From __init__.py:

Exception ROSNodeException rosnode base exception type
Exception ROSNodeIOException Exceptions for communication-related (i/o) errors, generally due to Master or Node network communication issues.
Function cleanup_master_blacklist Remove registrations from ROS Master and node cache (_caller_apis) that match blacklist. @param master: rosgraph Master instance @type master: rosgraph.Master @param blacklist: list of nodes to scrub @type blacklist: [str]...
Function cleanup_master_whitelist Remove registrations from ROS Master that do not match whitelist. @param master: rosgraph Master instance @type master: rosgraph.Master @param whitelist: list of nodes to keep @type whitelist: list of nodes to keep...
Function get_api_uri @param master: rosgraph Master instance @type master: rosgraph.Master @param caller_id: node name @type caller_id: str @param skip_cache: flag to skip cached data and force to lookup node from master @type skip_cache: bool @return: xmlrpc URI of caller_id @rtype: str @raise ROSNodeIOException: if unable to communicate with master...
Function get_machines_by_nodes Find machines connected to nodes. This is a very costly procedure as it must do N lookups with the Master, where N is the number of nodes.
Function get_node_connection_info_description Undocumented
Function get_node_info_description Undocumented
Function get_node_names @param namespace: optional namespace to scope return values by. Namespace must already be resolved. @type namespace: str @return: list of node caller IDs @rtype: [str] @raise ROSNodeIOException: if unable to communicate with master...
Function get_nodes_by_machine Find nodes by machine name. This is a very costly procedure as it must do N lookups with the Master, where N is the number of nodes.
Function kill_nodes Call shutdown on the specified nodes
Function lookup_uri Undocumented
Function rosnode_cleanup This is a semi-hidden routine for cleaning up stale node registration information on the ROS Master. The intent is to remove this method once Master TTLs are properly implemented.
Function rosnode_info Print information about node, including subscriptions and other debugging information. This will query the node over the network.
Function rosnode_listnodes Print list of all ROS nodes to screen.
Function rosnode_ping Test connectivity to node by calling its XMLRPC API @param node_name: name of node to ping @type node_name: str @param max_count: number of ping requests to make @type max_count: int @param verbose: print ping information to screen @type verbose: bool @param skip_cache: flag to skip cached data and force to lookup from master @type skip_cache: bool @return: True if node pinged @rtype: bool @raise ROSNodeIOException: if unable to communicate with master...
Function rosnode_ping_all Ping all running nodes @return [str], [str]: pinged nodes, un-pingable nodes @raise ROSNodeIOException: if unable to communicate with master
Function rosnodemain Prints rosnode main entrypoint. @param argv: override sys.argv @param argv: [str]
Constant CONNECTION_PATTERN Undocumented
Constant ID Undocumented
Constant NAME Undocumented
Function _fullusage Prints rosnode usage information. @param return_error whether to exit with error code os.EX_USAGE
Function _rosnode_cmd_cleanup Implements rosnode 'cleanup' command. @param argv: command-line args @type argv: [str]
Function _rosnode_cmd_info Implements rosnode 'info' command.
Function _rosnode_cmd_kill Implements rosnode 'kill' command.
Function _rosnode_cmd_list Implements rosnode 'list' command.
Function _rosnode_cmd_machine Implements rosnode 'machine' command.
Function _rosnode_cmd_ping Implements rosnode 'ping' command. @param argv: command-line args @type argv: [str]
Function _sub_rosnode_listnodes Subroutine for rosnode_listnodes(). Composes list of strings to print to screen.
Function _succeed Undocumented
Variable _caller_apis Undocumented
NAME: str =

Undocumented

Value
'rosnode'
ID: str =

Undocumented

Value
'/rosnode'
CONNECTION_PATTERN =

Undocumented

Value
re.compile(r'\w+ connection on port (\d+) to \[(.*) on socket (\d+)\]')
def _succeed(args):

Undocumented

_caller_apis: dict =

Undocumented

def get_api_uri(master, caller_id, skip_cache=False):

@param master: rosgraph Master instance @type master: rosgraph.Master @param caller_id: node name @type caller_id: str @param skip_cache: flag to skip cached data and force to lookup node from master @type skip_cache: bool @return: xmlrpc URI of caller_id @rtype: str @raise ROSNodeIOException: if unable to communicate with master

def lookup_uri(master, system_state, topic, uri):

Undocumented

def get_node_names(namespace=None):

@param namespace: optional namespace to scope return values by. Namespace must already be resolved. @type namespace: str @return: list of node caller IDs @rtype: [str] @raise ROSNodeIOException: if unable to communicate with master

def get_machines_by_nodes():

Find machines connected to nodes. This is a very costly procedure as it must do N lookups with the Master, where N is the number of nodes.

@return: list of machines connected @rtype: [str] @raise ROSNodeIOException: if unable to communicate with master

def get_nodes_by_machine(machine):

Find nodes by machine name. This is a very costly procedure as it must do N lookups with the Master, where N is the number of nodes.

@return: list of nodes on the specified machine @rtype: [str] @raise ROSNodeException: if machine name cannot be resolved to an address @raise ROSNodeIOException: if unable to communicate with master

def kill_nodes(node_names):

Call shutdown on the specified nodes

@return: list of nodes that shutdown was called on successfully and list of failures @rtype: ([str], [str])

def _sub_rosnode_listnodes(namespace=None, list_uri=False, list_all=False):

Subroutine for rosnode_listnodes(). Composes list of strings to print to screen.

@param namespace: (default None) namespace to scope list to. @type namespace: str @param list_uri: (default False) return uris of nodes instead of names. @type list_uri: bool @param list_all: (default False) return names and uris of nodes as combined strings @type list_all: bool @return: new-line separated string containing list of all nodes @rtype: str

def rosnode_listnodes(namespace=None, list_uri=False, list_all=False):

Print list of all ROS nodes to screen.

@param namespace: namespace to scope list to @type namespace: str @param list_uri: print uris of nodes instead of names @type list_uri: bool @param list_all: print node names and uris @param list_all: bool

def rosnode_ping(node_name, max_count=None, verbose=False, skip_cache=False):

Test connectivity to node by calling its XMLRPC API @param node_name: name of node to ping @type node_name: str @param max_count: number of ping requests to make @type max_count: int @param verbose: print ping information to screen @type verbose: bool @param skip_cache: flag to skip cached data and force to lookup from master @type skip_cache: bool @return: True if node pinged @rtype: bool @raise ROSNodeIOException: if unable to communicate with master

def rosnode_ping_all(verbose=False, skip_cache=False):

Ping all running nodes @return [str], [str]: pinged nodes, un-pingable nodes @raise ROSNodeIOException: if unable to communicate with master

def cleanup_master_blacklist(master, blacklist):

Remove registrations from ROS Master and node cache (_caller_apis) that match blacklist. @param master: rosgraph Master instance @type master: rosgraph.Master @param blacklist: list of nodes to scrub @type blacklist: [str]

def cleanup_master_whitelist(master, whitelist):

Remove registrations from ROS Master that do not match whitelist. @param master: rosgraph Master instance @type master: rosgraph.Master @param whitelist: list of nodes to keep @type whitelist: list of nodes to keep

def rosnode_cleanup():

This is a semi-hidden routine for cleaning up stale node registration information on the ROS Master. The intent is to remove this method once Master TTLs are properly implemented.

def get_node_info_description(node_name):

Undocumented

def get_node_connection_info_description(node_api, master):

Undocumented

def rosnode_info(node_name, quiet=False):

Print information about node, including subscriptions and other debugging information. This will query the node over the network.

@param node_name: name of ROS node @type node_name: str @raise ROSNodeIOException: if unable to communicate with master

def _rosnode_cmd_list(argv):

Implements rosnode 'list' command.

def _rosnode_cmd_info(argv):

Implements rosnode 'info' command.

def _rosnode_cmd_machine(argv):

Implements rosnode 'machine' command.

@raise ROSNodeException: if user enters in unrecognized machine name

def _rosnode_cmd_kill(argv):

Implements rosnode 'kill' command.

@raise ROSNodeException: if user enters in unrecognized nodes

def _rosnode_cmd_cleanup(argv):

Implements rosnode 'cleanup' command. @param argv: command-line args @type argv: [str]

def _rosnode_cmd_ping(argv):

Implements rosnode 'ping' command. @param argv: command-line args @type argv: [str]

def _fullusage(return_error=True):

Prints rosnode usage information. @param return_error whether to exit with error code os.EX_USAGE

def rosnodemain(argv=None):

Prints rosnode main entrypoint. @param argv: override sys.argv @param argv: [str]