diff --git a/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py b/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py index 75a624faa..ee8f9114e 100644 --- a/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py +++ b/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py @@ -459,6 +459,10 @@ def step(self, action): assert len(action) == 4, f"Actions should be size 4, got {len(action)}" self.set_xyz_action(action[:3]) self.do_simulation([action[-1], -action[-1]], n_frames=self.frame_skip) + if self.curr_path_length > self.max_path_length: + raise ValueError( + "Maximum path length allowed by the benchmark has been exceeded" + ) self.curr_path_length += 1 # Running the simulator can sometimes mess up site positions, so @@ -470,6 +474,7 @@ def step(self, action): return ( self._last_stable_obs, # observation just before going unstable 0.0, # reward (penalize for causing instability) + False, False, # termination flag always False { # info "success": False,