Exemplo n.º 1
0
 def __init__(self):
     QObject.__init__(self)
     self.setObjectName('ParameterHandler')
     self.__requestListThreads = []
     self.__requestValuesThreads = []
     self.__deliveryThreads = []
     self._lock = threading.RLock()
Exemplo n.º 2
0
 def __init__(self):
     QObject.__init__(self)
     self.file_watcher = QFileSystemWatcher()
     self.file_watcher.fileChanged.connect(self.on_file_changed)
     self.changed = {}
     self.launches = {}
     self.binaries = {}
Exemplo n.º 3
0
 def __init__(self, args, bufsize=0, executable=None, stdin=None, stdout=None,
              stderr=subprocess.PIPE, preexec_fn=None, close_fds=False,
              shell=False, cwd=None, env=None, universal_newlines=False,
              startupinfo=None, creationflags=0, object_id='', description=''):
     '''
     For arguments see https://docs.python.org/2/library/subprocess.html
     Additional arguments:
     :param object_id: the identification string of this object and title of the
     error message dialog
     :type object_id: str
     :param description: the description string used as addiotional information
     in dialog if an error was occured
     :type description: str
     '''
     try:
         QObject.__init__(self)
         self._args = args
         self._object_id = object_id
         self._description = description
         self.error.connect(self.on_error)
         # wait for process to avoid 'defunct' processes
         self.popen = subprocess.Popen(args=args, bufsize=bufsize, executable=executable, stdin=stdin, stdout=stdout,
                                       stderr=stderr, preexec_fn=preexec_fn, close_fds=close_fds, shell=shell, cwd=cwd, env=env,
                                       universal_newlines=universal_newlines, startupinfo=startupinfo, creationflags=creationflags)
         thread = threading.Thread(target=self._supervise)
         thread.setDaemon(True)
         thread.start()
     except Exception as _:
         raise
