From 980026d1287fd7e47d4df6b610ce53ea4c718b24 Mon Sep 17 00:00:00 2001 From: Nishanth Kumar Date: Thu, 2 Nov 2023 16:28:47 -0400 Subject: [PATCH] extra vid frames (#86) * extra vid frames * good to go --- predicators/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/predicators/main.py b/predicators/main.py index e7d14c626e..65755b0f2a 100644 --- a/predicators/main.py +++ b/predicators/main.py @@ -43,6 +43,7 @@ from typing import List, Optional, Sequence, Tuple import dill as pkl +import numpy as np from predicators import utils from predicators.approaches import ApproachFailure, ApproachTimeout, \ @@ -391,6 +392,14 @@ def _run_testing(env: BaseEnv, approach: BaseApproach) -> Metrics: total_suc_time += (solve_time + exec_time) make_video = CFG.make_test_videos video_file = f"{save_prefix}__task{test_task_idx+1}.mp4" + if CFG.env == "behavior": # pragma: no cover + assert isinstance(env, BehaviorEnv) + # Step the environment with a dummy action a few + # times so that video making doesn't get abruptly + # cut off. + for _ in range(25): + env.igibson_behavior_env.step( + np.zeros(env.igibson_behavior_env.action_space.shape)) else: if not caught_exception: log_message = "Policy failed to reach goal"