From 463bba4b421b72c2819c37c4b4ef9e43ea63824c Mon Sep 17 00:00:00 2001 From: Comma Device Date: Thu, 20 Feb 2025 10:42:26 -0800 Subject: [PATCH] bs --- selfdrive/modeld/modeld.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/modeld/modeld.py b/selfdrive/modeld/modeld.py index 5de76b3848..0ff48c6c47 100755 --- a/selfdrive/modeld/modeld.py +++ b/selfdrive/modeld/modeld.py @@ -104,7 +104,7 @@ class ModelState: self.full_desire[0,:-1] = self.full_desire[0,1:] self.full_desire[0,-1] = new_desire - self.numpy_inputs['desire'][:] = self.full_desire[-1-ModelConstants.FULL_HISTORY_BUFFER_LEN_INPUT*ModelConstants.TEMPORAL_SKIP::ModelConstants.TEMPORAL_SKIP] + self.numpy_inputs['desire'][:] = self.full_desire[0, -1-ModelConstants.FULL_HISTORY_BUFFER_LEN_INPUT*ModelConstants.TEMPORAL_SKIP::ModelConstants.TEMPORAL_SKIP] self.numpy_inputs['traffic_convention'][:] = inputs['traffic_convention'] self.numpy_inputs['lateral_control_params'][:] = inputs['lateral_control_params'] @@ -132,13 +132,13 @@ class ModelState: self.full_features_buffer[0,:-1] = self.full_features_buffer[0,1:] self.full_features_buffer[0,-1] = outputs['hidden_state'][0, :] - self.numpy_inputs['features_buffer'][:] = self.full_features_buffer[-ModelConstants.TEMPORAL_SKIP+1-(ModelConstants.FULL_HISTORY_BUFFER_LEN_INPUT-1)*ModelConstants.TEMPORAL_SKIP-1:-ModelConstants.TEMPORAL_SKIP+1:ModelConstants.TEMPORAL_SKIP] + self.numpy_inputs['features_buffer'][:] = self.full_features_buffer[0, -ModelConstants.TEMPORAL_SKIP+1-(ModelConstants.FULL_HISTORY_BUFFER_LEN_INPUT-1)*ModelConstants.TEMPORAL_SKIP-1:-ModelConstants.TEMPORAL_SKIP+1:ModelConstants.TEMPORAL_SKIP] # TODO model only uses last value now self.full_prev_desired_curv[0,:-1] = self.full_prev_desired_curv[0,1:] self.full_prev_desired_curv[0,-1,:] = outputs['desired_curvature'][0, :] - self.numpy_inputs['prev_desired_curv'][:] = self.full_prev_desired_curv[-ModelConstants.TEMPORAL_SKIP+1-ModelConstants.FULL_HISTORY_BUFFER_LEN_INPUT*ModelConstants.TEMPORAL_SKIP-1: -ModelConstants.TEMPORAL_SKIP+1:ModelConstants.TEMPORAL_SKIP] + self.numpy_inputs['prev_desired_curv'][:] = self.full_prev_desired_curv[0, -ModelConstants.TEMPORAL_SKIP+1-ModelConstants.FULL_HISTORY_BUFFER_LEN_INPUT*ModelConstants.TEMPORAL_SKIP-1: -ModelConstants.TEMPORAL_SKIP+1:ModelConstants.TEMPORAL_SKIP] return outputs