no need for process replay

This commit is contained in:
Jason Wen
2025-01-21 14:40:44 -05:00
parent 313b8fb853
commit 7c64eeff5a
3 changed files with 10 additions and 5 deletions
+8 -3
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import os
import math
from typing import SupportsFloat
@@ -26,6 +27,7 @@ LaneChangeState = log.LaneChangeState
LaneChangeDirection = log.LaneChangeDirection
ACTUATOR_FIELDS = tuple(car.CarControl.Actuators.schema.fields.keys())
REPLAY = "REPLAY" in os.environ
class Controls:
def __init__(self) -> None:
@@ -34,9 +36,12 @@ class Controls:
self.CP = messaging.log_from_bytes(self.params.get("CarParams", block=True), car.CarParams)
cloudlog.info("controlsd got CarParams")
cloudlog.info("controlsd is waiting for CarParamsSP")
self.CP_SP = messaging.log_from_bytes(self.params.get("CarParamsSP", block=True), custom.CarParamsSP)
cloudlog.info("controlsd got CarParamsSP")
if not REPLAY:
cloudlog.info("controlsd is waiting for CarParamsSP")
self.CP_SP = messaging.log_from_bytes(self.params.get("CarParamsSP", block=True), custom.CarParamsSP)
cloudlog.info("controlsd got CarParamsSP")
else:
self.CP_SP = None
self.CI = get_car_interface(self.CP, self.CP_SP)
+1 -1
View File
@@ -60,7 +60,7 @@ class SelfdriveD(CruiseHelper):
else:
self.CP = CP
if CP_SP is None:
if CP_SP is None and not REPLAY:
cloudlog.info("selfdrived is waiting for CarParamsSP")
self.CP_SP = messaging.log_from_bytes(self.params.get("CarParamsSP", block=True), custom.CarParamsSP)
cloudlog.info("selfdrived got CarParamsSP")