diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 03d77dc6c6..06c181ec02 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -7,6 +7,7 @@ from common.profiler import Profiler from common.params import Params, put_nonblocking import cereal.messaging as messaging from selfdrive.config import Conversions as CV +from selfdrive.swaglog import cloudlog from selfdrive.boardd.boardd import can_list_to_can_capnp from selfdrive.car.car_helpers import get_car, get_startup_event, get_one_can from selfdrive.controls.lib.lane_planner import CAMERA_OFFSET @@ -123,6 +124,7 @@ class Controls: self.last_functional_fan_frame = 0 self.events_prev = [] self.current_alert_types = [ET.PERMANENT] + self.logged_comm_issue = False self.sm['liveCalibration'].calStatus = Calibration.CALIBRATED self.sm['thermal'].freeSpace = 1. @@ -208,11 +210,18 @@ class Controls: if (self.sm['health'].safetyModel != self.CP.safetyModel and self.sm.frame > 2 / DT_CTRL) or \ self.mismatch_counter >= 200: self.events.add(EventName.controlsMismatch) + if not self.sm.alive['plan'] and self.sm.alive['pathPlan']: # only plan not being received: radar not communicating self.events.add(EventName.radarCommIssue) elif not self.sm.all_alive_and_valid(): self.events.add(EventName.commIssue) + if not self.logged_comm_issue: + cloudlog.error(f"commIssue - valid: {self.sm.valid} - alive: {self.sm.alive}") + self.logged_comm_issue = True + else: + self.logged_comm_issue = False + if not self.sm['pathPlan'].mpcSolutionValid: self.events.add(EventName.plannerError) if not self.sm['liveLocationKalman'].sensorsOK and not NOSENSOR: