Skip to content

Commit 94c24c0

Browse files
authored
[Workflow] Fix zero agent and random agent to launch newton visualizer by default (#7518)
# Description The zero and random agents forced the Kit visualizer by default, which launched the Isaac Sim runtime even when a task resolved to Newton physics. This change defaults both checkpoint-free agents to the canonical Newton GL visualizer while preserving explicit --viz overrides. A regression test covers both agent defaults. An isaaclab_rl changelog fragment documents how to retain the Kit visualizer explicitly. Fixes # N/A ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into develop ## Screenshots N/A — workflow default change. ## Validation - uv run --frozen python -m pytest source/isaaclab_rl/test/test_entrypoints.py -q (20 passed, 2 skipped) - uv run --frozen python tools/changelog/cli.py check develop - uv run --frozen isaaclab -f - uv run --frozen isaaclab zero_agent --task Isaac-Cartpole-Direct --num_envs 1 --max_steps 32 physics=newton_mjwarp - uv run --frozen isaaclab random_agent --task Isaac-Cartpole-Direct --num_envs 1 --max_steps 32 physics=newton_mjwarp Both smoke tests initialized NewtonVisualizer and completed without launching Isaac Sim/Kit. In the headless validation shell, the Newton viewer used EGL because DISPLAY was unset. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] I have made corresponding changes to the documentation through the changelog fragment - [x] My changes generate no new warnings - [x] I have added tests that prove the fix is effective - [x] I have added a changelog fragment for every touched package - [x] My name already exists in CONTRIBUTORS.md
1 parent 8ca264b commit 94c24c0

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Changed
2+
^^^^^^^
3+
4+
* Changed the zero and random agents to use the Newton GL visualizer by default. Pass ``--viz kit`` to keep using
5+
the Kit visualizer.

source/isaaclab_rl/isaaclab_rl/entrypoints/simple_agents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ def _parse_args(argv: list[str] | None, policy: PolicyName) -> argparse.Namespac
245245
)
246246
# append AppLauncher cli args
247247
add_launcher_args(parser)
248-
# simple agents should open Kit visualizer by default
249-
parser.set_defaults(visualizer=["kit"])
248+
# Keep checkpoint-free agents on the kitless default path.
249+
parser.set_defaults(visualizer=["newton_gl"])
250250
args_cli, hydra_args = setup_preset_cli(parser, argv)
251251
sys.argv = [sys.argv[0]] + hydra_args
252252
return args_cli

source/isaaclab_rl/test/test_entrypoints.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,19 @@ def test_zero_agent_supports_direct_multi_agent_action_spaces() -> None:
224224
assert torch.equal(actions["object"], torch.zeros(3, 1, dtype=torch.int64))
225225

226226

227+
@pytest.mark.parametrize("policy", ["zero", "random"])
228+
def test_simple_agents_default_to_newton_visualizer(
229+
policy: _simple_agents.PolicyName,
230+
monkeypatch: pytest.MonkeyPatch,
231+
) -> None:
232+
"""Checkpoint-free agents default to Newton visualization."""
233+
monkeypatch.setattr(sys, "argv", ["pytest"])
234+
235+
args = _simple_agents._parse_args([], policy)
236+
237+
assert args.visualizer == ["newton_gl"]
238+
239+
227240
def test_zero_agent_rejects_invalid_config_before_launch(monkeypatch: pytest.MonkeyPatch) -> None:
228241
"""Unsupported task presets fail cleanly before a simulator backend is initialized."""
229242

0 commit comments

Comments
 (0)