Ejemplo n.º 1
0
        self.ui.stop_button.setFocus()

    def stop_button_clicked(self):
        # Set value
        self.vehicle_manual_controller.set_velocity_kmph(0.0, 0.0)
        # Transfer focus
        self.ui.start_button.setFocus()

    def closeEvent(self, event):
        # Stop vehicle for sure
        self.vehicle_manual_controller.stop_now()


if __name__ == '__main__':
    rospy.init_node('set_run_dialog')

    app = QApplication(sys.argv)

    lock_manager = LockManager(LOCK_PATH)
    if not lock_manager.get_lock():
        QMessageBox.warning(
            None, 'Warning',
            'Another same process is running. If not, please delete lock file [ %s ].'
            % lock_manager.get_lock_path(), QMessageBox.Ok)
        sys.exit(1)

    win = SetRunDialog()
    win.show()
    ret = app.exec_()
    lock_manager.release_lock()
    sys.exit(ret)
Ejemplo n.º 2
0
            QMessageBox.warning(None, 'Error', 'Failed to stop waypoint record!', QMessageBox.Ok)
            return
        self.ui.start_button.setEnabled(True)
        self.ui.stop_button.setEnabled(False)

    def closeEvent(self, event):
        self.save_ui_info()

    def load_ui_info(self):
        settings = SettingsManager(CONFIG_FILE)
        settings.load(self.ui.save_path_edit)

    def save_ui_info(self):
        settings = SettingsManager(CONFIG_FILE)
        settings.save(self.ui.save_path_edit)

if __name__=='__main__':
    rospy.init_node('waypoint_recorder')

    app = QApplication(sys.argv)

    lock_manager = LockManager(LOCK_PATH)
    if not lock_manager.get_lock():
        QMessageBox.warning(None, 'Warning', 'Another same process is running. If not, please delete lock file [ %s ].' % lock_manager.get_lock_path(), QMessageBox.Ok)
        sys.exit(1)
    
    win = WaypointRecorderDialog()
    win.show()
    ret = app.exec_()
    lock_manager.release_lock()
    sys.exit(ret)