mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 02:01:35 +08:00
Merge pull request #905 from PX4/distance_fix
mavlink: Only send the distance sensor message if the topic actually upd...
This commit is contained in:
@@ -1339,7 +1339,7 @@ protected:
|
|||||||
|
|
||||||
void send(const hrt_abstime t)
|
void send(const hrt_abstime t)
|
||||||
{
|
{
|
||||||
(void)range_sub->update(t);
|
if (range_sub->update(t)) {
|
||||||
|
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
|
|
||||||
@@ -1356,6 +1356,7 @@ protected:
|
|||||||
mavlink_msg_distance_sensor_send(_channel, range->timestamp / 1000, type, id, orientation,
|
mavlink_msg_distance_sensor_send(_channel, range->timestamp / 1000, type, id, orientation,
|
||||||
range->minimum_distance*100, range->maximum_distance*100, range->distance*100, covariance);
|
range->minimum_distance*100, range->maximum_distance*100, range->distance*100, covariance);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MavlinkStream *streams_list[] = {
|
MavlinkStream *streams_list[] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user