mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-29 10:43:42 +08:00
Even clearer!
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user