From bee21f704b744620e3ea67f10621923d06932664 Mon Sep 17 00:00:00 2001 From: trainman419 Date: Mon, 28 Jul 2014 17:02:13 -0700 Subject: [PATCH] Handle variable-sized arrays. Fixes #261 --- rqt_plot/src/rqt_plot/plot_widget.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rqt_plot/src/rqt_plot/plot_widget.py b/rqt_plot/src/rqt_plot/plot_widget.py index 6696450f..6584702a 100644 --- a/rqt_plot/src/rqt_plot/plot_widget.py +++ b/rqt_plot/src/rqt_plot/plot_widget.py @@ -76,8 +76,12 @@ def get_plot_fields(topic_name): if field_class in (int, float): if is_array: - message = "topic %s is a numeric array" % ( topic_name ) - return [ "%s[%d]" % (topic_name, i) for i in range(array_size) ], message + if array_size is not None: + message = "topic %s is fixed-size numeric array" % ( topic_name ) + return [ "%s[%d]" % (topic_name, i) for i in range(array_size) ], message + else: + message = "topic %s is variable-size numeric array" % ( topic_name ) + return [], message else: message = "topic %s is numeric" % ( topic_name ) return [ topic_name ], message