From 22fd56e32e4bdf38dea03a4e2fb3cadb5a289145 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 30 Aug 2025 22:40:49 -0400 Subject: [PATCH] Revert "not used for now" This reverts commit f0083d6241380e84ed259c402941fa2c78e03fdf. --- .../selfdrive/controls/lib/longitudinal_planner.py | 2 +- .../lib/speed_limit_controller/speed_limit_controller.py | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py b/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py index aa30e12f6b..97dac727c1 100644 --- a/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py +++ b/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py @@ -21,7 +21,7 @@ class LongitudinalPlannerSP: self.dec = DynamicExperimentalController(CP, mpc) self.generation = int(model_bundle.generation) if (model_bundle := get_active_bundle()) else None - self.slc = SpeedLimitController() + self.slc = SpeedLimitController(CP) @property def mlsim(self) -> bool: diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit_controller/speed_limit_controller.py b/sunnypilot/selfdrive/controls/lib/speed_limit_controller/speed_limit_controller.py index aa8000c385..41a06c5719 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit_controller/speed_limit_controller.py +++ b/sunnypilot/selfdrive/controls/lib/speed_limit_controller/speed_limit_controller.py @@ -1,9 +1,3 @@ -""" -Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. - -This file is part of sunnypilot and is licensed under the MIT License. -See the LICENSE.md file in the root directory for more details. -""" import numpy as np import time @@ -35,8 +29,9 @@ class SpeedLimitController: _a_ego: float _v_offset: float - def __init__(self): + def __init__(self, CP): self.params = Params() + self.CP = CP self.policy = self.params.get("SpeedLimitControlPolicy", return_default=True) self.resolver = SpeedLimitResolver(self.policy) self.last_params_update = 0.0