예제 #1
0
class MoveitPlugin(Plugin):

    def __init__(self, plugin_context):
        super(MoveitPlugin, self).__init__(plugin_context)
        self._plugin_context = plugin_context

        self._moveit_widget = MoveitWidget(self, plugin_context)
        self.mainwidget = PluginContainerWidget(self._moveit_widget,
                                                 True, False)

        if self._plugin_context.serial_number() > 1:
            self.mainwidget.setWindowTitle(self.mainwidget.windowTitle() +
                                   (' (%d)' % plugin_context.serial_number()))

        plugin_context.add_widget(self.mainwidget)

    def get_widget(self):
        return self.mainwidget

    def shutdown_plugin(self):
        self.mainwidget.shutdown()

    def save_settings(self, plugin_settings, instance_settings):
        self.mainwidget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self.mainwidget.restore_settings(plugin_settings, instance_settings)

    def _update_msg(self):
        """
        Update necessary components (per topic) regularly
        """
        self._moveit_widget.update_topic_table()
class ParamPlugin(Plugin):

    def __init__(self, context):
        """
        :type context: qt_gui.PluginContext
        """

        super(ParamPlugin, self).__init__(context)
        self.setObjectName('Dynamic Reconfigure')

        self._plugin_widget = ParamWidget(context)
        self._widget = PluginContainerWidget(self._plugin_widget, True, False)
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)

    def shutdown_plugin(self):
        self._widget.shutdown()

    def save_settings(self, plugin_settings, instance_settings):
        self._widget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._widget.restore_settings(plugin_settings, instance_settings)

    @staticmethod
    def add_arguments(parser):
        group = parser.add_argument_group('Options for rqt_reconfigure plugin')
        group.add_argument('node_name', nargs='*', default=[], help='Node(s) to open automatically')
class ParamPlugin(Plugin):

    def __init__(self, context):
        """
        :type context: qt_gui.PluginContext
        """

        super(ParamPlugin, self).__init__(context)
        self.setObjectName('Dynamic Reconfigure')

        self._plugin_widget = ParamWidget(context)
        self._widget = PluginContainerWidget(self._plugin_widget, True, False)
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)

    def shutdown_plugin(self):
        self._widget.shutdown()

    def save_settings(self, plugin_settings, instance_settings):
        self._widget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._widget.restore_settings(plugin_settings, instance_settings)
예제 #4
0
    def __init__(self, plugin_context):
        super(MoveitPlugin, self).__init__(plugin_context)
        self._plugin_context = plugin_context

        self._moveit_widget = MoveitWidget(self, plugin_context)
        self.mainwidget = PluginContainerWidget(self._moveit_widget,
                                                 True, False)

        if self._plugin_context.serial_number() > 1:
            self.mainwidget.setWindowTitle(self.mainwidget.windowTitle() +
                                   (' (%d)' % plugin_context.serial_number()))

        plugin_context.add_widget(self.mainwidget)
예제 #5
0
    def __init__(self, context):
        """
        :type context: qt_gui.PluginContext
        """

        super(ParamPlugin, self).__init__(context)
        self.setObjectName('Dynamic Reconfigure')

        self._plugin_widget = ParamWidget(context)
        self._widget = PluginContainerWidget(self._plugin_widget, True, False)
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)
예제 #6
0
    def __init__(self, plugin_context):
        super(LaunchMain, self).__init__()
        self._plugin_context = plugin_context

        self._main_launch_widget = LaunchWidget(self)
        self._mainwidget = PluginContainerWidget(self._main_launch_widget,
                                                 True, False)

        self._run_id = None
        self._node_controllers = []
예제 #7
0
class LaunchMain(object):
    def __init__(self, plugin_context):
        super(LaunchMain, self).__init__()
        self._plugin_context = plugin_context

        _main_launch_widget = LaunchWidget(self)
        self._mainwidget = PluginContainerWidget(_main_launch_widget, True,
                                                 False)

        self._run_id = None
        self._node_controllers = []

        #RqtRoscommUtil.load_parameters(self._config, '/rqt_launch')

    def get_widget(self):
        return self._mainwidget

    def set_node_controllers(self, node_controllers):
        self._node_controllers = node_controllers

    def start_all(self):
        rospy.loginfo("Starting all nodes")
        for n in self._node_controllers:
            n.start(restart=False)

    def stop_all(self):
        for n in self._node_controllers:
            n.stop()

    def check_process_statuses(self):
        for n in self._node_controllers:
            n.check_process_status()

    def shutdown(self):
        rospy.logdebug('Launchmain.shutdown')
        self.stop_all()

    def save_settings(self, plugin_settings, instance_settings):
        self._mainwidget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._mainwidget.restore_settings(plugin_settings, instance_settings)
