mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(drivers/distance_sensor/vl53l0x): filter out invalid 8.19m distance readings (#27214)
This commit is contained in:
1 parent
715837cd5a
commit
9d07764969
1 file changed
+4
@@ -115,6 +115,10 @@ int VL53L0X::collect()
|
||||
uint16_t distance_mm = (val[0] << 8) | val[1];
|
||||
float distance_m = distance_mm / 1000.f;
|
||||
|
||||
if (distance_m > 2.0f) {
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
_px4_rangefinder.update(timestamp_sample, distance_m);
|
||||
|
||||
return PX4_OK;
|
||||
|
||||
Reference in new issue
Block a user