src/tools/benchmark_tool/benchmark_tool/rqt_graph/dotcode.py
def generate_namespaces(self, graph, graph_mode, quiet=False):
        """Determine the namespaces of the nodes being displayed."""
        namespaces = []
        nodes_and_namespaces = dict(self._node.get_node_names_and_namespace())
        if graph_mode == NODE_NODE_GRAPH:
            nodes = graph.nn_nodes
            if quiet:
                nodes = [n for n in nodes if n not in QUIET_NAMES]
            namespaces = list(set([nodes_and_namespaces[n] for n in nodes]))

        elif graph_mode == NODE_TOPIC_GRAPH or \
                graph_mode == NODE_TOPIC_ALL_GRAPH:
            nn_nodes = graph.nn_nodes
            nt_nodes = graph.nt_nodes
            if quiet:
                nn_nodes = [n for n in nn_nodes if n not in QUIET_NAMES]
                nt_nodes = [n for n in nt_nodes if n not in QUIET_NAMES]
            if nn_nodes or nt_nodes:
                namespaces = [nodes_and_namespaces[n] for n in nn_nodes]
            # an annoyance with the rosgraph library is that it
            # prepends a space to topic names as they have to have
            # different graph node namees from nodes. we have to strip here
            namespaces.extend([nodes_and_namespaces[n[1:]] for n in nt_nodes])

        return list(set(namespaces))
Determine the namespaces of the nodes being displayed.
Determine the namespaces of the nodes being displayed.
Determine the namespaces of the nodes being displayed .
def generate_namespaces(self, graph, graph_mode, quiet=False):
        namespaces = []
        nodes_and_namespaces = dict(self._node.get_node_names_and_namespace())
        if graph_mode == NODE_NODE_GRAPH:
            nodes = graph.nn_nodes
            if quiet:
                nodes = [n for n in nodes if n not in QUIET_NAMES]
            namespaces = list(set([nodes_and_namespaces[n] for n in nodes]))
        elif graph_mode == NODE_TOPIC_GRAPH or \
                graph_mode == NODE_TOPIC_ALL_GRAPH:
            nn_nodes = graph.nn_nodes
            nt_nodes = graph.nt_nodes
            if quiet:
                nn_nodes = [n for n in nn_nodes if n not in QUIET_NAMES]
                nt_nodes = [n for n in nt_nodes if n not in QUIET_NAMES]
            if nn_nodes or nt_nodes:
                namespaces = [nodes_and_namespaces[n] for n in nn_nodes]
            namespaces.extend([nodes_and_namespaces[n[1:]] for n in nt_nodes])
        return list(set(namespaces))
def generate_namespaces ( self , graph , graph_mode , quiet = False ) : namespaces = [ ] nodes_and_namespaces = dict ( self . _node . get_node_names_and_namespace ( ) ) if graph_mode == NODE_NODE_GRAPH : nodes = graph . nn_nodes if quiet : nodes = [ n for n in nodes if n not in QUIET_NAMES ] namespaces = list ( set ( [ nodes_and_namespaces [ n ] for n in nodes ] ) ) elif graph_mode == NODE_TOPIC_GRAPH or graph_mode == NODE_TOPIC_ALL_GRAPH : nn_nodes = graph . nn_nodes nt_nodes = graph . nt_nodes if quiet : nn_nodes = [ n for n in nn_nodes if n not in QUIET_NAMES ] nt_nodes = [ n for n in nt_nodes if n not in QUIET_NAMES ] if nn_nodes or nt_nodes : namespaces = [ nodes_and_namespaces [ n ] for n in nn_nodes ] namespaces . extend ( [ nodes_and_namespaces [ n [ 1 : ] ] for n in nt_nodes ] ) return list ( set ( namespaces ) )
Determine the namespaces of the nodes being displayed.
Determine the namespaces of the nodes being displayed .
"""Determine the namespaces of the nodes being displayed.""" # an annoyance with the rosgraph library is that it # prepends a space to topic names as they have to have # different graph node namees from nodes. we have to strip here
self
graph
graph_mode
quiet