def _update_thread_run(self):
        # update type_combo_box
        message_type_names = []
        try:
            # this only works on fuerte and up
            packages = sorted([
                pkg_tuple[0] for pkg_tuple in rosmsg.iterate_packages(
                    self._rospack, rosmsg.MODE_MSG)
            ])
        except:
            # this works up to electric
            packages = sorted(rosmsg.list_packages())
        for package in packages:
            for base_type_str in rosmsg.list_msgs(package,
                                                  rospack=self._rospack):
                message_class = roslib.message.get_message_class(base_type_str)
                if message_class is not None:
                    message_type_names.append(base_type_str)

        self.type_combo_box.setItems.emit(sorted(message_type_names))

        # update topic_combo_box
        _, _, topic_types = rospy.get_master().getTopicTypes()
        self._topic_dict = dict(topic_types)
        self.topic_combo_box.setItems.emit(sorted(self._topic_dict.keys()))
Ejemplo n.º 2
0
    def _update_thread_run(self):
        # update type_combo_box
        message_type_names = []
        try:
            # this only works on fuerte and up
            packages = sorted([
                pkg_tuple[0] for pkg_tuple in rosmsg.iterate_packages(
                    self._rospack, rosmsg.MODE_MSG)
            ])
        except:
            # this works up to electric
            packages = sorted(rosmsg.list_packages())
        for package in packages:
            for base_type_str in rosmsg.list_msgs(package,
                                                  rospack=self._rospack):
                message_class = roslib.message.get_message_class(base_type_str)
                if message_class is not None:
                    message_type_names.append(base_type_str)

        # TODO: get all ROS packages and launch files here instead
        #self.type_combo_box.setItems.emit(sorted(message_type_names))
        packages = sorted([
            pkg_tuple[0]
            for pkg_tuple in RqtRoscommUtil.iterate_packages('launch')
        ])
        self.package_combo_box.setItems.emit(packages)
Ejemplo n.º 3
0
 def _list(self):
     """
     Override Namespace._list()
     """
     try:
         if not self._ns:
             return rosmsg.list_packages(mode=self._config.mode)
         else:
             return rosmsg.list_types(self._name, mode=self._config.mode)
     except:
         return []
Ejemplo n.º 4
0
    def _update_thread_run(self):
        # update type_combo_box
        message_type_names = []
        try:
            # this only works on fuerte and up
            packages = sorted([pkg_tuple[0] for pkg_tuple in rosmsg.iterate_packages(self._rospack, rosmsg.MODE_MSG)])
        except:
            # this works up to electric
            packages = sorted(rosmsg.list_packages())
        for package in packages:
            for base_type_str in rosmsg.list_msgs(package, rospack=self._rospack):
                message_class = roslib.message.get_message_class(base_type_str)
                if message_class is not None:
                    message_type_names.append(base_type_str)

        self.type_combo_box.setItems.emit(sorted(message_type_names))

        # update topic_combo_box
        _, _, topic_types = rospy.get_master().getTopicTypes()
        self._topic_dict = dict(topic_types)
        self.topic_combo_box.setItems.emit(sorted(self._topic_dict.keys()))