folder_image_publisher.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:image_recognition 作者: tue-robotics 项目源码 文件源码
def __init__(self, context):
        """
        :param context: QT context, aka parent
        """
        super(FolderImagePublisherPlugin, self).__init__(context)

        # Widget setup
        self.setObjectName('FolderImagePublisherPlugin')

        self._widget = QWidget()
        context.add_widget(self._widget)

        # Layout and attach to widget
        layout = QHBoxLayout()
        self._widget.setLayout(layout)

        self._info = QLineEdit()
        self._info.setDisabled(True)
        self._info.setText("Please choose a directory (top-right corner)")
        layout.addWidget(self._info)

        self._left_button = QPushButton('<')
        self._left_button.clicked.connect(partial(self._rotate_and_publish, -1))
        layout.addWidget(self._left_button)

        self._right_button = QPushButton('>')
        self._right_button.clicked.connect(partial(self._rotate_and_publish, 1))
        layout.addWidget(self._right_button)

        # Set subscriber and service to None
        self._pub = rospy.Publisher("folder_image", Image, queue_size=1)

        self._bridge = CvBridge()

        self._files = collections.deque([])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号