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 rospy
37 import roslib
38 import node_manager_fkie as nm
39
41 '''
42 This creates a menu to start a several rqt plugins.
43 '''
44 start_rqt_plugin_signal = QtCore.Signal(str, str)
45 '''
46 The start_rqt_plugin_signal is emitted to start a rqt plugin (Name, Plugin).
47 The Plugin can be empty, in this case the RQT itself will be start.
48 '''
50 QtGui.QMenu.__init__(self)
51 self.button = menu_button
52 try:
53 rqt_icon_path = roslib.packages.find_resource('rqt_gui', 'rqt.png').pop()
54 menu_button.setText('')
55 menu_button.setIcon(QtGui.QIcon(rqt_icon_path))
56
57 self.action_rqt_console = QtGui.QAction(QtGui.QIcon.fromTheme('mail-message-new'),
58 "&Console", self,
59 statusTip='"<p>Starts a python GUI plugin for displaying and filtering '
60 'ROS log messages that is connected to the selected master.</p>"',
61 triggered=self.on_show_console_clicked)
62 self.addAction(self.action_rqt_console)
63 self.action_rqt_logger_level = QtGui.QAction(QtGui.QIcon.fromTheme('format-indent-more'),
64 "&Logger Level", self,
65 statusTip='"<p>Starts a python GUI plugin for configuring the level of '
66 'ROS loggers that is connected to the selected master.</p>"',
67 triggered=self.on_show_logger_level_clicked)
68 self.addAction(self.action_rqt_logger_level)
69 self.action_rqt_tf_tree = QtGui.QAction(QtGui.QIcon.fromTheme('preferences-system-network'),
70 "&TF Tree", self,
71 statusTip='"<p>Starts a python GUI plugin for visualizing the TF tree'
72 'that is connected to the selected master.</p>"',
73 triggered=self.on_show_tf_tree_clicked)
74 self.addAction(self.action_rqt_tf_tree)
75 self.action_rqt_ros_graph = QtGui.QAction(QtGui.QIcon(":/icons/button_graph.png"),
76 "Ros &Graph", self,
77 statusTip='"<p>Starts a python GUI plugin for visualizing the ROS computation graph'
78 'that is connected to the selected master</p>"',
79 triggered=self.on_show_ros_graph_clicked)
80 self.addAction(self.action_rqt_ros_graph)
81 self.addSeparator()
82 self.action_rqt = QtGui.QAction(QtGui.QIcon(rqt_icon_path),
83 "&Rqt GUI", self,
84 statusTip='"<p>Start the rqt GUI'
85 'that is connected to the selected master</p>"',
86 triggered=self.on_start_rqt_clicked)
87 self.addAction(self.action_rqt)
88 menu_button.setMenu(self)
89 except Exception as e:
90 print '%s'%e
91 menu_button.setEnabled(False)
92 menu_button.setToolTip('rqt_gui not found! Please install rqt to use its plugins!')
93
96
99
102
105
108