|
29 | 29 |
|
30 | 30 | from lerobot.configs.types import FeatureType, PolicyFeature |
31 | 31 | from lerobot.envs.configs import EnvConfig |
32 | | -from lerobot.types import RobotObservation |
33 | 32 | from lerobot.utils.constants import OBS_ENV_STATE, OBS_IMAGE, OBS_IMAGES, OBS_STATE, OBS_STR |
34 | 33 | from lerobot.utils.utils import get_channel_first_image_shape |
35 | 34 |
|
@@ -206,28 +205,6 @@ def check_env_attributes_and_types(env: gym.vector.VectorEnv) -> None: |
206 | 205 | ) |
207 | 206 |
|
208 | 207 |
|
209 | | -def add_envs_task(env: gym.vector.VectorEnv, observation: RobotObservation) -> RobotObservation: |
210 | | - """Adds task feature to the observation dict with respect to the first environment attribute.""" |
211 | | - if _sub_env_has_attr(env, "task_description"): |
212 | | - task_result = list(env.call("task_description")) |
213 | | - |
214 | | - if not all(isinstance(item, str) for item in task_result): |
215 | | - raise TypeError("All items in task_description result must be strings") |
216 | | - |
217 | | - observation["task"] = task_result |
218 | | - elif _sub_env_has_attr(env, "task"): |
219 | | - task_result = list(env.call("task")) |
220 | | - |
221 | | - if not all(isinstance(item, str) for item in task_result): |
222 | | - raise TypeError("All items in task result must be strings") |
223 | | - |
224 | | - observation["task"] = task_result |
225 | | - else: |
226 | | - num_envs = observation[list(observation.keys())[0]].shape[0] |
227 | | - observation["task"] = ["" for _ in range(num_envs)] |
228 | | - return observation |
229 | | - |
230 | | - |
231 | 208 | def _close_single_env(env: Any) -> None: |
232 | 209 | try: |
233 | 210 | env.close() |
|
0 commit comments