Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion embodichain/lab/gym/envs/managers/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __call__(
):
# TODO: the current implementation will lost the final episode frames recording.
# Check if the frames should be saved for the current episode
if env.elapsed_steps.sum().item() == len(env_ids) and len(self._frames) > 0:
if env.elapsed_steps.sum().item() == 0 and len(self._frames) > 0:
video_name = f"episode_{self._current_episode}_{self._name}"
images_to_video(self._frames, save_path, video_name, fps=20)
Comment on lines 145 to 149
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug fix changes the episode-boundary detection (saving when elapsed_steps sum is 0). Since this is easy to regress and the repo has event-functor tests, please add a small unit test that mocks/stubs images_to_video and verifies that when elapsed_steps==0, the previous episode frames are saved before appending the first frame of the new episode (i.e., first frame is not included in the previous video).

Copilot uses AI. Check for mistakes.

Expand Down
Loading