diff --git a/source/autosim/autosim/core/pipeline.py b/source/autosim/autosim/core/pipeline.py index 6416884..bf06cda 100644 --- a/source/autosim/autosim/core/pipeline.py +++ b/source/autosim/autosim/core/pipeline.py @@ -129,6 +129,7 @@ def reset_env(self) -> None: """Reset the environment.""" self._env.reset() + self._env_extra_info.reset() def decompose(self) -> DecomposeResult: """Decompose the task.""" diff --git a/source/autosim/autosim/core/types.py b/source/autosim/autosim/core/types.py index 9b3567c..019a0f0 100644 --- a/source/autosim/autosim/core/types.py +++ b/source/autosim/autosim/core/types.py @@ -89,6 +89,14 @@ class EnvExtraInfo: """The extra reach target poses in the objects frame. each object can have a list of extra reach target poses [x, y, z, qw, qx, qy, qz] with ee_name as the key in the order of execution.""" def __post_init__(self): + self.reset() + + def reset(self) -> None: + """Reset the environment extra information.""" + self._reset_target_pose_iterators() + + def _reset_target_pose_iterators(self) -> None: + """Reset internal iterators so target poses are consumed from the start.""" self._object_reach_target_poses_iterator_dict = { object_name: self._build_iterator(reach_target_poses) for object_name, reach_target_poses in self.object_reach_target_poses.items()