From cab57a00d0b7c86bbd3ffa7421aefe80889543fa Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 4 Apr 2025 09:52:59 -0700 Subject: [PATCH 1/2] selfdrived: remove ignored processes list (#34978) * selfdrived: remove ignored processes list * it's a set --- selfdrive/selfdrived/selfdrived.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index bb30c4ba9b..b1399ab43b 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -20,12 +20,12 @@ from openpilot.selfdrive.selfdrived.events import Events, ET from openpilot.selfdrive.selfdrived.state import StateMachine from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert +from openpilot.system.hardware import HARDWARE from openpilot.system.version import get_build_metadata REPLAY = "REPLAY" in os.environ SIMULATION = "SIMULATION" in os.environ TESTING_CLOSET = "TESTING_CLOSET" in os.environ -IGNORE_PROCESSES = {"loggerd", "encoderd", "statsd"} LONGITUDINAL_PERSONALITY_MAP = {v: k for k, v in log.LongitudinalPersonality.schema.enumerants.items()} ThermalStatus = log.DeviceState.ThermalStatus @@ -115,6 +115,12 @@ class SelfdriveD: self.state_machine = StateMachine() self.rk = Ratekeeper(100, print_delay_threshold=None) + # some comma three with NVMe experience NVMe dropouts mid-drive that + # cause loggerd to crash on write, so ignore it only on that platform + self.ignored_processes = set() + if HARDWARE.get_device_type() == 'tici' and os.path.exists('/dev/nvme0'): + self.ignored_processes = {'loggerd', } + # Determine startup event self.startup_event = EventName.startup if build_metadata.openpilot.comma_remote and build_metadata.tested_channel else EventName.startupMaster if not car_recognized: @@ -258,7 +264,7 @@ class SelfdriveD: if not_running != self.not_running_prev: cloudlog.event("process_not_running", not_running=not_running, error=True) self.not_running_prev = not_running - if self.sm.recv_frame['managerState'] and (not_running - IGNORE_PROCESSES): + if self.sm.recv_frame['managerState'] and (not_running - self.ignored_processes): self.events.add(EventName.processNotRunning) else: if not SIMULATION and not self.rk.lagging: From 1e3f6599bd57da364a46ffc195320502fe4f9252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Fri, 4 Apr 2025 19:05:36 -0400 Subject: [PATCH 2/2] calibrationd: read carParams from Params (#34981) * Read CarParams once from Params * Remove it from process replay --- selfdrive/locationd/calibrationd.py | 10 ++++++---- selfdrive/test/process_replay/process_replay.py | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index 8ce884ae4f..e265b70f1a 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -11,7 +11,7 @@ import capnp import numpy as np from typing import NoReturn -from cereal import log +from cereal import log, car import cereal.messaging as messaging from openpilot.common.conversions import Conversions as CV from openpilot.common.params import Params @@ -258,16 +258,18 @@ def main() -> NoReturn: config_realtime_process([0, 1, 2, 3], 5) pm = messaging.PubMaster(['liveCalibration']) - sm = messaging.SubMaster(['cameraOdometry', 'carState', 'carParams'], poll='cameraOdometry') + sm = messaging.SubMaster(['cameraOdometry', 'carState'], poll='cameraOdometry') + + params_reader = Params() + CP = messaging.log_from_bytes(params_reader.get("CarParams", block=True), car.CarParams) calibrator = Calibrator(param_put=True) + calibrator.not_car = CP.notCar while 1: timeout = 0 if sm.frame == -1 else 100 sm.update(timeout) - calibrator.not_car = sm['carParams'].notCar - if sm.updated['cameraOdometry']: calibrator.handle_v_ego(sm['carState'].vEgo) new_rpy = calibrator.handle_cam_odom(sm['cameraOdometry'].trans, diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index 13de985c68..3ee761ee44 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -516,9 +516,10 @@ CONFIGS = [ ), ProcessConfig( proc_name="calibrationd", - pubs=["carState", "cameraOdometry", "carParams"], + pubs=["carState", "cameraOdometry"], subs=["liveCalibration"], ignore=["logMonoTime"], + init_callback=get_car_params_callback, should_recv_callback=calibration_rcv_callback, ), ProcessConfig(