Files
StarPilot/openpilot/starpilot/flm/physical_observation.py
T
2026-10-17 20:02:38 -05:00

14 lines
501 B
Python

"""Optional observer wait state, never a physical sample or authority receipt."""
from dataclasses import dataclass
@dataclass(frozen=True)
class PendingPhysical:
mono_ns: int
received_ns: int
context_changed: bool = False
def fresh(self, now_ns):
return bool(type(self.context_changed) is bool and all(type(value) is int and value > 0 for value in (self.mono_ns, self.received_ns, now_ns)) and
self.mono_ns <= self.received_ns <= now_ns and now_ns - self.mono_ns <= 100_000_000)