28 matplotlib.use(
"Qt5Agg")
36 from matplotlib.backends.backend_qt5agg
import FigureCanvasQTAgg
as FigureCanvas
37 from matplotlib.figure
import Figure
38 from matplotlib.animation
import TimedAnimation
39 from matplotlib.lines
import Line2D
43 from python_qt_binding
import loadUi
48 from sensor_msgs.msg
import JointState
49 from control_msgs.msg
import JointControllerState
50 from diagnostic_msgs.msg
import DiagnosticArray
51 from std_msgs.msg
import Float64MultiArray
52 from QtGui
import QIcon, QColor, QPainter, QFont
53 from QtWidgets
import QMessageBox, QWidget
54 from QtCore
import QRectF, QTimer
55 from sr_robot_msgs.msg
import Biotac, BiotacAll
56 from sr_utilities.hand_finder
import HandFinder
63 super(SrDataVisualizer, self).
__init__(context)
64 self.setObjectName(
"SrDataVisualizer")
69 for key
in self._hand_parameters.joint_prefix:
72 ui_file = os.path.join(rospkg.RosPack().get_path(
'sr_data_visualization'),
'uis',
'hand-e_visualizer.ui')
74 if __name__ !=
"__main__":
75 context.add_widget(self.
_widget)
76 self._widget.setWindowTitle(
"Dexterous Hand Data Visualizer")
79 p = self._widget.palette()
80 p.setColor(self._widget.backgroundRole(), Qt.white)
81 self._widget.setPalette(p)
86 p = self.tab_widget_main.palette()
88 QTabWidget>QWidget>QWidget{background: white;} 90 p.setColor(self.tab_widget_main.backgroundRole(), Qt.white)
91 self.tab_widget_main.setStyleSheet(stylesheet)
93 self.tab_widget_main.currentChanged.connect(self.
tab_change)
96 motor_stat_keys_file = os.path.join(rospkg.RosPack().get_path(
'sr_data_visualization'),
'config',
97 'data_visualiser_motor_stat_keys.yaml')
99 parameters_file = os.path.join(rospkg.RosPack().get_path(
'sr_data_visualization'),
'config',
100 'data_visualiser_parameters_rh.yaml')
102 parameters_file = os.path.join(rospkg.RosPack().get_path(
'sr_data_visualization'),
'config',
103 'data_visualiser_parameters_lh.yaml')
105 rospy.logerr(
"Unknown hand detected")
107 self.
t0 = time.time()
109 self.
reset_tab_1 = self._widget.findChild(QPushButton,
"reset_tab1")
110 self.
reset_tab_2 = self._widget.findChild(QPushButton,
"reset_tab2")
111 self.
reset_tab_3 = self._widget.findChild(QPushButton,
"reset_tab3")
112 self.reset_tab_1.clicked.connect(self.
reset_1)
113 self.reset_tab_2.clicked.connect(self.
reset_2)
114 self.reset_tab_3.clicked.connect(self.
reset_3)
129 with open(motor_stat_keys_file,
'r') as stream: 132 except yaml.YAMLError
as exc:
135 with open(parameters_file,
'r') as stream: 137 data_loaded = yaml.load(stream)
139 except yaml.YAMLError
as exc:
144 self.tabWidget_motor_stats.setCurrentIndex(0)
145 self.tabWidget_motor_stats.setCurrentIndex(1)
146 self.tabWidget_motor_stats.setCurrentIndex(2)
147 self.tabWidget_motor_stats.setCurrentIndex(3)
148 self.tabWidget_motor_stats.setCurrentIndex(4)
149 self.tabWidget_motor_stats.setCurrentIndex(5)
150 self.tabWidget_motor_stats.setCurrentIndex(0)
155 QTimer.singleShot(5000, self.
reset_1)
159 graph_type = [key
for key, value
in self.graph_names_global.items()]
160 for element
in graph_type:
162 graph.enabled =
False 165 if (self._widget.width() * self._widget.height()) < 3500000:
172 self.radio_button_all.setChecked(
True)
176 self.radio_button_ctrl_all.setChecked(
True)
180 self.radioButton_all_motor_stat.setChecked(
True)
183 graph_type = [key
for key, value
in self.graph_names_global.items()
if self.
type_dict[tab]
in key]
184 for element
in graph_type:
187 graph._handle_resize()
199 tactile_gui._widget = self.
_widget 200 tactile_gui.find_children(i)
201 self.tactile_gui_list.append(tactile_gui)
202 widget = self._widget.findChild(QWidget,
"widget" +
"_" + str(i))
205 self.timer.timeout.connect(widget.update)
206 widget.paintEvent = tactile_gui.paintEvent
207 if not tactile_gui._hand_parameters.mapping:
208 rospy.logerr(
"No hand detected")
218 lcd = self._widget.findChild(QLCDNumber,
"lcdE0" + str(i) +
"_" + str(j))
219 label = self._widget.findChild(QLabel,
"label_E0" + str(i) +
"_" + str(j))
221 lcd = self._widget.findChild(QLCDNumber,
"lcdE" + str(i) +
"_" + str(j))
222 label = self._widget.findChild(QLabel,
"label_E" + str(i) +
"_" + str(j))
225 self.lcd_list.append(lcds)
226 self.label_list.append(labels)
231 tactile_widget.redraw_electrodes()
233 if (self._widget.width() * self._widget.height()) < 3500000:
240 font = QFont(
'Sans Serif', scale)
241 font.setKerning(
True)
244 self.
lcd_list[j][i].setMinimumHeight(2)
245 self.
lcd_list[j][i].setMaximumHeight(mheight)
260 graph_type = [key
for key, value
in self.graph_names_global.items()
if "pos_vel_eff" not in key]
264 graph_type = [key
for key, value
in self.graph_names_global.items()
if "control_loops" not in key]
268 graph_type = [key
for key, value
in self.graph_names_global.items()
if "motor_stat" not in key]
272 graph_type = [key
for key, value
in self.graph_names_global.items()
if "palm_extras" not in key]
274 graph_type = [key
for key, value
in self.graph_names_global.items()
if "palm_extras" in key]
277 graph_type = [key
for key, value
in self.graph_names_global.items()
if "biotacs" not in key]
281 graph_type = [key
for key, value
in self.graph_names_global.items()]
283 elif tab ==
"motor_stat":
287 tab_index = self.tabWidget_motor_stats.currentIndex()
299 x = [value
for key, value
in self.
graph_dict_global[
"motor_stat"].items()
if joint_group
in key]
302 x = [value
for key, value
in self.
graph_dict_global[
"motor_stat"].items()
if joint_group
not in key]
304 graph.enabled =
False 307 for element
in graph_type:
309 graph.enabled =
not disable
335 "radioButton_last_commanded_effort")
339 number_of_radio_button_pages = 3
340 for j
in range(number_of_radio_button_pages):
341 for i
in range(len(self.
global_yaml[
"graphs"][j][
"lines"])):
343 self.radio_button_list.append(tmp)
345 self.radio_button_list.append(tmp)
359 self.radioButton_strain_gauge_left.toggled.connect(
361 self.radioButton_strain_gauge_right.toggled.connect(
363 self.radioButton_measured_pwm.toggled.connect(
365 self.radioButton_measured_current.toggled.connect(
367 self.radioButton_measured_voltage.toggled.connect(
369 self.radioButton_measured_effort.toggled.connect(
371 self.radioButton_temperature.toggled.connect(
373 self.radioButton_unfiltered_position.toggled.connect(
375 self.radioButton_unfiltered_force.toggled.connect(
377 self.radioButton_last_commanded_effort.toggled.connect(
379 self.radioButton_encoder_position.toggled.connect(
381 self.radioButton_all_motor_stat.toggled.connect(
387 if "legend_columns" in self.
global_yaml[
"graphs"][type]:
388 number_of_columns = self.
global_yaml[
"graphs"][type][
"legend_columns"]
389 elif all
and graph_type ==
"pos_vel_eff":
390 number_of_columns = 3
391 elif all
and graph_type ==
"control_loops":
392 number_of_columns = 5
393 elif all
and graph_type ==
"motor_stat":
394 number_of_columns = 1
397 def _button_function(b):
398 if b.text() ==
"All":
402 legend_name = self.
global_yaml[
"graphs"][type][
"lines"][i]
403 legend_name_stripped = re.sub(
r"[\(\[].*?[\)\]]",
"", legend_name).strip()
405 def _button_function(b):
406 if legend_name_stripped
in b.text():
409 line_number=i, type=type, ncol=1)
410 return _button_function
413 index = kwargs[
"type"]
416 if 'ncol' not in kwargs:
419 ncols = kwargs[
"ncol"]
427 graph.plot_all =
True 428 graph.ax1.yaxis.set_tick_params(which=
'both', labelbottom=
False)
430 graph.ax1.legend(graph.line, self.
global_yaml[
"graphs"][index][
"lines"],
431 bbox_to_anchor=(0.0, 1.0, 1.0, 0.9), framealpha=0.8, loc=3, mode=
"expand",
432 borderaxespad=0.5, ncol=ncols,
435 graph.ymin = self.
global_yaml[
"graphs"][index][
"ranges"][kwargs[
"line_number"]][0]
436 graph.ymax = self.
global_yaml[
"graphs"][index][
"ranges"][kwargs[
"line_number"]][1]
437 graph.line_to_plot = kwargs[
"line_number"]
438 graph.plot_all =
False 439 graph.ax1.yaxis.set_tick_params(which=
'both', labelbottom=
True, labelsize=6)
441 graph.ax1.legend(graph.line, kwargs[
"legend_name"], bbox_to_anchor=(0.0, 1.0, 1.0, 0.9),
442 framealpha=0.8, loc=3, mode=
"expand", borderaxespad=0.5,
449 def _callback(value):
452 graph.addData(value.set_point * (ymax / self.
global_yaml[
"graphs"][1][
"ranges"][0][1]), 0)
453 graph.addData(value.process_value * (ymax / self.
global_yaml[
"graphs"][1][
"ranges"][1][1]), 1)
454 graph.addData(value.process_value_dot * (ymax / self.
global_yaml[
"graphs"][1][
"ranges"][2][1]), 2)
455 graph.addData(value.error * (ymax / self.
global_yaml[
"graphs"][1][
"ranges"][3][1]), 3)
456 graph.addData(value.command * (ymax / self.
global_yaml[
"graphs"][1][
"ranges"][4][1]), 4)
458 graph.addData(value.set_point, 0)
459 graph.addData(value.process_value, 1)
460 graph.addData(value.process_value_dot, 2)
461 graph.addData(value.error, 3)
462 graph.addData(value.command, 4)
469 for i
in range(len(graphs[
"ranges"])):
470 if graphs[
"ranges"][i][0] <= ymin
and graphs[
"ranges"][i][1] >= ymax:
471 ymin = graphs[
"ranges"][i][0]
472 ymax = graphs[
"ranges"][i][1]
473 scales = [ymin, ymax]
478 topic_list = rospy.get_published_topics()
480 for topic
in topic_list:
482 if "bio" in value
or "Bio" in value:
487 if graphs[
"type"] ==
"biotacs":
489 self.tab_widget_main.setTabEnabled(4,
False)
490 self.tab_widget_main.setTabEnabled(5,
False)
491 p = self.tab_widget_main.palette()
493 QTabBar::tab::disabled {width: 0; height: 0; margin: 0; padding: 1; border: none;} 494 QTabWidget>QWidget>QWidget{background: white;} 496 p.setColor(self.tab_widget_main.backgroundRole(), Qt.white)
497 self.tab_widget_main.setStyleSheet(stylesheet)
503 for graphs
in data[
"graphs"]:
507 if "legend_columns" in graphs:
508 legend_columns = graphs[
"legend_columns"]
510 legend_columns = len(graphs[
"lines"])
514 for i
in range(len(graphs[
"graph_names"])):
515 if graphs[
"type"] ==
"biotacs":
516 temp_graph_dict[graphs[
"graph_names"][i]] =
CustomFigCanvas(num_lines=len(graphs[
"lines"]),
517 colour=graphs[
"colours"],
518 ymin=graphs[
"ranges"][i][0],
519 ymax=graphs[
"ranges"][i][1],
520 legends=graphs[
"lines"],
521 legend_columns=legend_columns,
523 graphs[
"font_size"] +
526 xaxis_tick_animation=
False,
527 tail_enable=
False, enabled=
True)
529 temp_graph_dict[graphs[
"graph_names"][i]] =
CustomFigCanvas(num_lines=len(graphs[
"lines"]),
530 colour=graphs[
"colours"], ymin=ymin,
531 ymax=ymax, legends=graphs[
"lines"],
532 legend_columns=legend_columns,
537 xaxis_tick_animation=
False,
538 tail_enable=
False, enabled=
True)
542 if graphs[
"type"] ==
"control_loops":
543 for i
in range(len(graphs[
"graph_names"])):
544 sub_namespace = graphs[
"topic_namespace_start"] + graphs[
"graph_names"][i] + graphs[
545 "topic_namespace_end"]
549 rospy.Subscriber(sub_namespace, JointControllerState, callback=tmp_callback, queue_size=1))
551 elif graphs[
"type"] ==
"pos_vel_eff":
553 rospy.Subscriber(graphs[
"topic_namespace"], JointState, self.
_joint_state_cb, queue_size=1))
554 elif graphs[
"type"] ==
"motor_stat":
556 rospy.Subscriber(graphs[
"topic_namespace"], DiagnosticArray, self.
_diagnostic_cb,
558 elif graphs[
"type"] ==
"palm_extras_accelerometer":
560 rospy.Subscriber(graphs[
"topic_namespace"], Float64MultiArray, self.
_palm_extras_cb,
562 elif graphs[
"type"] ==
"biotacs":
564 rospy.Subscriber(graphs[
"topic_namespace"], BiotacAll, self.
_biotac_all_cb, queue_size=1))
568 for i
in range(len(graphs[
"graph_names"])):
569 if graphs[
"type"] ==
"control_loops":
570 layout = graphs[
"graph_names"][i] +
"_layout_ctrl" 571 elif graphs[
"type"] ==
"motor_stat":
572 layout = graphs[
"graph_names"][i] +
"_layout_motor_stat" 574 layout = graphs[
"graph_names"][i] +
"_layout" 575 lay_dic[graphs[
"graph_names"][i]] = self._widget.findChild(QVBoxLayout, layout)
577 for i
in range(len(graphs[
"graph_names"])):
578 x = lay_dic.get(graphs[
"graph_names"][i])
581 palm_extras_graphs = [value
for key, value
in self.graph_dict_global.items()
if 'palm_extras' in key]
583 for graph
in palm_extras_graphs:
584 for key, value
in graph.iteritems():
585 value.plot_all =
True 586 value.ax1.yaxis.set_tick_params(which=
'both', labelbottom=
True)
587 value.ymax = self.
global_yaml[
"graphs"][i][
"ranges"][0][1]
588 value.ymin = self.
global_yaml[
"graphs"][i][
"ranges"][0][0]
589 font_size = value.ax1.legend_.prop._size
591 value.ax1.legend(value.line, self.
global_yaml[
"graphs"][i][
"lines"],
592 bbox_to_anchor=(0.0, 1.0, 1.0, 0.9), framealpha=0.8, loc=3, mode=
"expand",
593 borderaxespad=0.5, ncol=len(self.
global_yaml[
"graphs"][i][
"lines"]),
594 prop={
'size': font_size})
601 for i
in range(len(value.name)):
613 range_array = self.
global_yaml[
"graphs"][0][
"ranges"]
615 graph.addData(value.position[data_index] * (ymax / range_array[0][1]), 0)
616 graph.addData(value.velocity[data_index] * (ymax / range_array[1][1]), 1)
617 graph.addData(value.effort[data_index] * (ymax / range_array[2][1]), 2)
620 graph.addData(value.position[data_index], 0)
621 graph.addData(value.velocity[data_index], 1)
622 graph.addData(value.effort[data_index], 2)
627 if len(data.status) > 1:
633 x = re.sub(
r"[\(\[].*?[\)\]]",
"", x).strip()
637 data_point = data.status[data_index]
639 data_value = data_point.values[line_number].value
640 scale = float(ymax / self.
global_yaml[
"graphs"][2][
"ranges"][j][1])
642 graph.addData(float(data_value) * scale, j)
644 graph.addData(float(data_value), j)
648 palm_extras_graphs = [value
for key, value
in self.graph_dict_global.items()
if 'palm_extras' in key]
649 for graph
in palm_extras_graphs:
650 if 'palm_extras_accelerometer' in graph:
651 graph[
"palm_extras_accelerometer"].addData(data.data[0], 0)
652 graph[
"palm_extras_accelerometer"].addData(data.data[1], 1)
653 graph[
"palm_extras_accelerometer"].addData(data.data[2], 2)
654 if 'palm_extras_gyro' in graph:
655 graph[
"palm_extras_gyro"].addData(data.data[3], 0)
656 graph[
"palm_extras_gyro"].addData(data.data[4], 1)
657 graph[
"palm_extras_gyro"].addData(data.data[5], 2)
658 if 'palm_extras_adc' in graph:
659 graph[
"palm_extras_adc"].addData(data.data[6], 0)
660 graph[
"palm_extras_adc"].addData(data.data[7], 1)
661 graph[
"palm_extras_adc"].addData(data.data[8], 2)
662 graph[
"palm_extras_adc"].addData(data.data[9], 3)
666 for i
in range(len(data.tactiles)):
675 _nb_electrodes_biotac = 19
676 _nb_electrodes_biotac_sp = 24
679 super(SrGuiBiotac, self).
__init__(context)
680 self.setObjectName(
'SrGuiBiotac')
688 self.
pixels = self._widget.width() * self._widget.height()
699 "sr_gui_biotac/sensing_electrodes_x_locations",
700 [6.45, 3.65, 3.65, 6.45, 3.65, 6.45, 0.00, 1.95, -1.95,
701 0.00, -6.45, - 3.65, -3.65, -6.45, -3.65, -6.45, 0.00,
705 "sr_gui_biotac/sensing_electrodes_y_locations",
706 [7.58, 11.28, 14.78, 16.58, 19.08, 21.98, 4.38, 6.38, 6.38,
707 8.38, 7.58, 11.28, 14.78, 16.58, 19.08, 21.98, 11.38,
712 "sr_gui_biotac/excitation_electrodes_x_locations",
713 [6.45, 3.75, -3.75, -6.45])
716 "sr_gui_biotac/excitation_electrodes_y_locations",
717 [12.48, 24.48, 24.48, 12.48])
721 "sr_gui_biotac/sensing_electrodes_x_locations",
722 [5.00, 3.65, 6.45, 4.40, 2.70, 6.45, 4.40, 1.50, 4.00, 4.50,
723 -5.00, - 3.65, -6.45, -4.40, -2.70, -6.45, -4.40, -1.50, -4.00, -4.50,
724 0.00, 1.95, -1.95, 0.00])
727 "sr_gui_biotac/sensing_electrodes_y_locations",
728 [4.38, 6.38, 14.78, 15.50, 18.50, 19.08, 20.00, 21.00, 23.00, 25.00,
729 4.38, 6.38, 14.78, 15.50, 18.50, 19.08, 20.00, 21.00, 23.00, 25.00,
730 7.38, 11.50, 11.50, 15.20])
734 "sr_gui_biotac/excitation_electrodes_x_locations",
735 [5.30, 6.00, -5.30, -6.00])
738 "sr_gui_biotac/excitation_electrodes_y_locations",
739 [9.00, 22.00, 9.00, 22.00])
753 rospy.logerr(
"Number of electrodes %d not matching known biotac models. expected: %d or %d",
786 threshold = (0.0, 1000.0, 2000.0, 3000.0, 4095.0)
788 if value <= threshold[0]:
791 elif value < threshold[1]:
793 g = 255 * ((value - threshold[0]) / (threshold[1] - threshold[0]))
796 elif value < threshold[2]:
797 r = 255 * ((threshold[2] - value) / (threshold[2] - threshold[1]))
801 elif value < threshold[3]:
804 b = 255 * ((value - threshold[2]) / (threshold[3] - threshold[2]))
805 elif value < threshold[4]:
807 g = 255 * ((threshold[4] - value) / (threshold[4] - threshold[3]))
810 return QColor(r, g, b)
817 painter.setBrush(colour)
818 painter.drawEllipse(rect)
823 painter.drawText(rect, text)
826 painter = QPainter(self.
widget)
833 value = self.latest_data.tactiles[which_tactile].electrodes[n]
835 eval(
"self._widget.lcdE%02d_%d.display(%d)" % (n + 1, self.
biotac_name, value))
849 self.
_draw_electrode(painter, elipse_x, elipse_y, text_x, text_y, colour, str(n + 1))
857 colour = QColor(127, 127, 127)
863 colour,
"X" + str(n + 1))
865 self._widget.update()
869 rospy.Subscriber(prefix +
"tactile", BiotacAll, self.
_tactile_cb)
874 "sr_gui_biotac/electrode_display_width",
877 "sr_gui_biotac/electrode_display_height", 30)
882 "sr_gui_biotac/x_display_offset", [125, 12.5, 4.5,
887 "sr_gui_biotac/y_display_offset", [-30, 4.0, 4.0, 4.0])
889 "sr_gui_biotac/electrode_label_font_sizes", [8,
893 if self._hand_parameters.mapping:
895 self._hand_parameters.mapping.values()[0] +
'/')
900 self.
widget = self._widget.findChild(QWidget,
"widget" +
"_" + str(biotac_name))
904 self.
pixels = self._widget.width() * self._widget.height()
912 rospy.logerr(
"Number of electrodes %d not matching known biotac models. expected: %d or %d",
936 def __init__(self, num_lines, colour=[], ymin=-1, ymax=1, legends=[], legend_columns='none', legend_font_size=7,
937 num_ticks=4, xaxis_tick_animation=
False, tail_enable=
True, enabled=
True):
951 if legend_columns ==
'none':
957 self.addedDataArray.append(addedData)
964 self.y.append((self.
n * 0.0) + 50)
969 self.
fig = Figure(figsize=(3, 3), dpi=100, facecolor=(1.0, 1.0, 1.0, 1.0))
971 self.
ax1 = self.fig.add_subplot(111)
974 self.ax1.axes.get_xaxis().set_visible(
False)
977 for tick
in self.ax1.yaxis.get_major_ticks():
978 tick.label.set_fontsize(7)
979 self.ax1.yaxis.grid(
True, linestyle=
'-', which=
'major', color=
'lightgrey', alpha=0.5)
980 self.ax1.yaxis.set_tick_params(which=
'both', labelbottom=
False)
987 self.line.append(Line2D([], [], color=self.
colour[i]))
989 self.line_tail.append(Line2D([], [], color=
'red', linewidth=2))
990 self.line_head.append(Line2D([], [], color=
'red', marker=
'o', markeredgecolor=
'r')) 993 self.ax1.add_line(self.line[i]) 994 self.ax1.set_xlim(0, self.xlim - 1) 995 self.ax1.set_ylim(ymin, ymax) 997 self.fig.subplots_adjust(bottom=0.05, top=0.8, left=0.08, right=0.98) 998 self.ax1.legend(self.line, self.legends, bbox_to_anchor=(0.0, 1.0, 1.0, 0.9), framealpha=0.8, loc=3, 999 ncol=legend_columns, mode="expand", borderaxespad=0.5, prop={
'size': legend_font_size})
1000 FigureCanvas.__init__(self, self.
fig)
1011 self.line.append(Line2D([], [], color=self.
colour[i]))
1013 self.line_tail.append(Line2D([], [], color=
'red', linewidth=2))
1014 self.line_head.append(Line2D([], [], color=
'red', marker=
'o', markeredgecolor=
'r')) 1017 self.ax1.add_line(self.line[i]) 1018 self.ax1.set_xlim(0, self.xlim - 1) 1019 self.ax1.set_ylim(self.ymin, self.ymax) 1024 self.line_tail.append(Line2D([], [], color=
'red', linewidth=2))
1025 self.line_head.append(Line2D([], [], color=
'red', marker=
'o', markeredgecolor=
'r')) 1028 self.ax1.add_line(self.line[i]) 1029 self.ax1.set_xlim(0, self.xlim - 1) 1030 self.ax1.set_ylim(self.ymin, self.ymax) 1033 return iter(range(self.n.size))
1040 lines = [self.
line[i]]
1051 TimedAnimation._step(self, *args)
1057 self.
y[i] = np.roll(self.
y[i], -1)
1062 self.
line[i].set_data(self.
n[0: self.n.size - margin], self.
y[i][0: self.n.size - margin])
1064 self.
line_tail[i].set_data(np.append(self.
n[-10:-1 - margin], self.
n[-1 - margin]),
1065 np.append(self.
y[i][-10:-1 - margin], self.
y[i][-1 - margin]))
1066 self.
line_head[i].set_data(self.
n[-1 - margin], self.
y[i][-1 - margin])
1069 self._drawn_artists.append(l)
1072 self._drawn_artists.append(l)
1074 self._drawn_artists.append(l)
1077 self.
line[i].set_data(self.
n[0: self.n.size - margin], self.
y[i][0: self.n.size - margin])
1079 self.
line_tail[i].set_data(np.append(self.
n[-10:-1 - margin], self.
n[-1 - margin]),
1080 np.append(self.
y[i][-10:-1 - margin], self.
y[i][-1 - margin]))
1081 self.
line_head[i].set_data(self.
n[-1 - margin], self.
y[i][-1 - margin])
1084 self._drawn_artists.append(l)
1087 self._drawn_artists.append(l)
1089 self._drawn_artists.append(l)
1092 time_from_start = int((rospy.get_rostime() - self.
start_time).to_sec())
1097 self.label_buffer.append(time_from_start)
1101 self.ax1.set_xticks(x)
1102 self.ax1.set_xticklabels([int(i / int(self.
xlim / self.
num_ticks)) + time_from_start
for i
in x])
1105 if __name__ ==
"__main__":
1106 rospy.init_node(
"hand_e_visualizer")
1107 app = QApplication(sys.argv)
1109 data_visualiser_gui._widget.show()
1110 atexit.register(data_visualiser_gui.shutdown_plugin)
1111 signal.signal(signal.SIGINT, signal.SIG_DFL)
1112 sys.exit(app.exec_())
def define_electrodes(self)
def _disable_graphs(self, graph_type, disable)
def _show_specific_motor_stat_tabs(self)
radioButton_measured_effort
def _reset_graphs(self, tab)
radioButton_unfiltered_force
radioButton_measured_voltage
radioButton_all_motor_stat
def _palm_extras_cb(self, data)
def _diagnostic_cb(self, data)
def __init__(self, num_lines, colour=[], ymin=-1, ymax=1, legends=[], legend_columns='none', legend_font_size=7, num_ticks=4, xaxis_tick_animation=False, tail_enable=True, enabled=True)
def _get_electrode_colour_from_value(self, value)
def _draw_frame(self, framedata)
def tab_change(self, tab_index)
radioButton_last_commanded_effort
radioButton_unfiltered_position
def on_resize_tactile(self, none)
def _setup_radio_buttons(self)
def _biotac_all_cb(self, data)
radioButton_strain_gauge_left
radioButton_measured_current
def paintEvent(self, paintEvent)
def _make_all_button_functions(self, i, all, type)
def _hide_all_but(self, joint_group)
excitation_electrodes_v2_x
def _assign_electrodes(self, nb_electrodes)
def __init__(self, context)
def __init__(self, context)
def addData(self, value, index)
def _draw_electrode(self, painter, elipse_x, elipse_y, text_x, text_y, colour, text)
def _include_tactile_plugin(self)
int _nb_electrodes_biotac
def _hide_tabs(self, tab_index, tab)
def _hide_and_refresh(self, tab_index, tab_type)
radioButton_encoder_position
excitation_electrodes_v2_y
def _subscribe_to_topic(self, prefix)
def tab_change_mstat(self, tab_index)
def find_children(self, biotac_name)
def _make_control_loop_callbacks(self, graph)
def _find_max_range(self, graphs)
excitation_electrodes_v1_y
def _change_graphs(self, all, kwargs)
int _nb_electrodes_biotac_sp
def _tactile_cb(self, msg)
control_loop_callback_dict
excitation_electrodes_v1_x
def shutdown_plugin(self)
def _initialize(self, data)
radioButton_strain_gauge_right
def redraw_electrodes(self)
def _joint_state_cb(self, value)
def on_resize_main(self, empty)