diff --git a/tinyphysics.py b/tinyphysics.py index 65ba318..5abaf8b 100644 --- a/tinyphysics.py +++ b/tinyphysics.py @@ -129,9 +129,8 @@ def sim_step(self, step_idx: int) -> None: self.current_lataccel_history.append(self.current_lataccel) def control_step(self, step_idx: int) -> None: - if step_idx >= CONTROL_START_IDX: - action = self.controller.update(self.target_lataccel_history[step_idx], self.current_lataccel, self.state_history[step_idx]) - else: + action = self.controller.update(self.target_lataccel_history[step_idx], self.current_lataccel, self.state_history[step_idx]) + if step_idx < CONTROL_START_IDX: action = self.data['steer_command'].values[step_idx] action = np.clip(action, STEER_RANGE[0], STEER_RANGE[1]) self.action_history.append(action)