diff --git a/opendbc_repo b/opendbc_repo index 4978c29f8..1e4385d81 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 4978c29f8871f91d6aa4fc8d2d6634003930ccdb +Subproject commit 1e4385d810ca7b0cf695f99ef77b21de13f3c201 diff --git a/openpilot/selfdrive/controls/controlsd.py b/openpilot/selfdrive/controls/controlsd.py index 249c2ce4c..62755531e 100644 --- a/openpilot/selfdrive/controls/controlsd.py +++ b/openpilot/selfdrive/controls/controlsd.py @@ -53,7 +53,7 @@ class Controls(ControlsExt): self.CI = interfaces[self.CP.carFingerprint](self.CP, self.CP_SP, self.CP_IC) - ic_sm_services = ['liveCurvatureParameters', 'longitudinalPlanIC', 'carStateIC'] + ic_sm_services = ['liveCurvatureParameters', 'longitudinalPlanIC'] ic_pm_services = ['carControlIC', 'controlsStateIC'] self.sm = messaging.SubMaster(['liveDelay', 'liveParameters', 'liveTorqueParameters', 'modelV2', 'selfdriveState', 'liveCalibration', 'livePose', 'longitudinalPlan', 'lateralManeuverPlan', 'carState', 'carOutput', diff --git a/openpilot/selfdrive/controls/plannerd.py b/openpilot/selfdrive/controls/plannerd.py index 4acc424e5..657bd1dd9 100755 --- a/openpilot/selfdrive/controls/plannerd.py +++ b/openpilot/selfdrive/controls/plannerd.py @@ -29,7 +29,7 @@ def main(): longitudinal_planner = LongitudinalPlanner(CP, CP_SP) pm = messaging.PubMaster(['longitudinalPlan', 'driverAssistance', 'longitudinalPlanSP', 'longitudinalPlanIC']) sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'liveParameters', 'radarState', 'modelV2', 'selfdriveState', - 'liveMapDataSP', 'carStateSP', 'carStateIC', gps_location_service], + 'liveMapDataSP', 'carStateSP', gps_location_service], poll='carState', ignore_alive=ignore_services, ignore_avg_freq=ignore_services, ignore_valid=ignore_services) while True: diff --git a/openpilot/selfdrive/locationd/curvatured.py b/openpilot/selfdrive/locationd/curvatured.py index 64bde68a9..6a09543bc 100644 --- a/openpilot/selfdrive/locationd/curvatured.py +++ b/openpilot/selfdrive/locationd/curvatured.py @@ -855,6 +855,8 @@ class CurvatureEstimator(CurvatureDLookup): if msg.steeringPressed: self.last_override_t = t elif which == "carStateIC": + if self.steering_pressed: + self.steering_pressed[-1] |= bool(msg.steeringSlightlyPressed) if msg.steeringSlightlyPressed: self.last_override_t = t elif which == "controlsStateIC": @@ -955,7 +957,8 @@ def main(): config_realtime_process([0, 1, 2, 3], 5) pm = messaging.PubMaster(['liveCurvatureParameters']) - sm = messaging.SubMaster(['carControlIC', 'carControl', 'carState', 'carStateIC', 'liveCalibration', 'livePose', 'liveDelay', 'controlsState', 'controlsStateIC'], poll='livePose') + sm = messaging.SubMaster(['carControlIC', 'carControl', 'carState', 'carStateIC', 'liveCalibration', 'livePose', + 'liveDelay', 'controlsState', 'controlsStateIC'], poll='livePose') params = Params() CP = messaging.log_from_bytes(params.get("CarParams", block=True), car.CarParams) @@ -997,4 +1000,3 @@ def main(): if __name__ == "__main__": main() - diff --git a/openpilot/selfdrive/locationd/test/test_curvatured.py b/openpilot/selfdrive/locationd/test/test_curvatured.py index 40dde0b98..e68206f16 100644 --- a/openpilot/selfdrive/locationd/test/test_curvatured.py +++ b/openpilot/selfdrive/locationd/test/test_curvatured.py @@ -340,6 +340,7 @@ class TestCurvatureEstimator: estimator.handle_log(12.0, "carState", car.CarState(vEgo=20.0, steeringPressed=False)) estimator.handle_log(12.0, "carStateIC", custom.CarStateIC(steeringSlightlyPressed=True)) + assert estimator.steering_pressed[-1] assert estimator.last_override_t == 12.0 def test_interp_curve_value_matches_interp_curve_samples(self): diff --git a/openpilot/selfdrive/selfdrived/selfdrived.py b/openpilot/selfdrive/selfdrived/selfdrived.py index ba495a09a..aff7d5e2f 100644 --- a/openpilot/selfdrive/selfdrived/selfdrived.py +++ b/openpilot/selfdrive/selfdrived/selfdrived.py @@ -112,7 +112,7 @@ class SelfdriveD(CruiseHelper): 'carOutput', 'driverMonitoringState', 'longitudinalPlan', 'livePose', 'liveDelay', 'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters', 'liveCurvatureParameters', 'controlsState', 'carControl', 'driverAssistance', 'alertDebug', 'userBookmark', 'audioFeedback', - 'lateralManeuverPlan', 'modelDataV2SP', 'longitudinalPlanSP', 'carStateSP', 'carStateIC'] + \ + 'lateralManeuverPlan', 'modelDataV2SP', 'longitudinalPlanSP', 'carStateIC'] + \ self.camera_packets + self.sensor_packets + self.gps_packets, ignore_alive=ignore, ignore_avg_freq=ignore, ignore_valid=ignore, frequency=int(1/DT_CTRL)) diff --git a/openpilot/selfdrive/test/process_replay/process_replay.py b/openpilot/selfdrive/test/process_replay/process_replay.py index 60ca323ea..8d0e80c11 100755 --- a/openpilot/selfdrive/test/process_replay/process_replay.py +++ b/openpilot/selfdrive/test/process_replay/process_replay.py @@ -444,7 +444,7 @@ CONFIGS = [ "driverCameraState", "roadCameraState", "wideRoadCameraState", "managerState", "liveTorqueParameters", "liveCurvatureParameters", "accelerometer", "gyroscope", "carOutput", "gpsLocationExternal", "gpsLocation", "controlsState", - "carControl", "driverAssistance", "alertDebug", "audioFeedback", + "carControl", "carStateIC", "driverAssistance", "alertDebug", "audioFeedback", ], subs=["selfdriveState", "onroadEvents"], ignore=["logMonoTime"], @@ -457,9 +457,9 @@ CONFIGS = [ ProcessConfig( proc_name="controlsd", pubs=["liveParameters", "liveTorqueParameters", "liveCurvatureParameters", "modelV2", "selfdriveState", - "liveCalibration", "livePose", "longitudinalPlan", "carState", "carOutput", + "liveCalibration", "livePose", "longitudinalPlan", "longitudinalPlanIC", "carState", "carOutput", "driverMonitoringState", "onroadEvents", "driverAssistance"], - subs=["carControl", "controlsState"], + subs=["carControl", "carControlIC", "controlsState", "controlsStateIC"], ignore=["logMonoTime", ], init_callback=get_car_params_callback, should_recv_callback=MessageBasedRcvCallback("selfdriveState"), @@ -467,8 +467,8 @@ CONFIGS = [ ), ProcessConfig( proc_name="card", - pubs=["pandaStates", "carControl", "onroadEvents", "can"], - subs=["sendcan", "carState", "carParams", "carOutput", "liveTracks"], + pubs=["pandaStates", "carControl", "carControlIC", "onroadEvents", "can"], + subs=["sendcan", "carState", "carStateIC", "carParams", "carParamsIC", "carOutput", "liveTracks"], ignore=["logMonoTime", "carState.cumLagMs"], init_callback=card_fingerprint_callback, should_recv_callback=card_rcv_callback, @@ -488,7 +488,7 @@ CONFIGS = [ ProcessConfig( proc_name="plannerd", pubs=["modelV2", "carControl", "carState", "controlsState", "liveParameters", "radarState", "selfdriveState"], - subs=["longitudinalPlan", "driverAssistance"], + subs=["longitudinalPlan", "longitudinalPlanIC", "driverAssistance"], ignore=["logMonoTime", "longitudinalPlan.processingDelay", "longitudinalPlan.solverExecutionTime"], init_callback=get_car_params_callback, should_recv_callback=MessageBasedRcvCallback("modelV2"), @@ -557,7 +557,7 @@ CONFIGS = [ ), ProcessConfig( proc_name="curvatured", - pubs=["livePose", "liveCalibration", "liveDelay", "carState", "carControl", "controlsState"], + pubs=["livePose", "liveCalibration", "liveDelay", "carState", "carStateIC", "carControl", "carControlIC", "controlsState", "controlsStateIC"], subs=["liveCurvatureParameters"], ignore=["logMonoTime"], init_callback=get_car_params_callback,