Package rosnode
[frames] | no frames]

Package rosnode

source code

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

Classes
  ROSNodeException
rosnode base exception type
  ROSNodeIOException
Exceptions for communication-related (i/o) errors, generally due to Master or Node network communication issues.
Functions
str
get_api_uri(master, caller_id, skip_cache=False)
Returns: xmlrpc URI of caller_id
source code
 
lookup_uri(master, system_state, topic, uri) source code
[str]
get_node_names(namespace=None)
Returns: list of node caller IDs
source code
[str]
get_machines_by_nodes()
Find machines connected to nodes.
source code
[str]
get_nodes_by_machine(machine)
Find nodes by machine name.
source code
([str], [str])
kill_nodes(node_names)
Call shutdown on the specified nodes
source code
 
rosnode_listnodes(namespace=None, list_uri=False, list_all=False)
Print list of all ROS nodes to screen.
source code
bool
rosnode_ping(node_name, max_count=None, verbose=False)
Test connectivity to node by calling its XMLRPC API
source code
 
rosnode_ping_all(verbose=False)
Ping all running nodes
source code
 
cleanup_master_blacklist(master, blacklist)
Remove registrations from ROS Master that match blacklist.
source code
 
cleanup_master_whitelist(master, whitelist)
Remove registrations from ROS Master that do not match whitelist.
source code
 
rosnode_cleanup()
This is a semi-hidden routine for cleaning up stale node registration information on the ROS Master.
source code
 
get_node_info_description(node_name) source code
 
get_node_connection_info_description(node_api, master) source code
 
rosnode_info(node_name, quiet=False)
Print information about node, including subscriptions and other debugging information.
source code
 
rosnode_debugnode(node_name, quiet=False)
Print information about node, including subscriptions and other debugging information.
source code
 
rosnodemain(argv=None)
Prints rosnode main entrypoint.
source code
Variables
  NAME = 'rosnode'
  ID = '/rosnode'
  CONNECTION_PATTERN = re.compile(r'\w+ connection on port (\d+)...
  __package__ = 'rosnode'
Function Details

get_api_uri(master, caller_id, skip_cache=False)

source code 
Parameters:
  • master (rosgraph.Master) - rosgraph Master instance
  • caller_id (str) - node name
  • skip_cache (bool) - flag to skip cached data and force to lookup node from master
Returns: str
xmlrpc URI of caller_id
Raises:

get_node_names(namespace=None)

source code 
Parameters:
  • namespace (str) - optional namespace to scope return values by. Namespace must already be resolved.
Returns: [str]
list of node caller IDs
Raises:

get_machines_by_nodes()

source code 

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.

Returns: [str]
list of machines connected
Raises:

get_nodes_by_machine(machine)

source code 

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.

Returns: [str]
list of nodes on the specified machine
Raises:

kill_nodes(node_names)

source code 

Call shutdown on the specified nodes

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

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

source code 

Print list of all ROS nodes to screen.

Parameters:
  • namespace (str) - namespace to scope list to
  • list_uri (bool) - print uris of nodes instead of names
  • list_all - print node names and uris
  • list_all - bool

rosnode_ping(node_name, max_count=None, verbose=False)

source code 

Test connectivity to node by calling its XMLRPC API

Parameters:
  • node_name (str) - name of node to ping
  • max_count (int) - number of ping requests to make
  • verbose (bool) - print ping information to screen
Returns: bool
True if node pinged
Raises:

rosnode_ping_all(verbose=False)

source code 

Ping all running nodes

Raises:

cleanup_master_blacklist(master, blacklist)

source code 

Remove registrations from ROS Master that match blacklist.

Parameters:
  • master (rosgraph.Master) - rosgraph Master instance
  • blacklist ([str]) - list of nodes to scrub

cleanup_master_whitelist(master, whitelist)

source code 

Remove registrations from ROS Master that do not match whitelist.

Parameters:
  • master (rosgraph.Master) - rosgraph Master instance
  • whitelist (list of nodes to keep) - list of nodes to keep

rosnode_cleanup()

source code 

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.

rosnode_info(node_name, quiet=False)

source code 

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

Parameters:
  • node_name (str) - name of ROS node
Raises:

rosnode_debugnode(node_name, quiet=False)

source code 

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

Parameters:
  • node_name (str) - name of ROS node
Raises:

rosnodemain(argv=None)

source code 

Prints rosnode main entrypoint.

Parameters:
  • argv - override sys.argv
  • argv - [str]

Variables Details

CONNECTION_PATTERN

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