From 4876bb2582d5daac2a0b9b1a1369d60f42524cf2 Mon Sep 17 00:00:00 2001 From: DanielePettenuzzo <daniele@px4.io> Date: Fri, 21 Sep 2018 17:57:31 +0200 Subject: [PATCH] camera feedback: fix camera_trigger subscription --- src/modules/camera_feedback/camera_feedback.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/modules/camera_feedback/camera_feedback.cpp b/src/modules/camera_feedback/camera_feedback.cpp index 5536b2b976..224d7af728 100644 --- a/src/modules/camera_feedback/camera_feedback.cpp +++ b/src/modules/camera_feedback/camera_feedback.cpp @@ -157,7 +157,12 @@ CameraFeedback::task_main() /* trigger subscription updated */ if (fds[0].revents & POLLIN) { - orb_copy(ORB_ID(camera_trigger), _trigger_sub, &trig); + if (!_camera_capture_feedback) { + orb_copy(ORB_ID(camera_trigger), _trigger_sub, &trig); + + } else { + orb_copy(ORB_ID(camera_trigger_feedback), _trigger_sub, &trig); + } /* update geotagging subscriptions */ orb_check(_gpos_sub, &updated); @@ -208,8 +213,14 @@ CameraFeedback::task_main() capture.q[3] = att.q[3]; - // Indicate that no capture feedback from camera is available - capture.result = -1; + // Indicate that whether capture feedback from camera is available + // What is case 0 for capture.result? + if (!_camera_capture_feedback) { + capture.result = -1; + + } else { + capture.result = 1; + } int instance_id; -- GitLab