修正示例中的三轴力单位显示

避免未标定读数被示例标成 N,并让 Finger 示例读取 SDK 的每轴单位。已通过相关测试和语法检查。
This commit is contained in:
ykcheungab
2026-10-05 13:10:58 +08:00
parent 38d3e67b00
commit 34cb83d4a4
6 changed files with 21 additions and 9 deletions
+4 -4
View File
@@ -77,13 +77,13 @@ def main() -> int:
break
# ------------------------------------------------------ use the results
# Scalars are calibrated Newtons when the bundle ships a calibration; the *_raw
# pair is always the unfiltered integrator output.
# The *_raw pair is always the unfiltered integrator output.
touching = "yes" if snap.centroid is not None else "no"
fn_unit, fx_unit, fy_unit = sensor.force_units
print(
f"FPS={snap.fps:5.1f} "
f"normal={snap.normal_force:8.4f} N (raw {snap.normal_force_raw:10.2f}) "
f"shear=({snap.shear_x:7.4f}, {snap.shear_y:7.4f}) "
f"normal={snap.normal_force:8.4f} {fn_unit} (raw {snap.normal_force_raw:10.2f}) "
f"shear=({snap.shear_x:7.4f} {fx_unit}, {snap.shear_y:7.4f} {fy_unit}) "
f"contact={touching} age={snap.age_ms:4.1f} ms",
end="\r",
)