1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 from python_qt_binding import QtCore
34 from python_qt_binding import QtGui
35
36 import roslib
37
39 '''
40 This creates a menu to start a several rqt plugins.
41 '''
42 start_rqt_plugin_signal = QtCore.Signal(str, str)
43 '''
44 The start_rqt_plugin_signal is emitted to start a rqt plugin (Name, Plugin).
45 The Plugin can be empty, in this case the RQT itself will be start.
46 '''
48 QtGui.QMenu.__init__(self)
49 self.button = menu_button
50 try:
51 rqt_icon_path = roslib.packages.find_resource('rqt_gui', 'rqt.png').pop()
52 menu_button.setText('')
53 menu_button.setIcon(QtGui.QIcon(rqt_icon_path))
54
55 self.action_rqt_console = QtGui.QAction(QtGui.QIcon.fromTheme('mail-message-new'),
56 "&Console", self,
57 statusTip='"<p>Starts a python GUI plugin for displaying and filtering '
58 'ROS log messages that is connected to the selected master.</p>"',
59 triggered=self.on_show_console_clicked)
60 self.addAction(self.action_rqt_console)
61 self.action_rqt_logger_level = QtGui.QAction(QtGui.QIcon.fromTheme('format-indent-more'),
62 "&Logger Level", self,
63 statusTip='"<p>Starts a python GUI plugin for configuring the level of '
64 'ROS loggers that is connected to the selected master.</p>"',
65 triggered=self.on_show_logger_level_clicked)
66 self.addAction(self.action_rqt_logger_level)
67 self.action_rqt_tf_tree = QtGui.QAction(QtGui.QIcon.fromTheme('preferences-system-network'),
68 "&TF Tree", self,
69 statusTip='"<p>Starts a python GUI plugin for visualizing the TF tree'
70 'that is connected to the selected master.</p>"',
71 triggered=self.on_show_tf_tree_clicked)
72 self.addAction(self.action_rqt_tf_tree)
73 self.action_rqt_ros_graph = QtGui.QAction(QtGui.QIcon(":/icons/button_graph.png"),
74 "Ros &Graph", self,
75 statusTip='"<p>Starts a python GUI plugin for visualizing the ROS computation graph'
76 'that is connected to the selected master</p>"',
77 triggered=self.on_show_ros_graph_clicked)
78 self.addAction(self.action_rqt_ros_graph)
79 self.action_rqt_rviz = QtGui.QAction(QtGui.QIcon.fromTheme('image-x-generic'),
80 "R&Viz", self,
81 statusTip='"<p>Starts RViz</p>"',
82 triggered=self.on_show_rviz_clicked)
83 self.addAction(self.action_rqt_rviz)
84 self.addSeparator()
85 self.action_rqt = QtGui.QAction(QtGui.QIcon(rqt_icon_path),
86 "&Rqt GUI", self,
87 statusTip='"<p>Start the rqt GUI'
88 'that is connected to the selected master</p>"',
89 triggered=self.on_start_rqt_clicked)
90 self.addAction(self.action_rqt)
91 menu_button.setMenu(self)
92 except Exception as e:
93 print '%s'%e
94 menu_button.setEnabled(False)
95 menu_button.setToolTip('rqt_gui not found! Please install rqt to use its plugins!')
96
99
102
105
108
111
114