37 from python_qt_binding.QtCore
import qDebug, Qt, Signal
38 from python_qt_binding.QtWidgets
import QMessageBox
48 _master_found_signal = Signal(int)
51 super(RosPyPluginProvider, self).
__init__(
53 self.setObjectName(
'RosPyPluginProvider')
58 def load(self, plugin_id, plugin_context):
61 return super(RosPyPluginProvider, self).
load(plugin_id, plugin_context)
66 rospy.get_master().getSystemState()
72 self._wait_for_master_thread.start()
75 self.tr(
'Waiting for ROS master'),
77 "Could not find ROS master. Either start a 'roscore' or abort loading the plugin."),
80 self._master_found_signal.connect(self._wait_for_master_dialog.done, Qt.QueuedConnection)
81 button = self._wait_for_master_dialog.exec_()
83 no_master = button != QMessageBox.Ok
84 self._wait_for_master_dialog.deleteLater()
87 raise PluginLoadError(
'RosPyPluginProvider._init_node() could not find ROS master')
95 rospy.get_master().getSystemState()
98 self._master_found_signal.emit(QMessageBox.Ok)
104 name =
'rqt_gui_py_node_%d' % os.getpid()
105 qDebug(
'RosPyPluginProvider._init_node() initialize ROS node "%s"' % name)
106 rospy.init_node(name, disable_signals=
True)
def _wait_for_master(self)
def load(self, plugin_id, plugin_context)
def _check_for_master(self)