From a39bc65883a93ca3b2b32b489ac4304aaf04783b Mon Sep 17 00:00:00 2001 From: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com> Date: Sat, 12 Jul 2025 22:26:20 +0000 Subject: [PATCH] Even clearer! --- sunnypilot/modeld_v2/fill_model_msg.py | 2 +- sunnypilot/modeld_v2/modeld.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sunnypilot/modeld_v2/fill_model_msg.py b/sunnypilot/modeld_v2/fill_model_msg.py index 694487706d..d1a52aa0e3 100644 --- a/sunnypilot/modeld_v2/fill_model_msg.py +++ b/sunnypilot/modeld_v2/fill_model_msg.py @@ -10,7 +10,7 @@ SEND_RAW_PRED = os.getenv('SEND_RAW_PRED') ConfidenceClass = log.ModelDataV2.ConfidenceClass -def get_curvature_from_output(output, vego, lat_action_t, mlsim=None): +def get_curvature_from_output(output, vego, lat_action_t, mlsim): if not mlsim: if desired_curv := output.get('desired_curvature'): # If the model outputs the desired curvature, use that directly return float(desired_curv[0, 0]) diff --git a/sunnypilot/modeld_v2/modeld.py b/sunnypilot/modeld_v2/modeld.py index 5e4ffca707..93a8a3f05e 100755 --- a/sunnypilot/modeld_v2/modeld.py +++ b/sunnypilot/modeld_v2/modeld.py @@ -54,7 +54,7 @@ class ModelState: raise model_bundle = get_active_bundle() - self.generation = model_bundle.generation + self.generation = model_bundle.generation if model_bundle is not None else None overrides = {override.key: override.value for override in model_bundle.overrides} self.LAT_SMOOTH_SECONDS = float(overrides.get('lat', ".0")) @@ -88,7 +88,7 @@ class ModelState: @property def mlsim(self) -> bool: - return bool(self.generation >= 11) + return bool(self.generation is not None and self.generation >= 11) def run(self, bufs: dict[str, VisionBuf], transforms: dict[str, np.ndarray], inputs: dict[str, np.ndarray], prepare_only: bool) -> dict[str, np.ndarray] | None: