From b0fef4b5ea14f2429bfeb4712597b6546bbd98e0 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Mon, 30 Dec 2024 19:56:29 +0100 Subject: [PATCH] Add lateral_control_params to model inputs if available This change introduces an additional check for "lateral_control_params" in model inputs. If present, it adds the lateral control parameters to the input dictionary, including vehicle speed and steering delay. This ensures compatibility with models requiring these parameters. --- selfdrive/modeld/modeld.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/modeld/modeld.py b/selfdrive/modeld/modeld.py index d645835f7a..f793e5f4f5 100755 --- a/selfdrive/modeld/modeld.py +++ b/selfdrive/modeld/modeld.py @@ -251,6 +251,9 @@ def main(demo=False): 'traffic_convention': traffic_convention, } + if "lateral_control_params" in model.numpy_inputs.keys(): + inputs['lateral_control_params'] = np.array([sm["carState"].vEgo, steer_delay], dtype=np.float32) + mt1 = time.perf_counter() model_output = model.run(buf_main, buf_extra, model_transform_main, model_transform_extra, inputs, prepare_only) mt2 = time.perf_counter()