mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +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:
parent
61d595dc64
commit
fd5bb9e69c
@ -100,10 +100,10 @@ public:
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
} 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;
|
||||
|
||||
} else if (dist.signal_quality != 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user