mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 07:03:33 +08:00
uavcannode rangefinder: only publish reading too far or too close if less than or greater than. Not equal to.
This commit is contained in:
@@ -100,10 +100,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reading_type
|
// reading_type
|
||||||
if (dist.current_distance >= dist.max_distance) {
|
if (dist.current_distance > dist.max_distance) {
|
||||||
range_sensor.reading_type = uavcan::equipment::range_sensor::Measurement::READING_TYPE_TOO_FAR;
|
range_sensor.reading_type = uavcan::equipment::range_sensor::Measurement::READING_TYPE_TOO_FAR;
|
||||||
|
|
||||||
} else if (dist.current_distance <= dist.min_distance) {
|
} else if (dist.current_distance < dist.min_distance) {
|
||||||
range_sensor.reading_type = uavcan::equipment::range_sensor::Measurement::READING_TYPE_TOO_CLOSE;
|
range_sensor.reading_type = uavcan::equipment::range_sensor::Measurement::READING_TYPE_TOO_CLOSE;
|
||||||
|
|
||||||
} else if (dist.signal_quality != 0) {
|
} else if (dist.signal_quality != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user