Exemplo n.º 4
0
 def __init__(self, service_uri, service, delay_exec=0.0, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._service_uri = service_uri
     self._service = service
     self._delay_exec = delay_exec
     self.setDaemon(True)
Exemplo n.º 5
0
 def __init__(self, launch_file, package=None, masteruri=None, argv=[]):
     '''
     Creates the LaunchConfig object. The launch file will be not loaded on
     creation, first on request of Roscfg value.
     @param launch_file: The absolute or relative path with the launch file.
                        By using relative path a package must be valid for
                        remote launches.
     @type launch_file: C{str}
     @param package:  the package containing the launch file. If None the
                     launch_file will be used to determine the launch file.
                     No remote launches a possible without a valid package.
     @type package: C{str} or C{None}
     @param masteruri: The URL of the ROS master.
     @type masteruri: C{str} or C{None}
     @param argv: the list the arguments needed for loading the given launch file
     @type argv: C{[str]}
     @raise roslaunch.XmlParseException: if the launch file can't be found.
     '''
     QObject.__init__(self)
     self.__launchFile = launch_file
     self.__package = package_name(os.path.dirname(
         self.__launchFile))[0] if package is None else package
     self.__masteruri = masteruri if masteruri is not None else 'localhost'
     self.__roscfg = None
     self.argv = argv
     self.__reqTested = False
     self.__argv_values = dict()
     self.global_param_done = [
     ]  # masteruri's where the global parameters are registered
     self.hostname = get_hostname(self.__masteruri)
     self.__launch_id = '%.9f' % time.time()
     nm.filewatcher().add_launch(self.__masteruri, self.__launchFile,
                                 self.__launch_id, [self.__launchFile])
Exemplo n.º 6
0
 def __init__(self, masteruri, wait, check_host=True, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._masteruri = masteruri
     self._wait = wait
     self._check_host = check_host
     self.setDaemon(True)
 def __init__(self, args, bufsize=0, executable=None, stdin=None, stdout=None,
              stderr=subprocess.PIPE, preexec_fn=None, close_fds=False,
              shell=False, cwd=None, env=None, universal_newlines=False,
              startupinfo=None, creationflags=0, object_id='', description=''):
     '''
     For arguments see https://docs.python.org/2/library/subprocess.html
     Additional arguments:
     :param object_id: the identification string of this object and title of the
     error message dialog
     :type object_id: str
     :param description: the description string used as addiotional information
     in dialog if an error was occured
     :type description: str
     '''
     try:
         QObject.__init__(self)
         self._args = args
         self._object_id = object_id
         self._description = description
         self.error.connect(self.on_error)
         # wait for process to avoid 'defunct' processes
         self.popen = subprocess.Popen(args=args, bufsize=bufsize, executable=executable, stdin=stdin, stdout=stdout,
                                       stderr=stderr, preexec_fn=preexec_fn, close_fds=close_fds, shell=shell, cwd=cwd, env=env,
                                       universal_newlines=universal_newlines, startupinfo=startupinfo, creationflags=creationflags)
         thread = threading.Thread(target=self._supervise)
         thread.setDaemon(True)
         thread.start()
     except Exception as _:
         raise
Exemplo n.º 8
0
 def __init__(self, subsystem, settings, authority=205):
     QObject.__init__(self)
     self._subsystem = subsystem
     self._settings = settings
     self._authority = authority
     ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                            'robot.ui')
     self._widget = QWidget()
     loadUi(ui_file, self._widget)
     self._last_update = rospy.Time.now()
     self._component_names = dict()
     self._warnings = []
     self._feedback_warnings = dict()
     self._ocu_client = None
     self._warning_dialog = self._create_warning_dialog()
     self._detailed_dialog = self._create_detailed_dialog()
     self.handoff_dialog = HandoffDialog(self.name, self.subsystem_id,
                                         self._settings, self._widget)
     self.handoff_dialog.button_blink.connect(
         self._widget.button_handoff.setEnabled)
     self._widget.button_view.clicked.connect(self._on_robot_view)
     self._widget.button_control.setText(
         "%s - %d" %
         (subsystem.ident.name, self._subsystem.ident.address.subsystem_id))
     self._widget.button_control.clicked.connect(self._on_robot_control)
     self._widget.button_control.setObjectName(subsystem.ident.name)
     self._widget.button_handoff.setEnabled(False)
     self._widget.button_handoff.clicked.connect(self.on_show_handoff)
     self._widget.button_warnings.setEnabled(False)
     self._widget.button_warnings.clicked.connect(self.on_show_warnings)
     self._widget.button_details.clicked.connect(self.on_show_details)
Exemplo n.º 9
0
 def __init__(self, subsystem_id, node_id, caller_ns):
     '''
     :param caller_ns: the namespace of the client used to create handoff topics
     '''
     QObject.__init__(self)
     jaus_address = JausAddress(subsystem_id, node_id, 0)
     self._address = Address(jaus_address)
     self._subsystem_restricted = 65535
     self._only_monitor = False
     self._ocu_nodes = dict()  # address of ocu client : services
     self._warnings = dict(
     )  # address of ocu client : list of services with warnings
     self._ins_autorithy = dict(
     )  # address of ocu client : list of services with INSUFFICIENT_AUTHORITY
     self._has_control_access = False
     self.handoff_supported = True
     self.control_subsystem = -1  # this value is set by robot.py
     self._topic_handoff_own_request = '%shandoff_own_request' % caller_ns
     self._topic_handoff_own_response = '%shandoff_own_response' % caller_ns
     self._topic_handoff_remote_request = '%shandoff_remote_request' % caller_ns
     self._topic_handoff_remote_response = '%shandoff_remote_response' % caller_ns
     self._pub_handoff_own_request = rospy.Publisher(
         self._topic_handoff_own_request, HandoffRequest, queue_size=10)
     self._pub_handoff_own_response = rospy.Publisher(
         self._topic_handoff_own_response, HandoffResponse, queue_size=10)
     self._sub_handoff_remote_request = rospy.Subscriber(
         self._topic_handoff_remote_request,
         HandoffRequest,
         self._callback_handoff_remote_request,
         queue_size=10)
     self._sub_handoff_remote_response = rospy.Subscriber(
         self._topic_handoff_remote_response,
         HandoffResponse,
         self._callback_handoff_remote_response,
         queue_size=10)
Exemplo n.º 10
0
 def __init__(self):
     '''
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._interfaces_files = None
     self.setDaemon(True)
Exemplo n.º 11
0
 def __init__(self):
     QObject.__init__(self)
     self.setObjectName('ParameterHandler')
     self.__requestListThreads = []
     self.__requestValuesThreads = []
     self.__deliveryThreads = []
     self._lock = threading.RLock()
Exemplo n.º 12
0
 def __init__(self):
     '''
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._interfaces_files = None
     self.setDaemon(True)
Exemplo n.º 13
0
 def __init__(self, launch_file, package=None, masteruri=None, argv=[]):
     '''
     Creates the LaunchConfig object. The launch file will be not loaded on
     creation, first on request of Roscfg value.
     @param launch_file: The absolute or relative path with the launch file.
                        By using relative path a package must be valid for
                        remote launches.
     @type launch_file: C{str}
     @param package:  the package containing the launch file. If None the
                     launch_file will be used to determine the launch file.
                     No remote launches a possible without a valid package.
     @type package: C{str} or C{None}
     @param masteruri: The URL of the ROS master.
     @type masteruri: C{str} or C{None}
     @param argv: the list the arguments needed for loading the given launch file
     @type argv: C{[str]}
     @raise roslaunch.XmlParseException: if the launch file can't be found.
     '''
     QObject.__init__(self)
     self.__launchFile = launch_file
     self.__package = package_name(os.path.dirname(self.__launchFile))[0] if package is None else package
     self.__masteruri = masteruri if masteruri is not None else 'localhost'
     self.__roscfg = None
     self.argv = argv
     self.__reqTested = False
     self.__argv_values = dict()
     self.global_param_done = []  # masteruri's where the global parameters are registered
     self.hostname = nm.nameres().getHostname(self.__masteruri)
     self.__launch_id = '%.9f' % time.time()
     nm.file_watcher().add_launch(self.__masteruri, self.__launchFile, self.__launch_id, [self.__launchFile])
Exemplo n.º 14
0
 def __init__(self):
     QObject.__init__(self)
     self.file_watcher = QFileSystemWatcher()
     self.file_watcher.fileChanged.connect(self.on_file_changed)
     self.changed = {}
     self.launches = {}
     self.binaries = {}
Exemplo n.º 15
0
 def __init__(self, package, grpc_url, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._grpc_url = grpc_url
     self._package = package
     self.setDaemon(True)
     self._canceled = False
     self._result = {}
Exemplo n.º 16
0
 def __init__(self, parent=None):
     QObject.__init__(self, parent)
     self.children = []
     self.active_members = []
     self.format = 'long'
     self.command_text = ''
     self.last_index =  0.0
     self.html = ''
Exemplo n.º 17
0
 def __init__(self, ident, descr='', target=None, args=()):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._id = ident
     self.descr = descr
     self._target = target
     self._args = args
     self.setDaemon(True)
Exemplo n.º 18
0
 def __init__(self, ident, descr='', target=None, args=()):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._id = ident
     self.descr = descr
     self._target = target
     self._args = args
     self.setDaemon(True)
Exemplo n.º 19
0
 def __init__(self, progress_frame, progress_bar, progress_cancel_button, name=''):
     QObject.__init__(self)
     self.__progress_queue = []
     self.__running = False
     self._name = name
     self._progress_frame = progress_frame
     self._progress_bar = progress_bar
     self._progress_cancel_button = progress_cancel_button
     progress_frame.setVisible(False)
     progress_cancel_button.clicked.connect(self._on_progress_canceled)
Exemplo n.º 20
0
    def __init__(self, current_path, root_path):
        '''
        :param root_path: the open root file
        :type root_path: str
        '''
        QObject.__init__(self)
        threading.Thread.__init__(self)
        self.setDaemon(True)
#        self.current_path = current_path
        self.root_path = root_path
Exemplo n.º 21
0
 def __init__(self, progress_frame, progress_bar, progress_cancel_button):
     QObject.__init__(self)
     self.__ignore_err_list = []
     self.__progress_queue = []
     self.__running = False
     self._progress_frame = progress_frame
     self._progress_bar = progress_bar
     self._progress_cancel_button = progress_cancel_button
     progress_frame.setVisible(False)
     progress_cancel_button.clicked.connect(self._on_progress_canceled)
Exemplo n.º 22
0
 def __init__(self, monitoruri, masteruri, delayed_exec=0., parent=None):
     '''
     :param str masteruri: the URI of the remote ROS master
     :param str monitoruri: the URI of the monitor RPC interface of the master_discovery node
     :param float delayed_exec: Delay the execution of the request for given seconds.
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._monitoruri = monitoruri
     self._masteruri = masteruri
     self._delayed_exec = delayed_exec
     self.setDaemon(True)
Exemplo n.º 23
0
 def __init__(self, masteruri, params, parent=None):
     '''
     @param masteruri: The URI of the ROS parameter server
     @type masteruri: C{str}
     @param params: The dictinary the parameter name and their value, see U{http://www.ros.org/wiki/ROS/Parameter%20Server%20API#setParam}
     @type params: C{dict(str: value)}
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._masteruri = masteruri
     self._params = params
     self.setDaemon(True)
Exemplo n.º 24
0
 def __init__(self, current_path, root_path):
     '''
     :param root_path: the open root file
     :type root_path: str
     :param current_path: current shown file
     :type current_path: str
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self.setDaemon(True)
     self.current_path = current_path
     self.root_path = root_path
Exemplo n.º 25
0
 def __init__(self, masteruri, params, parent=None):
     '''
     @param masteruri: The URI of the ROS parameter server
     @type masteruri: C{str}
     @param params: The dictinary the parameter name and their value, see U{http://www.ros.org/wiki/ROS/Parameter%20Server%20API#setParam}
     @type params: C{dict(str: value)}
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._masteruri = masteruri
     self._params = params
     self.setDaemon(True)
Exemplo n.º 26
0
    def __init__(self, master):
        QObject.__init__(self)
        self.name = master.name
        self._master = master
        self._syncronized = MasterSyncButtonHelper.NOT_SYNC
        self.ICONS = {MasterSyncButtonHelper.SYNC: QIcon(":/icons/%s_sync.png" % self.ICON_PREFIX),
                      MasterSyncButtonHelper.NOT_SYNC: QIcon(":/icons/%s_not_sync.png" % self.ICON_PREFIX),
                      MasterSyncButtonHelper.SWITCHED: QIcon(":/icons/%s_start_sync.png" % self.ICON_PREFIX)}
        self.widget = QPushButton()
#    self.widget.setFlat(True)
        self.widget.setIcon(self.ICONS[MasterSyncButtonHelper.NOT_SYNC])
        self.widget.setMaximumSize(48, 48)
        self.widget.setCheckable(True)
        self.widget.clicked.connect(self.on_sync_clicked)
Exemplo n.º 27
0
    def __init__(self, master):
        QObject.__init__(self)
        self.name = master.name
        self._master = master
        self._syncronized = MasterSyncButtonHelper.NOT_SYNC
        self.ICONS = {MasterSyncButtonHelper.SYNC: nm.settings().icon("%s_sync.png" % self.ICON_PREFIX),
                      MasterSyncButtonHelper.NOT_SYNC: nm.settings().icon("%s_not_sync.png" % self.ICON_PREFIX),
                      MasterSyncButtonHelper.SWITCHED: nm.settings().icon("%s_start_sync.png" % self.ICON_PREFIX)}
        self.widget = QPushButton()
#    self.widget.setFlat(True)
        self.widget.setIcon(self.ICONS[MasterSyncButtonHelper.NOT_SYNC])
        self.widget.setMaximumSize(48, 48)
        self.widget.setCheckable(True)
        self.widget.clicked.connect(self.on_sync_clicked)
Exemplo n.º 28
0
 def __init__(self, nodename, masteruri, layout, parent=None):
     '''
     Creates a new item.
     '''
     QObject.__init__(self, parent)
     self.setObjectName("LoggerHandler")
     self.nodename = nodename
     self.masteruri = masteruri
     self._logger_items = {}  # logger name: LoggerItem
     self.layout = layout
     self._change_all_cancel = False
     self.loggers_signal.connect(self._handle_loggers)
     self._thread_update = None
     self._thread_set_all = None
Exemplo n.º 29
0
 def __init__(self, monitoruri, masteruri, delayed_exec=0., parent=None):
     '''
     @param masteruri: the URI of the remote ROS master
     @type masteruri: C{str}
     @param monitoruri: the URI of the monitor RPC interface of the master_discovery node
     @type monitoruri: C{str}
     @param delayed_exec: Delay the execution of the request for given seconds.
     @type delayed_exec: C{float}
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._monitoruri = monitoruri
     self._masteruri = masteruri
     self._delayed_exec = delayed_exec
     self.setDaemon(True)
Exemplo n.º 30
0
 def __init__(self, nodename, masteruri, loggers, newlevel):
     '''
     :param str nodename: the name of the node
     :param str masteruri: the master where the service is registered
     :param list logger: list with tuple of (logger and current level)
     :param str newlevel: new log level
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._nodename = nodename
     self._masteruri = masteruri
     self._loggers = loggers
     self._newlevel = newlevel
     self._cancel = False
     self.setDaemon(True)
 def __init__(self, nodename, masteruri, layout, parent=None):
     '''
     Creates a new item.
     '''
     QObject.__init__(self, parent)
     self.setObjectName("LoggerHandler")
     self.nodename = nodename
     self.masteruri = masteruri
     self._filter = QRegExp('', Qt.CaseInsensitive, QRegExp.Wildcard)
     self._logger_items = {}  # logger name: LoggerItem
     self.layout = layout
     self._change_all_cancel = False
     self._stored_values = {}
     self.loggers_signal.connect(self._handle_loggers)
     self._thread_update = None
     self._thread_set_all = None
Exemplo n.º 32
0
 def __init__(self, search_text, path, is_regex=False, path_text={}, recursive=False, only_launch=False, count_results=0):
     '''
     :param str search_text: text to search for
     :param str path: initial file path
     :param bool is_regex: is the search_text a regular expressions
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._search_text = search_text
     self._path = path
     self._path_text = path_text
     self._recursive = recursive
     self._only_launch = only_launch
     self._found = 0
     self._count_results = count_results
     self._isrunning = True
     self.setDaemon(True)
Exemplo n.º 33
0
 def __init__(self, search_text, path, is_regex=False, path_text={}, recursive=False):
     '''
     :param search_text: text to search for
     :type search_text: str
     :param path: initial file path
     :type path: str
     .param is_regex: is the search_text a regular expressions
     :type is_regex: bool
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._search_text = search_text
     self._path = path
     self._path_text = path_text
     self._recursive = recursive
     self._isrunning = True
     self.setDaemon(True)
Exemplo n.º 34
0
 def __init__(self, launch_file, mtime=0, includes={}, args={}, nodes=[]):
     '''
     Creates the LaunchConfig object. Store the informations get from
     node manager daemon.
     :param str launch_file: grpc path to the lauch file
     :param double mtime:  modification time of the launch file used to detect changes.
     :param includes: a dictionary with included files and their modification time stamps.
     :type includes: {str: double}
     :param args: a dictionary with arguments used to load launch file.
     :type args: {str: str}
     :param nodes: a list with node names.
     :type nodes: [str]
     '''
     QObject.__init__(self)
     self.launchfile = launch_file
     self.mtime = mtime
     self.includes = includes
     self.args = args
     self.nodes = nodes
     self.global_param_done = True
     self.__launch_id = '%.9f' % time.time()
Exemplo n.º 35
0
 def __init__(self):
     QObject.__init__(self)
     self._channels = []
     self.file = FileChannel()
     self.file.error.connect(self.on_error)
     self._channels.append(self.file)
     self.launch = LaunchChannel()
     self.launch.error.connect(self.on_error)
     self._channels.append(self.launch)
     self.monitor = MonitorChannel()
     self.monitor.error.connect(self.on_error)
     self._channels.append(self.monitor)
     self.screen = ScreenChannel()
     self.screen.error.connect(self.on_error)
     self._channels.append(self.screen)
     self.settings = SettingsChannel()
     self.settings.error.connect(self.on_error)
     self._channels.append(self.settings)
     self.version = VersionChannel()
     self.version.error.connect(self.on_error)
     self._channels.append(self.version)
 def __init__(self,
              search_text,
              path,
              is_regex=False,
              path_text={},
              recursive=False):
     '''
     :param search_text: text to search for
     :type search_text: str
     :param path: initial file path
     :type path: str
     .param is_regex: is the search_text a regular expressions
     :type is_regex: bool
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._search_text = search_text
     self._path = path
     self._path_text = path_text
     self._recursive = recursive
     self._isrunning = True
     self.setDaemon(True)
Exemplo n.º 37
0
    def __init__(self, context):
        QObject.__init__(self, context)
        self.setObjectName('CO2Detection')
         # setup main widget
        self._widget = QWidget()
        ui_file = os.path.join(rospkg.RosPack().get_path('hector_co2_detection_plugin'), 'lib', 'CO2Detection.ui')
        loadUi(ui_file, self._widget)
        self._widget.setObjectName('CO2Detection')

        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)

        # setup subscribers  
        self._CO2Subscriber = rospy.Subscriber("/co2detected", Bool, self._on_co2_detected)
        
        # style settings
        self._co2_detected_color = QColor(0, 0, 0, 255)
        self._status_no_co2_style = "background-color: rgb(50, 255, 50);"
        self._status_co2_style = "background-color: rgb(255, 50, 50);"
        
        self._co2_font = QFont()
        self._co2_font.setBold(True)

       

        # Qt Signals
        #self.connect(self, QtCore.SIGNAL('setCO2Style(PyQt_PyObject)'), self._set_co2_style)
        self._update_co2_color.connect(self._set_co2_style)
        self._update_no_co2_color.connect(self._set_no_co2_style)

        self._widget.co2detectbutton.setText("Clear Air")
        self._update_no_co2_color.emit()
Exemplo n.º 38
0
 def __init__(self):
     QObject.__init__(self)
     self.__updateThreads = {}
     self.__requestedUpdates = {}
     self._lock = threading.RLock()
Exemplo n.º 39
0
 def __init__(self, launch_serveruri, delayed_exec=0.0, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._launch_serveruri = launch_serveruri
     self._delayed_exec = delayed_exec
     self.setDaemon(True)
Exemplo n.º 40
0
 def __init__(self, masteruri, params, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._masteruri = masteruri
     self._params = params
     self.setDaemon(True)
    def __init__(self, context):
        QObject.__init__(self, context)
        self.setObjectName('ClassName')

        # setup publisher
        self._examplePublisher = rospy.Publisher('/policy_gui/exampletopic',
                                                 Bool,
                                                 queue_size=10)

        self.goal_client = actionlib.SimpleActionClient(
            '/car1/move_base', MoveBaseAction)
        self.goal_client.wait_for_server()

        self.velocity_service1_ = rospy.ServiceProxy(
            '/car1/car_control/pomdp_velocity', ActionObservation)
        self.position_service1_ = rospy.ServiceProxy(
            '/car1/car_control/pomdp_position', ActionObservation)

        self.listener = tf.TransformListener()

        # car 2
        self._examplePublisher = rospy.Publisher('/policy_gui/exampletopic',
                                                 Bool,
                                                 queue_size=10)
        self.goal_client = actionlib.SimpleActionClient(
            '/car2/move_base', MoveBaseAction)
        self.goal_client.wait_for_server()
        self.velocity_service2_ = rospy.ServiceProxy(
            '/car2/car_control/pomdp_velocity', ActionObservation)
        self.position_service2_ = rospy.ServiceProxy(
            '/car2/car_control/pomdp_position', ActionObservation)
        self.listener = tf.TransformListener()

        # setup services
        #self.getObjects = rospy.ServiceProxy('worldmodel/get_object_model', GetObjectModel)

        # setup subscribers
        #self._worldmodelObjectsSubscriber = rospy.Subscriber("/worldmodel/objects", ObjectModel, self._on_worldmodel_objects)
        #self._interactive_marker_endeffector = rospy.Subscriber("/interactive_marker_pose_control/feedback",InteractiveMarkerFeedback,
        #self._on_interactive_marker_endeffector_pose,queue_size=1)

        # setup action clients
        #self._move_arm_client = actionlib.SimpleActionClient("/move_group", MoveGroupAction)

        #setup tf listener
        #self.tf_listener = TransformListener()

        # setup main widget
        self._widget = QWidget()
        ui_file = os.path.join(rospkg.RosPack().get_path('policy_gui'), 'lib',
                               'ClassName.ui')
        loadUi(ui_file, self._widget)
        self._widget.setObjectName('ClassNameUi')

        #set connections
        self._widget.start_button.pressed.connect(
            self._on_start_button_pressed)
        self._widget.setup_button.pressed.connect(
            self._on_setup_button_pressed)

        #getRobotJoints_button

        # Show _widget.windowTitle on left-top of each plugin (when
        # it's set in _widget). This is useful when you open multiple
        # plugins at once. Also if you open multiple instances of your
        # plugin at once, these lines add number to make it easy to
        # tell from pane to pane.

        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() +
                                        (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)

        #taurob_training_week = rospy.get_param('/taurob_training_week',False)

        # connect Signal Slot
        #self._update_task_delegates.connect(self._on_update_task_delegates)

        # init stuff
        # self.bla = 1

        self.pos_car1 = []
        self.pos_car2 = []
Exemplo n.º 42
0
 def __init__(self):
     QObject.__init__(self)
     self.PARAM_CACHE = self.loadCache(nm.settings().PARAM_HISTORY_FILE)
Exemplo n.º 43
0
 def __init__(self):
     '''
     '''
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self.setDaemon(True)
Exemplo n.º 44
0
 def __init__(self, masteruri, params, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._masteruri = masteruri
     self._params = params
     self.setDaemon(True)
Exemplo n.º 45
0
 def __init__(self):
     QObject.__init__(self)
     self.__serviceThreads = {}
     self.__refreshThreads = {}
     self._lock = threading.RLock()
Exemplo n.º 46
0
 def __init__(self):
     QObject.__init__(self)
     self.PARAM_CACHE = self.loadCache(nm.settings().PARAM_HISTORY_FILE)
 def __init__(self):
     QObject.__init__(self)
     self.__serviceThreads = {}
     self.__refreshThreads = {}
     self._lock = threading.RLock()
 def __init__(self, masteruri, wait, parent=None):
     QObject.__init__(self)
     threading.Thread.__init__(self)
     self._masteruri = masteruri
     self._wait = wait
     self.setDaemon(True)