feat: ForceStreamOutput 新增同幀未濾波量測欄位
App 需要濾波前的 raw 與 N 供錄製、分析與標定取樣;診斷幀保留 raw 特徵、N 為 NaN。已以帶標定、中值加低通的會話逐幀對照直通結果驗證。
This commit is contained in:
@@ -93,6 +93,9 @@ class ForceStreamOutput:
|
||||
warmup_required_frames: int = 0
|
||||
warmup_elapsed_frames: int = 0
|
||||
warming_up: bool = False
|
||||
#: T09c: the same frame's unfiltered measurement, before the output chain.
|
||||
measurement_raw: tuple[float, float, float] = (float("nan"),) * 3
|
||||
measurement_newton: tuple[float, float, float] = (float("nan"),) * 3
|
||||
|
||||
@property
|
||||
def reference_generation(self) -> int:
|
||||
@@ -359,6 +362,8 @@ class ForceStreamSession:
|
||||
accepted: bool = True,
|
||||
duplicate: bool = False,
|
||||
late: bool = False,
|
||||
measurement_raw: tuple[float, float, float] | None = None,
|
||||
measurement_newton: tuple[float, float, float] | None = None,
|
||||
) -> ForceStreamOutput:
|
||||
output = ForceStreamOutput(
|
||||
frame=frame,
|
||||
@@ -381,6 +386,16 @@ class ForceStreamSession:
|
||||
warmup_required_frames=self._filter.warmup_required_frames,
|
||||
warmup_elapsed_frames=self._filter.warmup_elapsed_frames,
|
||||
warming_up=self._filter.warming_up,
|
||||
measurement_raw=(
|
||||
(float("nan"),) * 3
|
||||
if measurement_raw is None
|
||||
else tuple(float(value) for value in measurement_raw)
|
||||
),
|
||||
measurement_newton=(
|
||||
(float("nan"),) * 3
|
||||
if measurement_newton is None
|
||||
else tuple(float(value) for value in measurement_newton)
|
||||
),
|
||||
)
|
||||
self._last_output = output
|
||||
return output
|
||||
@@ -409,6 +424,8 @@ class ForceStreamSession:
|
||||
accepted=False,
|
||||
duplicate=duplicate,
|
||||
late=late,
|
||||
measurement_raw=raw,
|
||||
measurement_newton=(float("nan"),) * 3,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
@@ -652,4 +669,8 @@ class ForceStreamSession:
|
||||
quality=quality,
|
||||
diagnostics=tuple(output.measurement.diagnostics),
|
||||
accepted=True,
|
||||
measurement_raw=tuple(float(value) for value in output.measurement.sdk.raw),
|
||||
measurement_newton=tuple(
|
||||
float(value) for value in output.measurement.newton
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user