Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def __init__(self, root_newton_view, device: str):
self._sim_timestamp = 0.0

# obtain global simulation view
gravity = NewtonManager.get_model().gravity
# Convert to direction vector
gravity_dir = torch.tensor((gravity[0], gravity[1], gravity[2]), device=self.device)
gravity_dir = wp.to_torch(NewtonManager.get_model().gravity)
gravity_dir = math_utils.normalize(gravity_dir.unsqueeze(0)).squeeze(0)

# Initialize constants
Expand Down
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/sim/_impl/newton_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def start_simulation(cls) -> None:
for callback in NewtonManager._on_init_callbacks:
callback()
print(f"[INFO] Finalizing model on device: {NewtonManager._device}")
NewtonManager._builder.gravity = np.array(NewtonManager._gravity_vector)
NewtonManager._builder.gravity = np.array(NewtonManager._gravity_vector)[-1]
NewtonManager._builder.up_axis = Axis.from_string(NewtonManager._up_axis)
with Timer(name="newton_finalize_builder", msg="Finalize builder took:", enable=True, format="ms"):
NewtonManager._model = NewtonManager._builder.finalize(device=NewtonManager._device)
Expand Down
3 changes: 2 additions & 1 deletion source/isaaclab/isaaclab/sim/_impl/newton_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from __future__ import annotations

import newton as nt
import warp as wp
from newton.viewer import ViewerGL


Expand Down Expand Up @@ -150,7 +151,7 @@ def _render_left_panel(self):
imgui.text(f"Environments: {self.model.num_envs}")
axis_names = ["X", "Y", "Z"]
imgui.text(f"Up Axis: {axis_names[self.model.up_axis]}")
gravity = self.model.gravity
gravity = wp.to_torch(self.model.gravity)[0]
gravity_text = f"Gravity: ({gravity[0]:.2f}, {gravity[1]:.2f}, {gravity[2]:.2f})"
imgui.text(gravity_text)

Expand Down
6 changes: 3 additions & 3 deletions source/isaaclab/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"flatdict==4.0.1",
# newton
"usd-core==25.05.0",
"mujoco>=3.3.6.dev802089588",
"mujoco-warp @ git+https://github.com/google-deepmind/mujoco_warp.git@64bb938f87b6aaf840753ef9ddc198db655020c0",
"newton @ git+https://github.com/newton-physics/newton.git@beta-1-1",
"mujoco>=3.3.7.dev811775910",
"mujoco-warp @ git+https://github.com/google-deepmind/mujoco_warp.git@df3d9faac49bf004b26a85d71e339ddb8e6e94f3",
"newton @ git+https://github.com/newton-physics/newton.git@6461b0a7405d805a334bceb7834cf9abf3847f94",
"imgui-bundle==1.92.0",
"PyOpenGL-accelerate==3.1.10",
]
Expand Down
6 changes: 3 additions & 3 deletions source/isaaclab_tasks/test/benchmarking/configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fast:
rsl_rl:Isaac-Humanoid-Direct-v0:
max_iterations: 500
lower_thresholds:
reward: 600
reward: 6000
episode_length: 500
upper_thresholds:
duration: 500
Expand All @@ -56,14 +56,14 @@ fast:
rsl_rl:Isaac-Velocity-Flat-G1-v0:
max_iterations: 500
lower_thresholds:
reward: 15
reward: 20
episode_length: 700
upper_thresholds:
duration: 3000
rsl_rl:Isaac-Velocity-Flat-H1-v0:
max_iterations: 500
lower_thresholds:
reward: 15
reward: 25
episode_length: 700
upper_thresholds:
duration: 3000
Expand Down
10 changes: 10 additions & 0 deletions source/isaaclab_tasks/test/benchmarking/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def pytest_addoption(parser):
default="",
help="Optional tag to add to the KPI payload for filtering on the Grafana dashboard.",
)
parser.addoption(
"--disable_duration_check",
action="store_true",
help="Disable the duration check for the test.",
)


@pytest.fixture
Expand Down Expand Up @@ -71,6 +76,11 @@ def save_kpi_payload(request):
return request.config.getoption("--save_kpi_payload")


@pytest.fixture
def disable_duration_check(request):
return request.config.getoption("--disable_duration_check")


@pytest.fixture
def tag(request):
return request.config.getoption("--tag")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def train_job(workflow, task, env_config, num_gpus):


@pytest.mark.parametrize("task_spec", setup_environment())
def test_train_environments(workflow, task_spec, config_path, mode, num_gpus, kpi_store):
def test_train_environments(workflow, task_spec, config_path, mode, num_gpus, kpi_store, disable_duration_check):
"""Train environments provided in the config file, save KPIs, and evaluate against thresholds"""
# Skip if workflow not supported for this task
if workflow + "_cfg_entry_point" not in task_spec.kwargs:
Expand All @@ -103,7 +103,7 @@ def test_train_environments(workflow, task_spec, config_path, mode, num_gpus, kp

print(f">>> Evaluating trained: {job_name}")
# Check if training logs were output and all thresholds passed
kpi_payload = utils.evaluate_job(workflow, task, env_config, duration)
kpi_payload = utils.evaluate_job(workflow, task, env_config, duration, disable_duration_check)

success_flag = kpi_payload["success"]
print(f">>> Trained {job_name} success flag: {success_flag}.")
Expand Down
4 changes: 3 additions & 1 deletion source/isaaclab_tasks/test/benchmarking/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_env_config(env_configs, mode, workflow, task):
return None


def evaluate_job(workflow, task, env_config, duration):
def evaluate_job(workflow, task, env_config, duration, disable_duration_check=False):
"""Evaluate the job."""
log_data = _retrieve_logs(workflow, task)

Expand All @@ -64,6 +64,8 @@ def evaluate_job(workflow, task, env_config, duration):
return kpi_payload

thresholds = {**env_config.get("lower_thresholds", {}), **env_config.get("upper_thresholds", {})}
if disable_duration_check:
thresholds.pop("duration", None)

# evaluate all thresholds from the config
for threshold_name, threshold_val in thresholds.items():
Expand Down