diff --git a/msg/distance_sensor.msg b/msg/distance_sensor.msg index 4a2e8f8d8ff8a194c0bc535d58a45b586368a3e0..6e636160c5c0bf72380bc08d640c95c3cc76197c 100644 --- a/msg/distance_sensor.msg +++ b/msg/distance_sensor.msg @@ -5,7 +5,7 @@ uint64 timestamp # time since system start (microseconds) float32 min_distance # Minimum distance the sensor can measure (in m) float32 max_distance # Maximum distance the sensor can measure (in m) float32 current_distance # Current distance reading (in m) -float32 covariance # Measurement covariance (in m), 0 for unknown / invalid readings +float32 covariance # Measurement covariance (in m^2), 0 for unknown / invalid readings int8 signal_quality # Signal quality in percent (0...100%), where 0 = invalid signal, 100 = perfect signal, and -1 = unknown signal quality. uint8 type # Type from MAV_DISTANCE_SENSOR enum diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 5243e7b72ce46e2c6c0f326bd8c67bcc85e35050..8b9a88e66398146aacae8860f7809cf72cb78cd1 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -797,7 +797,7 @@ MavlinkReceiver::handle_message_distance_sensor(mavlink_message_t *msg) d.type = dist_sensor.type; d.id = MAV_DISTANCE_SENSOR_LASER; d.orientation = dist_sensor.orientation; - d.covariance = dist_sensor.covariance; + d.covariance = dist_sensor.covariance * 1e-4f; // cm^2 to m^2 /// TODO Add sensor rotation according to MAV_SENSOR_ORIENTATION enum