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