From 1db50cb331f1464bdd6bbd53b3690e36a9d022dc Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 18 Feb 2025 10:01:32 -0900 Subject: [PATCH] mavlink: add missing fields for DISTANCE_SENSOR --- src/modules/mavlink/streams/DISTANCE_SENSOR.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/mavlink/streams/DISTANCE_SENSOR.hpp b/src/modules/mavlink/streams/DISTANCE_SENSOR.hpp index 9042403a48..ddabecfba6 100644 --- a/src/modules/mavlink/streams/DISTANCE_SENSOR.hpp +++ b/src/modules/mavlink/streams/DISTANCE_SENSOR.hpp @@ -94,6 +94,22 @@ private: msg.min_distance = dist_sensor.min_distance * 1e2f; // m to cm msg.orientation = dist_sensor.orientation; msg.covariance = dist_sensor.variance * 1e4f; // m^2 to cm^2 + msg.horizontal_fov = dist_sensor.h_fov; + msg.vertical_fov = dist_sensor.v_fov; + msg.quaternion[0] = dist_sensor.q[0]; + msg.quaternion[1] = dist_sensor.q[1]; + msg.quaternion[2] = dist_sensor.q[2]; + msg.quaternion[3] = dist_sensor.q[3]; + + if (dist_sensor.signal_quality < 0) { + msg.signal_quality = 0; + + } else if (dist_sensor.signal_quality == 0) { + msg.signal_quality = 1; + + } else { + msg.signal_quality = dist_sensor.signal_quality; + } mavlink_msg_distance_sensor_send_struct(_mavlink->get_channel(), &msg);