I'm using dronekit and using event listeners to keep a track of camera video recording Status. This is because I didn't find a way to identify the recording status. So I'm keeping track of the commands that I'm sending and changing the modes if they are successful.
But I observed that my listener is not receiving all events. Is this a common issue? Can it be Fixed? Is there a frequency setting that I need to change?
@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)