rqt_graph.rosgraph2_impl module

Data structures and library for representing ROS Computation Graph state.

class rqt_graph.rosgraph2_impl.BadNode(name, node_type, reason)

Bases: object

Data structure for storing info about a ‘bad’ node.

DEAD = 0
WONKY = 1
class rqt_graph.rosgraph2_impl.Edge(start, end, label='', qos=None)

Bases: object

Data structure for representing ROS node graph edge.

end
key
label
qos
rkey
start
class rqt_graph.rosgraph2_impl.EdgeList

Bases: object

Data structure for storing Edge instances.

add(edge)

Add an edge to our internal representation.

@param edge: edge to add @type edge: Edge

add_edges(start, dest, direction, label='', qos=None)

Create Edge instances for args and add resulting edges to edge list.

A convenience method to avoid repetitve logging, etc. @param edge_list: data structure to add edge to @type edge_list: EdgeList @param start: name of start node. If None, warning will be logged and add fails @type start: str @param dest: name of start node. If None, warning will be logged and add fails @type dest: str @param direction: direction string (i/o/b) @type direction: str @return: True if update occurred @rtype: bool

delete(edge)
delete_all(node)

Delete all edges that start or end at node.

@param node: name of node @type node: str

edges_by_end
edges_by_start
has(edge)
class rqt_graph.rosgraph2_impl.Graph(node, node_ns='/', topic_ns='/')

Bases: object

Utility class for polling ROS statistics from running ROS graph.

bad_update()

Update loop for nodes with bad connectivity.

We box them separately so that we can maintain good performance of the normal update loop. Once a node is on the bad list it stays there.

set_node_stale(stale_secs)

Set the stale attribute of a node.

@param stale_secs: seconds that data is considered fresh @type stale_secs: double

update()

Update all the stats.

This method may take awhile to complete as it will communicate with all nodes.

rqt_graph.rosgraph2_impl.edge_args(start, dest, direction, label, qos)

Compute argument ordering for Edge constructor based on direction flag.

@param direction str: ‘i’, ‘o’, or ‘b’ (in/out/bidir) relative to start @param start str: name of starting node @param start dest: name of destination node

rqt_graph.rosgraph2_impl.node_topic(node)

Undo topic_node() mangling.

Inverse of topic_node @return str: undo topic_node() operation

rqt_graph.rosgraph2_impl.topic_node(topic)

Prepend space to avoid topic/node name aliasing.

In order to prevent topic/node name aliasing, we have to remap topic node names. Currently we just prepend a space, which is an illegal ROS name and thus not aliased. @return str: topic mapped to a graph node name.