mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
drivers: added validity check to sf0x
This commit is contained in:
@@ -854,7 +854,7 @@ test()
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("val: %0.2f m", (double)report.current_distance);
|
||||
warnx("measurement: %0.2f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
|
||||
/* start the sensor polling at 2 Hz rate */
|
||||
@@ -885,7 +885,9 @@ test()
|
||||
}
|
||||
|
||||
warnx("read #%u", i);
|
||||
warnx("val: %0.3f m", (double)report.current_distance);
|
||||
warnx("valid %u", (float)report.current_distance > report.min_distance
|
||||
&& (float)report.current_distance < report.max_distance ? 1 : 0);
|
||||
warnx("measurement: %0.3f m", (double)report.current_distance);
|
||||
warnx("time: %llu", report.timestamp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user