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
31 changes: 31 additions & 0 deletions source/isaaclab_tasks/test/core/test_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

"""Rest everything follows."""

import subprocess
import sys
from pathlib import Path

import pytest

import isaaclab_tasks # noqa: F401
Expand All @@ -22,6 +26,31 @@
from env_test_utils import _run_environments, setup_environment # isort: skip


def _ensure_franka_pour_reset_dataset() -> None:
"""Generate the smallest valid reset dataset when the Pour smoke test needs it."""
repo_root = Path(__file__).resolve().parents[4]
dataset_path = repo_root / "datasets/franka_pour/reset_dataset.pt"
if dataset_path.is_file():
return

subprocess.run(
[
sys.executable,
str(repo_root / "scripts/tools/generate_franka_pour_reset_dataset.py"),
"--device",
"cuda:0",
"--grasping_count",
"100",
"--non_grasping_count",
"6",
"--batch_size",
"128",
],
cwd=repo_root,
check=True,
)


@pytest.mark.parametrize("physics_preset_name", ["newton_mjwarp", "physx", "isaacsim_physx"])
@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")])
@pytest.mark.parametrize(
Expand Down Expand Up @@ -53,4 +82,6 @@ def test_environments(task_name, physics_preset_name, num_envs, device):
)
@pytest.mark.isaacsim_ci
def test_contrib_environments(task_name, num_envs, device):
if task_name == "IsaacContrib-Franka-Pour":
_ensure_franka_pour_reset_dataset()
_run_environments(task_name, device, num_envs, create_stage_in_memory=False)