예제 #8
0
    def __init__(self, context):
        super(Topic, self).__init__(context)
        self.setObjectName('Topic')

        self._widget = TopicWidget(self)

        self.mainwidget = PluginContainerWidget(self._widget, True, False)

        self._widget.start()
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)
    def __init__(self, context):
        super(ControllerManagerGUI, self).__init__(context)
        self.setObjectName('controller_manager_gui')

        self.widget = ControllerManagerWidget(self)

        self.main_widget = PluginContainerWidget(self.widget, True, False)

        self.widget.start()
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self.widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self.widget)
예제 #10
0
    def __init__(self, plugin_context):
        super(MoveitPlugin, self).__init__(plugin_context)
        self._plugin_context = plugin_context

        self._moveit_widget = MoveitWidget(self, plugin_context)
        self.mainwidget = PluginContainerWidget(self._moveit_widget,
                                                 True, False)

        if self._plugin_context.serial_number() > 1:
            self.mainwidget.setWindowTitle(self.mainwidget.windowTitle() +
                                   (' (%d)' % plugin_context.serial_number()))

        plugin_context.add_widget(self.mainwidget)
예제 #11
0
    def __init__(self, context):
        """
        :type context: qt_gui.PluginContext
        """

        super(ParamPlugin, self).__init__(context)
        self.setObjectName('Dynamic Reconfigure')

        self._plugin_widget = ParamWidget(context)
        self._widget = PluginContainerWidget(self._plugin_widget, True, False)
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)
예제 #12
0
 def __init__(self, context):
     super(EzPublisherPlugin, self).__init__(context)
     self.setObjectName('EzPublisher')
     modules = [quaternion_module.QuaternionModule()]
     self._widget = ez_publisher_widget.EzPublisherWidget(modules=modules)
     self._widget.setObjectName('EzPublisherPluginUi')
     self.mainwidget = PluginContainerWidget(self._widget, True, False)
     if context.serial_number() > 1:
         self._widget.setWindowTitle(self._widget.windowTitle() +
                                     (' (%d)' % context.serial_number()))
     context.add_widget(self._widget)
     from argparse import ArgumentParser
     parser = ArgumentParser(prog='rqt_ez_publisher')
     EzPublisherPlugin.add_arguments(parser)
     args, unknowns = parser.parse_known_args(context.argv())
     self._loaded_settings = None
     if args.slider_file is not None:
         self.load_from_file(args.slider_file)
예제 #13
0
class ParamPlugin(Plugin):
    def __init__(self, context):
        """
        :type context: qt_gui.PluginContext
        """

        super(ParamPlugin, self).__init__(context)
        self.setObjectName('Dynamic Reconfigure')

        self._plugin_widget = ParamWidget(context)
        self._widget = PluginContainerWidget(self._plugin_widget, True, False)
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)

    def shutdown_plugin(self):
        self._widget.shutdown()

    def save_settings(self, plugin_settings, instance_settings):
        self._widget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._widget.restore_settings(plugin_settings, instance_settings)
예제 #14
0
class LaunchMain(object):
    def __init__(self, plugin_context):
        super(LaunchMain, self).__init__()
        self._plugin_context = plugin_context

        self._main_launch_widget = LaunchWidget(self)
        self._mainwidget = PluginContainerWidget(self._main_launch_widget,
                                                 True, False)

        self._run_id = None
        self._node_controllers = []

        #RqtRoscommUtil.load_parameters(self._config, '/rqt_launch')

    def get_widget(self):
        return self._mainwidget

    def set_node_controllers(self, node_controllers):
        self._node_controllers = node_controllers

    def start_all(self):
        '''
        Checks nodes that's set (via self.set_node_controllers) one by one and
        starts one if each node is not running. 
        Then disable START ALL button and enable STOP ALL button.
        '''
        for n in self._node_controllers:
            if not n.is_node_running():
                n.start(restart=False)

        # Disable START ALL button.
        self._main_launch_widget._pushbutton_start_all.setEnabled(False)
        self._main_launch_widget._pushbutton_stop_all.setEnabled(True)

    def stop_all(self):
        '''
        Checks nodes that's set (via self.set_node_controllers) one by one and
        stops one if each node is running.
        Then enable START ALL button and disable STOP ALL button.
        '''
        for n in self._node_controllers:
            if n.is_node_running():
                n.stop()

        # Disable STOP ALL button.
        self._main_launch_widget._pushbutton_start_all.setEnabled(True)
        self._main_launch_widget._pushbutton_stop_all.setEnabled(False)

    def check_process_statuses(self):
        for n in self._node_controllers:
            n.check_process_status()

    def shutdown(self):
        rospy.logdebug('Launchmain.shutdown')
        self.stop_all()

    def save_settings(self, plugin_settings, instance_settings):
        self._mainwidget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._mainwidget.restore_settings(plugin_settings, instance_settings)
