0

我正在使用dronekit 并使用事件侦听器来跟踪摄像机视频录制状态。这是因为我没有找到识别录制状态的方法。因此,我正在跟踪我发送的命令并在成功时更改模式。

但我观察到我的听众没有收到所有事件。这是一个常见问题吗?可以修复吗?是否有需要更改的频率设置?

@vehicle.on_message('GOPRO_SET_RESPONSE')
def listener(self, name, message):
    global mode, recording, way_points, nadir_taken
    if message.cmd_id == 2:
        log.debug('Shutter:%s' % message)
        if message.status == 0:
            if mode == MODE_VIDEO:
                if recording:
                    recording = False
                    log.info("Stopped video")
                    # message_handler.set(message_handler.get() + " Stopped Recording.")
                    record_handler.set(NO_STRING)
                    plot.info(STOP_STRING_VIDEO)
                    note.info(STOP_STRING_VIDEO)
                    thread.start_new(speak, (VIDEO_RECORD_ON_MSG,))
                else:
                    recording = True
                    log.info("started recording video")
                    # message_handler.set(message_handler.get() + "\n Started Recording.")
                    record_handler.set(YES_STRING)
                    plot.info(START_STRING_VIDEO)
                    note.info(START_STRING_VIDEO)
                    thread.start_new(speak, (VIDEO_RECORD_OFF_MSG,))
            else:
                log.info("Image Captured at %s", str(loc))
    else:
        log.info('Unidentified Message:%s' % message)
4

0 回答 0