mavlink_receiver: Set distance_sensor id field equal to mavlink msg

The id field should be copied from the mavlink message, not
simply set to MAV_DISTANCE_SENSOR_LASER (which is 0).
This commit is contained in:
Morten Fyhn Amundsen
2019-12-05 16:10:43 +01:00
committed by Beat Küng
parent 2c73aefafe
commit 1d3da86abb
+1 -1
View File
@@ -700,7 +700,7 @@ MavlinkReceiver::handle_message_distance_sensor(mavlink_message_t *msg)
ds.q[3] = dist_sensor.quaternion[3];
ds.signal_quality = -1; // TODO: A dist_sensor.signal_quality field is missing from the mavlink message definition.
ds.type = dist_sensor.type;
ds.id = MAV_DISTANCE_SENSOR_LASER;
ds.id = dist_sensor.id;
ds.orientation = dist_sensor.orientation;
_distance_sensor_pub.publish(ds);