From 5889e539de704a904a3aeca1b48169baf86a7a86 Mon Sep 17 00:00:00 2001 From: ATATC Date: Fri, 18 Oct 2024 15:34:47 -0400 Subject: [PATCH] Code commented. --- leads/data_persistence/analyzer/inference.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/leads/data_persistence/analyzer/inference.py b/leads/data_persistence/analyzer/inference.py index 284352b..e0dbb54 100644 --- a/leads/data_persistence/analyzer/inference.py +++ b/leads/data_persistence/analyzer/inference.py @@ -132,6 +132,7 @@ def complete(self, *rows: dict[str, _Any], backward: bool = False) -> dict[str, class SpeedInferenceByGPSPosition(SpeedInferenceBase): """ Infer the speed based on the GPS position. + This is equivalent to inferring the mileage based on GPS position and then inferring the speed based on the mileage. v = ds/dt """ @@ -161,6 +162,8 @@ def skip(row: dict[str, _Any]) -> bool: class ForwardAccelerationInferenceBySpeed(ForwardAccelerationInferenceBase): """ Infer the forward acceleration based on the speed. + Note that this is not always reliable because speed is a scalar, but forward acceleration is not. Accelerating in + reverse will still be counted as forward acceleration. a = dv/dt """ @@ -232,6 +235,10 @@ def complete(self, *rows: dict[str, _Any], backward: bool = False) -> dict[str, class VisualDataRealignmentByLatency(Inference): + """ + Offset the delay introduced by camera recording and video encoding so that the sensor data and the picture of the + same frame match. + """ def __init__(self, *channels: _Literal["front", "left", "right", "rear"]) -> None: super().__init__((0, 1), VISUAL_HEADER_ONLY) self._channels: tuple[_Literal["front", "left", "right", "rear"], ...] = channels if channels else (