예제 #15
0
class LaunchMain(object):
    def __init__(self, plugin_context):
        super(LaunchMain, self).__init__()
        print 'sfdfdsfsdfds'
        self._plugin_context = plugin_context

        self._main_launch_widget = LaunchWidget(self)
        self._mainwidget = PluginContainerWidget(self._main_launch_widget,
                                                 True, False)

        self._run_id = None
        self._node_controllers = []
        self._config = None

        #RqtRoscommUtil.load_parameters(self._config, '/rqt_launch')

    def get_widget(self):
        return self._mainwidget

    def set_node_controllers(self, node_controllers):
        self._node_controllers = node_controllers

    def set_config(self, config):
        self._config = config

    def start_all(self):
        '''
        Checks nodes that's set (via self.set_node_controllers) one by one and
        starts one if each node is not running.
        Then disable START ALL button and enable STOP ALL button.
        '''

        pat = re.compile(r'.*=(.*)')
        if self._config:
            for k in self._config.params.keys():
                s = str(self._config.params[k])
                result = re.match(pat, s)

                if result:
                    val = result.groups()[0]

                    if is_int(val):
                        rospy.set_param(k, int(val))
                    elif is_float(val):
                        rospy.set_param(k, float(val))
                    else:
                        rospy.set_param(k, val)


        for n in self._node_controllers:
            if not n.is_node_running():
                n.start(restart=False)

        # Disable START ALL button.
        self._main_launch_widget._pushbutton_start_all.setEnabled(False)
        self._main_launch_widget._pushbutton_stop_all.setEnabled(True)

    def stop_all(self):
        '''
        Checks nodes that's set (via self.set_node_controllers) one by one and
        stops one if each node is running.
        Then enable START ALL button and disable STOP ALL button.
        '''

        for n in self._node_controllers:
            if n.is_node_running():
                n.stop()

        # Disable STOP ALL button.
        self._main_launch_widget._pushbutton_start_all.setEnabled(True)
        self._main_launch_widget._pushbutton_stop_all.setEnabled(False)

    def check_process_statuses(self):
        for n in self._node_controllers:
            n.check_process_status()

    def shutdown(self):
        rospy.logdebug('Launchmain.shutdown')
        self.stop_all()

    def save_settings(self, plugin_settings, instance_settings):
        self._mainwidget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._mainwidget.restore_settings(plugin_settings, instance_settings)
예제 #16
0
class LaunchMain(object):
    def __init__(self, plugin_context):
        super(LaunchMain, self).__init__()
        print 'sfdfdsfsdfds'
        self._plugin_context = plugin_context

        self._main_launch_widget = LaunchWidget(self)
        self._mainwidget = PluginContainerWidget(self._main_launch_widget,
                                                 True, False)

        self._run_id = None
        self._node_controllers = []
        self._config = None

        #RqtRoscommUtil.load_parameters(self._config, '/rqt_launch')

    def get_widget(self):
        return self._mainwidget

    def set_node_controllers(self, node_controllers):
        self._node_controllers = node_controllers

    def set_config(self, config):
        self._config = config

    def start_all(self):
        '''
        Checks nodes that's set (via self.set_node_controllers) one by one and
        starts one if each node is not running.
        Then disable START ALL button and enable STOP ALL button.
        '''

        pat = re.compile(r'.*=(.*)')
        if self._config:
            for k in self._config.params.keys():
                s = str(self._config.params[k])
                result = re.match(pat, s)

                if result:
                    val = result.groups()[0]

                    if is_int(val):
                        rospy.set_param(k, int(val))
                    elif is_float(val):
                        rospy.set_param(k, float(val))
                    else:
                        rospy.set_param(k, val)

        for n in self._node_controllers:
            if not n.is_node_running():
                n.start(restart=False)

        # Disable START ALL button.
        self._main_launch_widget._pushbutton_start_all.setEnabled(False)
        self._main_launch_widget._pushbutton_stop_all.setEnabled(True)

    def stop_all(self):
        '''
        Checks nodes that's set (via self.set_node_controllers) one by one and
        stops one if each node is running.
        Then enable START ALL button and disable STOP ALL button.
        '''

        for n in self._node_controllers:
            if n.is_node_running():
                n.stop()

        # Disable STOP ALL button.
        self._main_launch_widget._pushbutton_start_all.setEnabled(True)
        self._main_launch_widget._pushbutton_stop_all.setEnabled(False)

    def check_process_statuses(self):
        for n in self._node_controllers:
            n.check_process_status()

    def shutdown(self):
        rospy.logdebug('Launchmain.shutdown')
        self.stop_all()

    def save_settings(self, plugin_settings, instance_settings):
        self._mainwidget.save_settings(plugin_settings, instance_settings)

    def restore_settings(self, plugin_settings, instance_settings):
        self._mainwidget.restore_settings(plugin_settings, instance_settings)