From 7ef811d09834fcaed9cbc6d4592d194c542b3b30 Mon Sep 17 00:00:00 2001 From: EverNorif <1320346985@qq.com> Date: Wed, 25 Mar 2026 11:46:21 +0800 Subject: [PATCH 1/2] reset target_pose_iterators in env_extra_info for mulit run. --- source/autosim/autosim/core/pipeline.py | 1 + source/autosim/autosim/core/types.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/source/autosim/autosim/core/pipeline.py b/source/autosim/autosim/core/pipeline.py index 6416884..901edd4 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_target_pose_iterators() 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..0e0951e 100644 --- a/source/autosim/autosim/core/types.py +++ b/source/autosim/autosim/core/types.py @@ -89,6 +89,10 @@ 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_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() From a412af16a74bdb50a3bcf31d374e6d958b217c9d Mon Sep 17 00:00:00 2001 From: EverNorif <1320346985@qq.com> Date: Wed, 25 Mar 2026 11:47:56 +0800 Subject: [PATCH 2/2] use reset as interface. --- source/autosim/autosim/core/pipeline.py | 2 +- source/autosim/autosim/core/types.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/autosim/autosim/core/pipeline.py b/source/autosim/autosim/core/pipeline.py index 901edd4..bf06cda 100644 --- a/source/autosim/autosim/core/pipeline.py +++ b/source/autosim/autosim/core/pipeline.py @@ -129,7 +129,7 @@ def reset_env(self) -> None: """Reset the environment.""" self._env.reset() - self._env_extra_info.reset_target_pose_iterators() + 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 0e0951e..019a0f0 100644 --- a/source/autosim/autosim/core/types.py +++ b/source/autosim/autosim/core/types.py @@ -89,9 +89,13 @@ 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_target_pose_iterators() + self.reset() - def reset_target_pose_iterators(self) -> None: + 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)