mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
uavcannode rangefinder: add tolerance to reading too close check (#24415)
This commit is contained in:
parent
71d514d359
commit
5c7143a33b
@ -100,10 +100,12 @@ public:
|
||||
}
|
||||
|
||||
// reading_type
|
||||
const float tolerance = 1e-6;
|
||||
|
||||
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 - tolerance) {
|
||||
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