From fe1dfc2237d40ad9e4a900831d1f7313301df15c Mon Sep 17 00:00:00 2001 From: Vijay Pradeep Date: Thu, 15 Nov 2018 15:57:25 -0400 Subject: [PATCH] Remove edge simplification from node-only graph. Previously, when there were multiple topics between two nodes, only one of the topics was being displayed. This was caused by graph simplification flag not being passed into the edge-adding code. Graph simplification was also defaulting to True, when in fact it should be false for the node-to-node graph. --- src/rqt_graph/dotcode.py | 10 ++++++---- src/rqt_graph/ros_graph.py | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/rqt_graph/dotcode.py b/src/rqt_graph/dotcode.py index 9eb21e0..8119d7e 100644 --- a/src/rqt_graph/dotcode.py +++ b/src/rqt_graph/dotcode.py @@ -209,7 +209,7 @@ def _calc_statistic_info(self, sub, topic, pub=None): else: return [None, None, None] - def _add_edge(self, edge, dotcode_factory, dotgraph, is_topic=False): + def _add_edge(self, edge, dotcode_factory, dotgraph, is_topic=False, simplify=True): if is_topic: sub = edge.end topic = edge.label @@ -224,14 +224,16 @@ def _add_edge(self, edge, dotcode_factory, dotgraph, is_topic=False): label=temp_label, url='topic:%s' % edge.label, penwidth=penwidth, - color=color) + color=color, + simplify=simplify) else: dotcode_factory.add_edge_to_graph( dotgraph, _conv(edge.start), _conv(edge.end), label=edge.label, - url='topic:%s' % edge.label) + url='topic:%s' % edge.label, + simplify=simplify) else: sub = edge.end.strip() topic = edge.start.strip() @@ -822,7 +824,7 @@ def generate_dotgraph( for e in edges: self._add_edge( - e, dotcode_factory, dotgraph=dotgraph, is_topic=(graph_mode == NODE_NODE_GRAPH)) + e, dotcode_factory, dotgraph=dotgraph, is_topic=(graph_mode == NODE_NODE_GRAPH), simplify=simplify) for (action_prefix, node_connections) in action_nodes.items(): for out_edge in node_connections.get('outgoing', []): diff --git a/src/rqt_graph/ros_graph.py b/src/rqt_graph/ros_graph.py index 52a1ba2..67a6ae5 100644 --- a/src/rqt_graph/ros_graph.py +++ b/src/rqt_graph/ros_graph.py @@ -304,6 +304,7 @@ def _generate_dotcode(self): hide_tf_nodes = self._widget.hide_tf_nodes_check_box.isChecked() group_image_nodes = self._widget.group_image_check_box.isChecked() hide_dynamic_reconfigure = self._widget.hide_dynamic_reconfigure_check_box.isChecked() + simplify = (graph_mode != NODE_NODE_GRAPH) return self.dotcode_generator.generate_dotcode( rosgraphinst=self._graph, @@ -321,7 +322,8 @@ def _generate_dotcode(self): group_tf_nodes=group_tf_nodes, hide_tf_nodes=hide_tf_nodes, group_image_nodes=group_image_nodes, - hide_dynamic_reconfigure=hide_dynamic_reconfigure) + hide_dynamic_reconfigure=hide_dynamic_reconfigure, + simplify=simplify) def _update_graph_view(self, dotcode): if dotcode == self._current_dotcode: