Skip to content

Commit

Permalink
Code commented.
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Oct 18, 2024
1 parent 8f62292 commit 5889e53
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions leads/data_persistence/analyzer/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 5889e53

Please sign in to comment.