diff --git a/.github/actions/install-ci-run/action.yml b/.github/actions/install-ci-run/action.yml
index e099be41e561..f86ef7105a33 100644
--- a/.github/actions/install-ci-run/action.yml
+++ b/.github/actions/install-ci-run/action.yml
@@ -48,9 +48,19 @@ runs:
tools/run_install_ci.py "${args[@]}"
- name: Upload JUnit XML report
if: always()
+ id: upload-junit-report
uses: actions/upload-artifact@v7
with:
name: install-ci-junit-${{ runner.arch }}
path: ${{ github.workspace }}/results/results.xml
if-no-files-found: ignore
retention-days: 7
+
+ - name: Upload omni-github test results
+ if: always()
+ uses: ./.github/actions/upload-omni-github-test-results
+ with:
+ junit-file: ${{ github.workspace }}/results/results.xml
+ junit-log-url: ${{ steps.upload-junit-report.outputs.artifact-url }}
+ artifact-prefix: pytest-results-${{ github.job }}-${{ runner.arch }}
+ test-type: installation-e2e
diff --git a/.github/actions/run-package-tests/action.yml b/.github/actions/run-package-tests/action.yml
index 264e01a158b8..211707e48c19 100644
--- a/.github/actions/run-package-tests/action.yml
+++ b/.github/actions/run-package-tests/action.yml
@@ -61,6 +61,14 @@ inputs:
description: 'Comma-separated list of specific test files to include'
default: ''
required: false
+ test-node-ids-file:
+ description: 'TOML file containing exact pytest node IDs to run'
+ default: ''
+ required: false
+ test-node-ids-key:
+ description: 'Top-level key in test-node-ids-file containing the node IDs for this job'
+ default: ''
+ required: false
pytest-options:
description: 'Additional pytest options'
default: ''
@@ -69,6 +77,10 @@ inputs:
description: 'Space-separated pip packages to install inside the Docker container before pytest starts'
default: ''
required: false
+ omni-github-test-type:
+ description: 'Test type stored on each uploaded omni-github test row'
+ default: 'pytest'
+ required: false
container-name:
description: 'Docker container name prefix (run-id is appended automatically)'
required: true
@@ -148,8 +160,11 @@ runs:
curobo-only: ${{ inputs.curobo-only }}
quarantined-only: ${{ inputs.quarantined-only }}
include-files: ${{ inputs.include-files }}
+ test-node-ids-file: ${{ inputs.test-node-ids-file }}
+ test-node-ids-key: ${{ inputs.test-node-ids-key }}
volume-mount-source: ${{ github.workspace }}
extra-pip-packages: ${{ inputs.extra-pip-packages }}
+ omni-github-test-type: ${{ inputs.omni-github-test-type }}
- name: Check Test Results
if: always()
diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml
index ceea3a1c4e65..9a335aeb9ee3 100644
--- a/.github/actions/run-tests/action.yml
+++ b/.github/actions/run-tests/action.yml
@@ -53,6 +53,14 @@ inputs:
description: 'Comma-separated list of specific test file paths to include (e.g., source/pkg/test/test_a.py,source/pkg/test/test_b.py)'
default: ''
required: false
+ test-node-ids-file:
+ description: 'TOML file containing exact pytest node IDs to run'
+ default: ''
+ required: false
+ test-node-ids-key:
+ description: 'Top-level key in test-node-ids-file containing the node IDs for this job'
+ default: ''
+ required: false
shard-index:
description: 'Zero-based index of this shard (used with shard-count to split tests across parallel jobs)'
default: ''
@@ -69,6 +77,10 @@ inputs:
description: 'Space-separated pip packages to install inside the Docker container before pytest starts'
default: ''
required: false
+ omni-github-test-type:
+ description: 'Test type stored on each uploaded omni-github test row'
+ default: 'pytest'
+ required: false
runs:
using: composite
@@ -93,6 +105,8 @@ runs:
local shard_count="${13}"
local volume_mount_source="${14}"
local extra_pip_packages="${15}"
+ local test_node_ids_file="${16}"
+ local test_node_ids_key="${17}"
local logs_pid=""
local wait_pid=""
local docker_wait_file="/tmp/.docker_exit_${container_name}"
@@ -130,10 +144,25 @@ runs:
if [ -n "$include_files" ]; then
echo "Include files: $include_files"
fi
+ if [ -n "$test_node_ids_file" ]; then
+ echo "Test node IDs file: $test_node_ids_file"
+ fi
+ if [ -n "$test_node_ids_key" ]; then
+ echo "Test node IDs key: $test_node_ids_key"
+ fi
if [ -n "$shard_index" ] && [ -n "$shard_count" ]; then
echo "Shard: $shard_index of $shard_count"
fi
+ if [ -n "$test_node_ids_file" ] || [ -n "$test_node_ids_key" ]; then
+ if [ -z "$test_node_ids_file" ] || [ -z "$test_node_ids_key" ]; then
+ echo "Both test-node-ids-file and test-node-ids-key must be set together"
+ return 1
+ fi
+ export TEST_NODE_IDS_FILE="$test_node_ids_file"
+ export TEST_NODE_IDS_KEY="$test_node_ids_key"
+ fi
+
# Create reports directory
mkdir -p "$reports_dir"
@@ -170,6 +199,16 @@ runs:
echo "Setting TEST_INCLUDE_FILES=$include_files_compact"
fi
+ if [ -n "${TEST_NODE_IDS:-}" ]; then
+ docker_env_vars="$docker_env_vars -e TEST_NODE_IDS"
+ echo "Setting TEST_NODE_IDS"
+ fi
+
+ if [ -n "${TEST_NODE_IDS_FILE:-}" ]; then
+ docker_env_vars="$docker_env_vars -e TEST_NODE_IDS_FILE -e TEST_NODE_IDS_KEY"
+ echo "Setting TEST_NODE_IDS_FILE=$TEST_NODE_IDS_FILE TEST_NODE_IDS_KEY=$TEST_NODE_IDS_KEY"
+ fi
+
if [ -n "$shard_index" ] && [ -n "$shard_count" ]; then
docker_env_vars="$docker_env_vars -e TEST_SHARD_INDEX=$shard_index -e TEST_SHARD_COUNT=$shard_count"
echo "Setting TEST_SHARD_INDEX=$shard_index TEST_SHARD_COUNT=$shard_count"
@@ -392,7 +431,7 @@ runs:
}
# Call the function with provided parameters
- run_tests "${{ inputs.test-path }}" "${{ inputs.result-file }}" "${{ inputs.container-name }}" "${{ inputs.image-tag }}" "${{ inputs.reports-dir }}" "${{ inputs.pytest-options }}" "${{ inputs.filter-pattern }}" "${{ inputs.exclude-pattern }}" "${{ inputs.curobo-only }}" "${{ inputs.include-files }}" "${{ inputs.quarantined-only }}" "${{ inputs.shard-index }}" "${{ inputs.shard-count }}" "${{ inputs.volume-mount-source }}" "${{ inputs.extra-pip-packages }}"
+ run_tests "${{ inputs.test-path }}" "${{ inputs.result-file }}" "${{ inputs.container-name }}" "${{ inputs.image-tag }}" "${{ inputs.reports-dir }}" "${{ inputs.pytest-options }}" "${{ inputs.filter-pattern }}" "${{ inputs.exclude-pattern }}" "${{ inputs.curobo-only }}" "${{ inputs.include-files }}" "${{ inputs.quarantined-only }}" "${{ inputs.shard-index }}" "${{ inputs.shard-count }}" "${{ inputs.volume-mount-source }}" "${{ inputs.extra-pip-packages }}" "${{ inputs.test-node-ids-file }}" "${{ inputs.test-node-ids-key }}"
- name: Kill container on cancellation
if: cancelled()
@@ -421,6 +460,7 @@ runs:
- name: Upload comparison images
if: always()
+ id : upload-comparison-images
uses: actions/upload-artifact@v7
with:
name: comparison-images-${{ inputs.container-name }}
@@ -430,6 +470,7 @@ runs:
- name: Upload JUnit XML report
if: always()
+ id: upload-junit-report
uses: actions/upload-artifact@v7
with:
name: junit-${{ inputs.container-name }}
@@ -437,6 +478,16 @@ runs:
if-no-files-found: ignore
retention-days: 7
+ - name: Upload omni-github test results
+ if: always()
+ uses: ./.github/actions/upload-omni-github-test-results
+ with:
+ junit-file: ${{ inputs.reports-dir }}/${{ inputs.result-file }}
+ junit-log-url: ${{ steps.upload-junit-report.outputs.artifact-url }}
+ comparison-images-url: ${{ steps.upload-comparison-images.outputs.artifact-url }}
+ artifact-prefix: pytest-results-${{ github.job }}-${{ inputs.container-name }}
+ test-type: ${{ inputs.omni-github-test-type }}
+
- name: Clean up Docker container
if: always() && !cancelled()
shell: bash
diff --git a/.github/actions/upload-omni-github-test-results/action.yml b/.github/actions/upload-omni-github-test-results/action.yml
new file mode 100644
index 000000000000..80c820a74644
--- /dev/null
+++ b/.github/actions/upload-omni-github-test-results/action.yml
@@ -0,0 +1,119 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+name: 'Upload omni-github test results'
+description: >
+ Converts a JUnit XML report into the omni-github test-result artifact
+ contract and uploads it with the current GitHub repository identity.
+
+inputs:
+ junit-file:
+ description: 'Path to the JUnit XML report to convert'
+ required: true
+ junit-log-url:
+ description: 'URL of the uploaded JUnit XML artifact'
+ default: ''
+ required: false
+ comparison-images-url:
+ description: 'URL of the uploaded comparison images artifact'
+ default: ''
+ required: false
+ artifact-prefix:
+ description: 'Artifact name prefix'
+ required: true
+ test-tool-id:
+ description: 'Identifier for the test runner that produced the JUnit report'
+ default: 'pytest'
+ required: false
+ test-type:
+ description: >-
+ Suite category stored on each uploaded omni-github test row, such as
+ training-e2e, rendering-correctness, pytest, etc.
+ default: 'pytest'
+ required: false
+ retention-days:
+ description: 'GitHub artifact retention in days'
+ default: '7'
+ required: false
+
+runs:
+ using: composite
+ steps:
+ - name: Convert JUnit XML to omni-github results
+ id: convert
+ shell: bash
+ env:
+ ARTIFACT_PREFIX: ${{ inputs.artifact-prefix }}
+ JUNIT_FILE: ${{ inputs.junit-file }}
+ TEST_TOOL_ID: ${{ inputs.test-tool-id }}
+ TEST_TYPE: ${{ inputs.test-type }}
+ run: |
+ set -euo pipefail
+
+ if [ ! -f "$JUNIT_FILE" ]; then
+ echo "::warning::Skipping omni-github upload because JUnit report was not found: $JUNIT_FILE"
+ echo "upload=false" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ case "${RUNNER_OS:-unknown}-${RUNNER_ARCH:-unknown}" in
+ Linux-X64) app_platform="linux-x86_64" ;;
+ Linux-ARM64) app_platform="linux-aarch64" ;;
+ Windows-X64) app_platform="windows-x86_64" ;;
+ Windows-ARM64) app_platform="windows-aarch64" ;;
+ macOS-X64) app_platform="macos-x86_64" ;;
+ macOS-ARM64) app_platform="macos-aarch64" ;;
+ *) app_platform="$(printf '%s-%s' "${RUNNER_OS:-unknown}" "${RUNNER_ARCH:-unknown}" | tr '[:upper:]' '[:lower:]')" ;;
+ esac
+
+ run_attempt="${GITHUB_RUN_ATTEMPT:-1}"
+ retries=0
+
+ # Run attempt > 1 means this job is a re-run, so adjust the retries count accordingly
+ [[ "$run_attempt" =~ ^[1-9][0-9]*$ ]] && retries=$((run_attempt - 1))
+
+ # Base directory for the artifact, which will be uploaded to GitHub
+ artifact_dir="${RUNNER_TEMP}/omni-github-test-results/${ARTIFACT_PREFIX}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${GITHUB_JOB}"
+ rm -rf "$artifact_dir"
+ mkdir -p "$artifact_dir"
+
+ python3 "$GITHUB_ACTION_PATH/junit_to_omni_github_results.py" \
+ --junit-file "$JUNIT_FILE" \
+ --output-dir "$artifact_dir" \
+ --test-tool-id "$TEST_TOOL_ID" \
+ --test-type "$TEST_TYPE" \
+ --app-platform "$app_platform" \
+ --app-config "${GITHUB_JOB:-github-job}" \
+ --group-name "${GITHUB_WORKFLOW:-github-workflow} / ${GITHUB_JOB:-github-job}" \
+ --junit-log-url "${{ inputs.junit-log-url }}" \
+ --comparison-images-url "${{ inputs.comparison-images-url }}" \
+ --retries "$retries"
+
+ result_json="$artifact_dir/_testoutput/test_results.json"
+
+ # Validating with a local pinned copy of the schemas is recommended by the omni-github team.
+ schema_venv="${RUNNER_TEMP}/omni-github-jsonschema-venv"
+ python3 -m venv "$schema_venv"
+ "$schema_venv/bin/python" -m pip install -q jsonschema
+ if ! "$schema_venv/bin/python" -m jsonschema \
+ "$GITHUB_ACTION_PATH/result-json.schema.json" \
+ --instance "$result_json"; then
+ echo "::warning::Skipping omni-github upload because converted results failed schema validation: $JUNIT_FILE"
+ echo "upload=false" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ echo "artifact_dir=$artifact_dir" >> "$GITHUB_OUTPUT"
+ echo "upload=true" >> "$GITHUB_OUTPUT"
+
+ - name: Upload omni-github test results
+ if: always() && steps.convert.outputs.upload == 'true'
+ uses: actions/upload-artifact@v7
+ with:
+ name: ${{ inputs.artifact-prefix }}--v1-${{ github.repository_id }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ job.check_run_id }}
+ path: ${{ steps.convert.outputs.artifact_dir }}
+ if-no-files-found: error
+ retention-days: ${{ inputs.retention-days }}
+ compression-level: 9
diff --git a/.github/actions/upload-omni-github-test-results/junit_to_omni_github_results.py b/.github/actions/upload-omni-github-test-results/junit_to_omni_github_results.py
new file mode 100644
index 000000000000..03a81733bfab
--- /dev/null
+++ b/.github/actions/upload-omni-github-test-results/junit_to_omni_github_results.py
@@ -0,0 +1,215 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Convert a JUnit XML report into the omni-github test-result artifact format."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import xml.etree.ElementTree as ET
+from pathlib import Path
+
+_MANIFEST_NAME = "omni-github-test-results-upload.json"
+_RESULT_PATH = "_testoutput/test_results.json"
+_MAX_MESSAGE_CHARS = 500
+_FLAG_PATTERNS = {
+ "crash": ("abort", "core dumped", "crash", "process killed", "segmentation fault", "signal "),
+ "timeout": ("deadline exceeded", "timed out", "timeout"),
+}
+
+
+def _local_name(tag: str) -> str:
+ """Return an XML tag name without its namespace."""
+ return tag.rsplit("}", maxsplit=1)[-1]
+
+
+def _iter_testcases(root: ET.Element) -> list[ET.Element]:
+ """Return all JUnit testcase elements from the parsed XML tree."""
+ return [element for element in root.iter() if _local_name(element.tag) == "testcase"]
+
+
+def _first_child(testcase: ET.Element, names: set[str]) -> ET.Element | None:
+ """Return the first direct testcase child whose local tag name matches."""
+ for child in testcase:
+ if _local_name(child.tag) in names:
+ return child
+ return None
+
+
+def _duration_seconds(element: ET.Element) -> float:
+ """Return the element duration in seconds."""
+ try:
+ duration = float(element.attrib.get("time", "0"))
+ except ValueError:
+ duration = 0.0
+ return max(duration, 0.0)
+
+
+def _test_id(testcase: ET.Element) -> str:
+ """Return a stable test identifier from JUnit classname and name fields."""
+ parts = [testcase.attrib.get(key, "").strip() for key in ("classname", "name")]
+ return "::".join(part for part in parts if part) or "unknown-testcase"
+
+
+def _short_message(element: ET.Element | None) -> str | None:
+ """Return a compact message from a failure, error, or skip element."""
+ if element is None:
+ return None
+ raw_message = element.attrib.get("message") or element.attrib.get("type") or element.text or ""
+ message = " ".join(raw_message.split())
+ if not message:
+ return None
+ if len(message) > _MAX_MESSAGE_CHARS:
+ return message[: _MAX_MESSAGE_CHARS - 3].rstrip() + "..."
+ return message
+
+
+def _convert_testcase(
+ testcase: ET.Element,
+ test_type: str,
+ group_id: str,
+ retries: int,
+ log_paths: list[str],
+) -> dict[str, object]:
+ """Convert one JUnit testcase element into an omni-github test row."""
+ failure_or_error = _first_child(testcase, {"error", "failure"})
+ skipped = _first_child(testcase, {"skipped"})
+ message = _short_message(failure_or_error)
+ skip_reason = _short_message(skipped)
+ row: dict[str, object] = {
+ "test_id": _test_id(testcase),
+ "passed": failure_or_error is None and skipped is None,
+ "duration": _duration_seconds(testcase),
+ "test_type": test_type,
+ "group_id": group_id,
+ "retries": retries,
+ "log_paths": log_paths,
+ }
+ if testcase.attrib.get("name"):
+ row["test_name"] = testcase.attrib["name"]
+ if skipped is not None:
+ row["skipped"] = True
+ if skip_reason is not None:
+ row["skip_reason"] = skip_reason
+ row.setdefault("message", skip_reason)
+ if message is not None:
+ row["message"] = message
+
+ if failure_or_error is not None:
+ detail_text = " ".join(
+ filter(None, (message, failure_or_error.attrib.get("type"), failure_or_error.text))
+ ).lower()
+ for flag, patterns in _FLAG_PATTERNS.items():
+ if any(pattern in detail_text for pattern in patterns):
+ row[flag] = True
+
+ return row
+
+
+def convert_junit(
+ junit_file: Path,
+ output_dir: Path,
+ test_tool_id: str,
+ test_type: str,
+ app_platform: str,
+ app_config: str,
+ group_name: str,
+ junit_log_url: str,
+ comparison_images_url: str,
+ retries: int = 0,
+) -> None:
+ """Convert a JUnit XML report and write the omni-github artifact directory.
+
+ Args:
+ junit_file: Path to the source JUnit XML report.
+ output_dir: Directory where the artifact root should be written.
+ test_tool_id: Identifier for the test tool that produced the report.
+ test_type: Suite category to store on each converted test row.
+ app_platform: Platform label for the result app metadata.
+ app_config: Configuration label for the result app metadata.
+ group_name: Human-readable test group label to store on each test row.
+ retries: Within-job retry count to store on each test row.
+ junit_log_url: URL of the uploaded source JUnit XML artifact.
+ comparison_images_url: URL of the uploaded comparison images artifact.
+ """
+ root = ET.parse(junit_file).getroot()
+ log_paths: list[str] = []
+ if junit_log_url:
+ log_paths.append(junit_log_url)
+
+ if comparison_images_url:
+ log_paths.append(comparison_images_url)
+
+ tests = []
+ for testcase in _iter_testcases(root):
+ tests.append(
+ _convert_testcase(
+ testcase,
+ test_type,
+ group_name,
+ retries,
+ log_paths=log_paths,
+ )
+ )
+ result: dict[str, object] = {
+ "result_schema_version": 1,
+ "test_tool_id": test_tool_id,
+ "app": {
+ "platform": app_platform,
+ "config": app_config,
+ },
+ "tests": tests,
+ }
+ manifest = {
+ "schema_version": 1,
+ "result_paths": [_RESULT_PATH],
+ }
+
+ result_path = output_dir / _RESULT_PATH
+ result_path.parent.mkdir(parents=True, exist_ok=True)
+ result_path.write_text(json.dumps(result, separators=(",", ":")), encoding="utf-8")
+ (output_dir / _MANIFEST_NAME).write_text(json.dumps(manifest, separators=(",", ":")), encoding="utf-8")
+
+
+def parse_args() -> argparse.Namespace:
+ """Parse command-line arguments."""
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--junit-file", type=Path, required=True, help="Path to the JUnit XML report.")
+ parser.add_argument("--output-dir", type=Path, required=True, help="Artifact root directory to write.")
+ parser.add_argument("--test-tool-id", required=True, help="Identifier for the test tool.")
+ parser.add_argument("--test-type", required=True, help="Suite category for each test row.")
+ parser.add_argument("--app-platform", required=True, help="App platform label.")
+ parser.add_argument("--app-config", required=True, help="App configuration label.")
+ parser.add_argument("--group-name", required=True, help="Human-readable group label for each test row.")
+ parser.add_argument(
+ "--junit-log-url", required=True, type=str, help="URL of the uploaded source JUnit XML artifact."
+ )
+ parser.add_argument(
+ "--comparison-images-url", required=True, type=str, help="URL of the uploaded comparison images artifact."
+ )
+ parser.add_argument("--retries", type=int, default=0, help="Within-job retry count for each test row.")
+ return parser.parse_args()
+
+
+def main() -> None:
+ """Run the converter."""
+ args = parse_args()
+ convert_junit(
+ junit_file=args.junit_file,
+ output_dir=args.output_dir,
+ test_tool_id=args.test_tool_id,
+ test_type=args.test_type,
+ app_platform=args.app_platform,
+ app_config=args.app_config,
+ group_name=args.group_name,
+ junit_log_url=args.junit_log_url,
+ comparison_images_url=args.comparison_images_url,
+ retries=max(args.retries, 0),
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/actions/upload-omni-github-test-results/result-json.schema.json b/.github/actions/upload-omni-github-test-results/result-json.schema.json
new file mode 100644
index 000000000000..f94d55573e25
--- /dev/null
+++ b/.github/actions/upload-omni-github-test-results/result-json.schema.json
@@ -0,0 +1,275 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://omni-github.local/schemas/artifact-upload/result-json.schema.json",
+ "title": "Test result JSON",
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["test_tool_id", "app", "tests"],
+ "properties": {
+ "result_schema_version": {
+ "type": ["integer", "null"],
+ "default": 1,
+ "enum": [1, null]
+ },
+ "test_tool_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 256
+ },
+ "app": {
+ "$ref": "#/$defs/appContext"
+ },
+ "tests": {
+ "type": "array",
+ "minItems": 1,
+ "maxItems": 20000,
+ "items": {
+ "$ref": "#/$defs/testRow"
+ }
+ }
+ },
+ "$defs": {
+ "shortString": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 256
+ },
+ "nullableShortString": {
+ "type": ["string", "null"],
+ "minLength": 1,
+ "maxLength": 256
+ },
+ "messageString": {
+ "type": "string",
+ "maxLength": 4096
+ },
+ "nullableMessageString": {
+ "type": ["string", "null"],
+ "maxLength": 4096
+ },
+ "artifactRelativePath": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 512,
+ "not": {
+ "pattern": "(^/|(^|/)\\.\\.(/|$)|\\\\)"
+ }
+ },
+ "appContext": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["platform"],
+ "properties": {
+ "platform": {
+ "$ref": "#/$defs/shortString"
+ },
+ "config": {
+ "type": ["string", "null"],
+ "minLength": 1,
+ "maxLength": 128,
+ "default": "release"
+ },
+ "python_version": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "app_version": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "kit_version_full": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "kit_build_number": {
+ "type": ["integer", "null"],
+ "minimum": 0
+ },
+ "app_name_full": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "kit_version": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "app_name": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "package": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "kit_git_hash": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "kit_branch": {
+ "$ref": "#/$defs/nullableShortString"
+ }
+ }
+ },
+ "testRow": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["test_id", "passed", "duration"],
+ "properties": {
+ "test_id": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 512
+ },
+ "passed": {
+ "type": "boolean"
+ },
+ "duration": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 86400
+ },
+ "test_name": {
+ "type": ["string", "null"],
+ "minLength": 1,
+ "maxLength": 512
+ },
+ "group_id": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "test_type": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "skipped": {
+ "type": ["boolean", "null"],
+ "default": false
+ },
+ "unreliable": {
+ "type": ["boolean", "null"],
+ "default": false
+ },
+ "crash": {
+ "type": ["boolean", "null"],
+ "default": false
+ },
+ "timeout": {
+ "type": ["boolean", "null"],
+ "default": false
+ },
+ "retries": {
+ "type": ["integer", "null"],
+ "minimum": 0,
+ "maximum": 100,
+ "default": 0
+ },
+ "owner": {
+ "$ref": "#/$defs/nullableShortString"
+ },
+ "skip_reason": {
+ "$ref": "#/$defs/nullableMessageString"
+ },
+ "message": {
+ "$ref": "#/$defs/nullableMessageString"
+ },
+ "log_paths": {
+ "anyOf": [
+ {
+ "type": "array",
+ "maxItems": 20,
+ "items": {
+ "$ref": "#/$defs/artifactRelativePath"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "app": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/appContext"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "custom": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/customObject"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "customObject": {
+ "type": "object",
+ "minProperties": 1,
+ "maxProperties": 20,
+ "propertyNames": {
+ "pattern": "^[a-z][a-z0-9_]*$"
+ },
+ "additionalProperties": {
+ "$ref": "#/$defs/customNamespace"
+ }
+ },
+ "customNamespace": {
+ "type": "object",
+ "minProperties": 1,
+ "maxProperties": 50,
+ "propertyNames": {
+ "pattern": "^[a-z][a-z0-9_]*$"
+ },
+ "additionalProperties": {
+ "$ref": "#/$defs/customValue"
+ }
+ },
+ "customValue": {
+ "oneOf": [
+ {
+ "type": "string",
+ "maxLength": 1024
+ },
+ {
+ "type": "integer"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ },
+ {
+ "type": "array",
+ "maxItems": 100,
+ "items": {
+ "oneOf": [
+ {
+ "type": "string",
+ "maxLength": 1024
+ },
+ {
+ "type": "integer"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ }
+ },
+ {
+ "type": "object",
+ "maxProperties": 20,
+ "propertyNames": {
+ "pattern": "^[a-z][a-z0-9_]*$"
+ },
+ "additionalProperties": {
+ "$ref": "#/$defs/customValue"
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/.github/actions/upload-omni-github-test-results/test_junit_to_omni_github_results.py b/.github/actions/upload-omni-github-test-results/test_junit_to_omni_github_results.py
new file mode 100644
index 000000000000..e25ce26d3a15
--- /dev/null
+++ b/.github/actions/upload-omni-github-test-results/test_junit_to_omni_github_results.py
@@ -0,0 +1,169 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Tests for the omni-github JUnit result converter."""
+
+from __future__ import annotations
+
+import importlib.util
+import json
+from pathlib import Path
+from types import ModuleType
+
+_MODULE_PATH = Path(__file__).with_name("junit_to_omni_github_results.py")
+_RESULT_PATH = "_testoutput/test_results.json"
+
+
+def _load_converter_module() -> ModuleType:
+ """Load the converter module from the local GitHub action directory."""
+ spec = importlib.util.spec_from_file_location("junit_to_omni_github_results", _MODULE_PATH)
+ assert spec is not None
+ assert spec.loader is not None
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(module)
+ return module
+
+
+def _load_rows(output_dir: Path) -> list[dict[str, object]]:
+ """Load converted rows from the omni-github result artifact."""
+ result = json.loads((output_dir / _RESULT_PATH).read_text(encoding="utf-8"))
+ return result["tests"]
+
+
+def test_convert_junit_populates_github_metadata_and_failure_details(tmp_path: Path) -> None:
+ """Converted JUnit rows should carry grouping, retry, and message metadata."""
+ converter = _load_converter_module()
+ junit_file = tmp_path / "report.xml"
+ output_dir = tmp_path / "out"
+ junit_file.write_text(
+ """
+
+
+ Traceback details
+
+
+
+
+
+
+""",
+ encoding="utf-8",
+ )
+
+ converter.convert_junit(
+ junit_file=junit_file,
+ output_dir=output_dir,
+ test_tool_id="pytest",
+ test_type="pytest",
+ app_platform="linux-x86_64",
+ app_config="test-job",
+ group_name="Docker + Tests / isaaclab_tasks [1/3]",
+ junit_log_url="",
+ comparison_images_url="",
+ retries=2,
+ )
+
+ rows = _load_rows(output_dir)
+ failed, skipped, passed = rows
+ assert failed["test_id"] == "source.isaaclab.test.foo.test_sample::test_fails[param]"
+ assert failed["test_name"] == "test_fails[param]"
+ assert failed["passed"] is False
+ assert failed["duration"] == 1.25
+ assert failed["group_id"] == "Docker + Tests / isaaclab_tasks [1/3]"
+ assert failed["retries"] == 2
+ assert failed["message"] == "AssertionError: expected 1, got 2"
+
+ assert skipped["passed"] is False
+ assert skipped["skipped"] is True
+ assert skipped["skip_reason"] == "requires GPU"
+ assert skipped["message"] == "requires GPU"
+
+ assert passed["passed"] is True
+ assert "message" not in passed
+
+
+def test_convert_junit_marks_crashes_and_timeouts(tmp_path: Path) -> None:
+ """Converted rows should surface crash and timeout messages."""
+ converter = _load_converter_module()
+ junit_file = tmp_path / "report.xml"
+ output_dir = tmp_path / "out"
+ junit_file.write_text(
+ """
+
+
+ diagnostics
+
+
+""",
+ encoding="utf-8",
+ )
+
+ converter.convert_junit(
+ junit_file=junit_file,
+ output_dir=output_dir,
+ test_tool_id="pytest",
+ test_type="rendering-correctness",
+ app_platform="linux-x86_64",
+ app_config="test-job",
+ group_name="Docker + Tests / environments",
+ junit_log_url="",
+ comparison_images_url="",
+ retries=0,
+ )
+
+ rows = _load_rows(output_dir)
+ assert rows == [
+ {
+ "crash": True,
+ "duration": 0.0,
+ "group_id": "Docker + Tests / environments",
+ "log_paths": [],
+ "message": "Process killed by signal 15 after timeout",
+ "passed": False,
+ "retries": 0,
+ "test_id": "test_rendering_cartpole::test_execution",
+ "test_name": "test_execution",
+ "test_type": "rendering-correctness",
+ "timeout": True,
+ }
+ ]
+
+
+def test_convert_junit_adds_log_paths_for_junit_and_comparison_artifacts(tmp_path: Path) -> None:
+ """Converted rows should point at the uploaded JUnit and comparison image artifacts."""
+ converter = _load_converter_module()
+ reports_dir = tmp_path
+ output_dir = tmp_path / "out"
+ junit_file = reports_dir / "report.xml"
+ junit_log_url = "https://github.com/isaac-sim/IsaacLab/actions/runs/123/artifacts/456"
+ comparison_images_url = "https://github.com/isaac-sim/IsaacLab/actions/runs/123/artifacts/789"
+
+ junit_file.write_text(
+ """
+
+
+
+""",
+ encoding="utf-8",
+ )
+
+ converter.convert_junit(
+ junit_file=junit_file,
+ output_dir=output_dir,
+ test_tool_id="pytest",
+ test_type="rendering-correctness",
+ app_platform="linux-x86_64",
+ app_config="test-job",
+ group_name="Docker + Tests / rendering",
+ junit_log_url=junit_log_url,
+ comparison_images_url=comparison_images_url,
+ retries=0,
+ )
+
+ rows = _load_rows(output_dir)
+ assert rows[0]["log_paths"] == [
+ junit_log_url,
+ comparison_images_url,
+ ]
diff --git a/.github/test-subsets/postmerge-rendering.toml b/.github/test-subsets/postmerge-rendering.toml
new file mode 100644
index 000000000000..ee52d8f1f548
--- /dev/null
+++ b/.github/test-subsets/postmerge-rendering.toml
@@ -0,0 +1,34 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Stable rendering correctness tests used by post-merge CI.
+rendering-correctness = [
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[newton-isaacsim_rtx-albedo]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[newton-isaacsim_rtx-depth]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[newton-isaacsim_rtx-rgb]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[newton-isaacsim_rtx-semantic_segmentation]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[physx-isaacsim_rtx-albedo]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[physx-isaacsim_rtx-depth]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[physx-isaacsim_rtx-rgb]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[physx-isaacsim_rtx-semantic_segmentation]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[physx-newton_warp-depth]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole.py::test_rendering_cartpole[physx-newton_warp-rgb]",
+ "source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py::test_rendering_registered_tasks[Isaac-Cartpole-Camera-Direct-albedo-cartpole]",
+ "source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py::test_rendering_registered_tasks[Isaac-Cartpole-Camera-Direct-depth-cartpole]",
+ "source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py::test_rendering_registered_tasks[Isaac-Cartpole-Camera-Direct-None-cartpole]",
+ "source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py::test_rendering_registered_tasks[Isaac-Cartpole-Camera-Direct-rgb-cartpole]",
+]
+
+rendering-correctness-kitless = [
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[newton-newton_warp-depth]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[newton-newton_warp-rgb]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[newton-ovrtx-albedo]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[newton-ovrtx-depth]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[ovphysx-newton_warp-depth]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[ovphysx-newton_warp-rgb]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[ovphysx-ovrtx-albedo]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[ovphysx-ovrtx-rgb]",
+ "source/isaaclab_tasks/test/core/test_rendering_cartpole_kitless.py::test_rendering_cartpole_kitless[ovphysx-ovrtx-semantic_segmentation]",
+]
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5d715d4e2945..9bf03560cddd 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -4,7 +4,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# region help
-# Every test job runs on every PR.
+# Every test job runs on every PR and merge queue candidate. Pushes to protected branches run the
+# post-merge integration tests.
#
# =============================================================================
# CI DEBUGGING TIPS
@@ -46,6 +47,11 @@
name: Docker + Tests
on:
+ push:
+ branches:
+ - main
+ - develop
+ - 'release/**'
pull_request:
types: [opened, synchronize, reopened]
branches:
@@ -67,7 +73,6 @@ permissions:
env:
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
- CI_IMAGE_TAG: isaac-lab-ci:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}-${{ github.sha }}
jobs:
changes:
@@ -100,8 +105,13 @@ jobs:
$'^\\.github/workflows/build\\.yaml$\tThis workflow file'
$'^\\.github/workflows/config\\.yaml$\tBase image config'
$'^\\.github/actions/\tCI actions'
+ $'^\\.github/test-subsets/\tCI test subset config'
)
- triggered_jobs="Docker build jobs + all test-* matrix jobs"
+ if [ "$EVENT_NAME" = "push" ]; then
+ triggered_jobs="Docker base build job + rendering-correctness + rendering-correctness-kitless"
+ else
+ triggered_jobs="Docker build jobs + all test-* matrix jobs"
+ fi
render_table() {
local files="$1" entry regex desc count sample shown
@@ -181,6 +191,7 @@ jobs:
isaacsim_image_name: ${{ steps.load.outputs.isaacsim_image_name }}
isaacsim_image_tag: ${{ steps.load.outputs.isaacsim_image_tag }}
isaaclab_image_name: ${{ steps.load.outputs.isaaclab_image_name }}
+ ci_image_tag: ${{ steps.image_tag.outputs.ci_image_tag }}
steps:
- uses: actions/checkout@v6
with:
@@ -194,6 +205,26 @@ jobs:
echo "isaacsim_image_name=$(yq -r .isaacsim_image_name "$f")" >> "$GITHUB_OUTPUT"
echo "isaacsim_image_tag=$(yq -r .isaacsim_image_tag "$f")" >> "$GITHUB_OUTPUT"
echo "isaaclab_image_name=$(yq -r .isaaclab_image_name "$f")" >> "$GITHUB_OUTPUT"
+ - id: image_tag
+ shell: bash
+ env:
+ EVENT_NAME: ${{ github.event_name }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ REF_NAME: ${{ github.ref_name }}
+ SHA: ${{ github.sha }}
+ run: |
+ set -euo pipefail
+
+ if [ "$EVENT_NAME" = "pull_request" ]; then
+ ref_component="pr-${PR_NUMBER}"
+ else
+ ref_component="$REF_NAME"
+ fi
+
+ # Sanitize the ref name for use as a Docker tag suffix.
+ sanitized_ref=$(echo "$ref_component" | sed 's/[^a-zA-Z0-9._-]/-/g')
+ echo "ci_image_tag=isaac-lab-ci:${sanitized_ref}-${SHA}" >> "$GITHUB_OUTPUT"
+ echo "CI image tag: isaac-lab-ci:${sanitized_ref}-${SHA}"
#region build jobs
build:
@@ -211,7 +242,7 @@ jobs:
- name: Build and push to ECR
uses: ./.github/actions/ecr-build-push-pull
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
dockerfile-path: docker/Dockerfile.base
@@ -221,7 +252,9 @@ jobs:
name: Build cuRobo Docker Image
runs-on: [self-hosted, gpu]
needs: [changes, config]
- if: needs.changes.outputs.run_docker_tests == 'true'
+ if: >-
+ github.event_name != 'push' &&
+ needs.changes.outputs.run_docker_tests == 'true'
steps:
- name: Checkout Code
uses: actions/checkout@v6
@@ -232,7 +265,7 @@ jobs:
- name: Build and push to ECR
uses: ./.github/actions/ecr-build-push-pull
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}-curobo
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}-curobo
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
dockerfile-path: docker/Dockerfile.curobo
@@ -247,7 +280,9 @@ jobs:
timeout-minutes: 180
continue-on-error: true
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -255,7 +290,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_tasks"
@@ -270,7 +305,9 @@ jobs:
timeout-minutes: 180
continue-on-error: true
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -278,7 +315,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_tasks"
@@ -293,7 +330,9 @@ jobs:
timeout-minutes: 180
continue-on-error: true
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -301,7 +340,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_tasks"
@@ -315,7 +354,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -323,7 +364,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "not isaaclab_"
@@ -336,7 +377,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -344,7 +387,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "not isaaclab_"
@@ -357,7 +400,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -365,7 +410,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "not isaaclab_"
@@ -378,7 +423,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -386,7 +433,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_rl"
@@ -398,7 +445,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -406,7 +455,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_mimic"
@@ -417,7 +466,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -425,7 +476,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_contrib"
@@ -436,7 +487,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -444,7 +497,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_teleop"
@@ -455,7 +508,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -463,7 +518,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_visualizers"
@@ -474,7 +529,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -482,7 +539,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_assets"
@@ -493,7 +550,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -501,7 +560,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_newton"
@@ -512,7 +571,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -520,7 +581,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_physx"
@@ -531,7 +592,9 @@ jobs:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -539,7 +602,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_ov"
@@ -556,14 +619,14 @@ jobs:
docker run --rm \
-v "$PWD":/workspace/isaaclab \
--entrypoint bash \
- "${{ env.CI_IMAGE_TAG }}" \
+ "${{ needs.config.outputs.ci_image_tag }}" \
-lc 'cd /workspace/isaaclab && /isaac-sim/python.sh -m pytest docker/test/test_dockerfile_nonroot.py -q'
- name: Verify Base runtime user is non-root
shell: bash
run: |
set -euo pipefail
- runtime_identity="$(docker run --rm --entrypoint bash "${{ env.CI_IMAGE_TAG }}" \
+ runtime_identity="$(docker run --rm --entrypoint bash "${{ needs.config.outputs.ci_image_tag }}" \
-lc 'printf "%s %s %s\n" "$(id -u)" "$(id -g)" "$(id -un 2>/dev/null || true)"')"
read -r runtime_uid runtime_gid runtime_user <<< "${runtime_identity}"
echo "Base runtime identity: uid=${runtime_uid} gid=${runtime_gid} user=${runtime_user}"
@@ -578,7 +641,9 @@ jobs:
timeout-minutes: 120
continue-on-error: true
needs: [build-curobo, config]
- if: needs.build-curobo.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build-curobo.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -586,7 +651,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}-curobo
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}-curobo
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
dockerfile-path: docker/Dockerfile.curobo
@@ -604,14 +669,14 @@ jobs:
docker run --rm \
-v "$PWD":/workspace/isaaclab \
--entrypoint bash \
- "${{ env.CI_IMAGE_TAG }}-curobo" \
+ "${{ needs.config.outputs.ci_image_tag }}-curobo" \
-lc 'cd /workspace/isaaclab && /isaac-sim/python.sh -m pytest docker/test/test_dockerfile_nonroot.py -q'
- name: Verify cuRobo runtime user is non-root
shell: bash
run: |
set -euo pipefail
- runtime_identity="$(docker run --rm --entrypoint bash "${{ env.CI_IMAGE_TAG }}-curobo" \
+ runtime_identity="$(docker run --rm --entrypoint bash "${{ needs.config.outputs.ci_image_tag }}-curobo" \
-lc 'printf "%s %s %s\n" "$(id -u)" "$(id -g)" "$(id -un 2>/dev/null || true)"')"
read -r runtime_uid runtime_gid runtime_user <<< "${runtime_identity}"
echo "cuRobo runtime identity: uid=${runtime_uid} gid=${runtime_gid} user=${runtime_user}"
@@ -626,7 +691,9 @@ jobs:
timeout-minutes: 120
continue-on-error: true
needs: [build-curobo, config]
- if: needs.build-curobo.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build-curobo.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -634,7 +701,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}-curobo
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}-curobo
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
dockerfile-path: docker/Dockerfile.curobo
@@ -648,7 +715,9 @@ jobs:
timeout-minutes: 300
continue-on-error: true
needs: [build, config]
- if: needs.build.result == 'success'
+ if: >-
+ github.event_name != 'push' &&
+ needs.build.result == 'success'
steps:
- uses: actions/checkout@v6
with:
@@ -656,18 +725,19 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_tasks"
include-files: "test_environments_training.py"
container-name: isaac-lab-environments-training-test
+ omni-github-test-type: training-e2e
test-rendering-correctness:
name: "rendering-correctness"
runs-on: [self-hosted, gpu]
timeout-minutes: 120
- continue-on-error: true
+ continue-on-error: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
needs: [build, config]
if: needs.build.result == 'success'
steps:
@@ -677,7 +747,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_tasks"
@@ -687,13 +757,16 @@ jobs:
test_rendering_dexsuite_kuka_hetero.py,
test_rendering_registered_tasks.py,
test_rendering_shadow_hand.py
+ test-node-ids-file: ${{ github.event_name == 'push' && '.github/test-subsets/postmerge-rendering.toml' || '' }}
+ test-node-ids-key: ${{ github.event_name == 'push' && 'rendering-correctness' || '' }}
container-name: isaac-lab-rendering-correctness-test
+ omni-github-test-type: rendering-correctness
test-rendering-correctness-kitless:
name: "rendering-correctness-kitless"
runs-on: [self-hosted, gpu]
timeout-minutes: 120
- continue-on-error: true
+ continue-on-error: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
needs: [build, config]
if: needs.build.result == 'success'
steps:
@@ -703,7 +776,7 @@ jobs:
lfs: true
- uses: ./.github/actions/run-package-tests
with:
- image-tag: ${{ env.CI_IMAGE_TAG }}
+ image-tag: ${{ needs.config.outputs.ci_image_tag }}
isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
filter-pattern: "isaaclab_tasks"
@@ -713,7 +786,10 @@ jobs:
test_rendering_dexsuite_kuka_homo_kitless.py,
test_rendering_dexsuite_kuka_hetero_kitless.py,
test_rendering_shadow_hand_kitless.py
+ test-node-ids-file: ${{ github.event_name == 'push' && '.github/test-subsets/postmerge-rendering.toml' || '' }}
+ test-node-ids-key: ${{ github.event_name == 'push' && 'rendering-correctness-kitless' || '' }}
container-name: isaac-lab-rendering-correctness-kitless-test
+ omni-github-test-type: rendering-correctness-kitless
#endregion
#region disabled quarantined tests
@@ -733,7 +809,7 @@ jobs:
# lfs: true
# - uses: ./.github/actions/run-package-tests
# with:
-# image-tag: ${{ env.CI_IMAGE_TAG }}
+# image-tag: ${{ needs.config.outputs.ci_image_tag }}
# isaacsim-base-image: ${{ needs.config.outputs.isaacsim_image_name }}
# isaacsim-version: ${{ needs.config.outputs.isaacsim_image_tag }}
# quarantined-only: "true"
diff --git a/.github/workflows/install-ci.yml b/.github/workflows/install-ci.yml
index 8d86eec15fca..226222d425bd 100644
--- a/.github/workflows/install-ci.yml
+++ b/.github/workflows/install-ci.yml
@@ -30,6 +30,7 @@ concurrency:
permissions:
contents: read
pull-requests: read
+
jobs:
changes:
name: Detect Changes
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 7c63d42f56ec..51c86b8af989 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -110,6 +110,7 @@ Guidelines for modifications:
* Jingzhou Liu
* Jinqi Wei
* Jinyeob Kim
+* Jiwen Cai
* Johnson Sun
* Juana Du
* Kaixi Bao
@@ -184,6 +185,7 @@ Guidelines for modifications:
* Tsz Ki GAO
* Tyler Lum
* Victor Khaustov
+* Vidur Vij
* Virgilio Gómez Lambo
* Vladimir Fokow
* Wei Yang
diff --git a/docker/.env.base b/docker/.env.base
index 0cc9ff09c016..555a91fd5aea 100644
--- a/docker/.env.base
+++ b/docker/.env.base
@@ -6,9 +6,8 @@
ACCEPT_EULA=Y
# NVIDIA Isaac Sim base image
ISAACSIM_BASE_IMAGE=nvcr.io/nvidia/isaac-sim
-# NVIDIA Isaac Sim version to use (e.g. 6.0.0-dev2)
-# TODO(AntoineRichard): Revert to stable 6.0.0 tag once it ships on NGC
-ISAACSIM_VERSION=6.0.0-dev2
+# NVIDIA Isaac Sim version to use (e.g. 6.0.0)
+ISAACSIM_VERSION=6.0.0
# Derived from the default path in the NVIDIA provided Isaac Sim container
DOCKER_ISAACSIM_ROOT_PATH=/isaac-sim
# The Isaac Lab path in the container
diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base
index 646c9af9ab46..f46bc3f89b21 100644
--- a/docker/Dockerfile.base
+++ b/docker/Dockerfile.base
@@ -88,15 +88,11 @@ RUN install_carb_env_shim() { \
# arm64-only build deps:
# - imgui-bundle has no prebuilt arm64 wheel; needs GL/X11 dev headers.
-# - swig is required for the nlopt source build (see arm64 nlopt step below).
-# - libgmp-dev is required by pytetwild's fTetWild source build (no aarch64 wheel for 0.2.3).
RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
apt-get update && \
apt-get install -y --no-install-recommends \
libgl1-mesa-dev libopengl-dev libglx-dev \
- libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev \
- libgmp-dev \
- swig; \
+ libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev; \
fi
# copy files necessary for installing Isaac Lab and its dependencies
@@ -143,23 +139,26 @@ RUN touch /bin/nvidia-smi && \
mkdir -p /var/run/nvidia-persistenced && \
touch /var/run/nvidia-persistenced/socket
-# On arm64, pre-install nlopt 2.6.2 (transitively pinned by isaacteleop[retargeters]).
-# There is no aarch64 wheel for this version, and pip's isolated build env hides the
-# system numpy from nlopt's cmake-based build, so we install it manually with
-# --no-build-isolation. setuptools+wheel+numpy must be importable in the host Python
-# for that mode (PEP 517 backend lookup). The subsequent isaaclab.sh --install then
-# sees nlopt as already satisfied and skips the from-source rebuild that would fail.
+# On arm64, temporarily install swig for the nlopt source build, keep it
+# through the Isaac Lab dependency install, then purge it before the layer ends.
+# This lets ./isaaclab.sh --install see nlopt as already satisfied without
+# leaving swig in the final container filesystem.
RUN --mount=type=cache,target=${DOCKER_USER_HOME}/.cache/pip \
if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
+ apt-get update && \
+ apt-get install -y --no-install-recommends swig && \
${ISAACLAB_PATH}/isaaclab.sh -p -m pip install setuptools wheel numpy && \
${ISAACLAB_PATH}/isaaclab.sh -p -m pip install --no-build-isolation nlopt==2.6.2; \
+ fi && \
+ ${ISAACLAB_PATH}/isaaclab.sh --install && \
+ if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
+ ${ISAACLAB_PATH}/isaaclab.sh -p -c "import nlopt" && \
+ apt-get purge -y --auto-remove swig && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/* && \
+ if command -v swig >/dev/null 2>&1; then exit 1; fi; \
fi
-# installing Isaac Lab dependencies
-# use pip caching to avoid reinstalling large packages
-RUN --mount=type=cache,target=${DOCKER_USER_HOME}/.cache/pip \
- ${ISAACLAB_PATH}/isaaclab.sh --install
-
# HACK: Remove install of quadprog dependency
RUN ${ISAACLAB_PATH}/isaaclab.sh -p -m pip uninstall -y quadprog
diff --git a/docker/Dockerfile.curobo b/docker/Dockerfile.curobo
index b63fdacdf980..598b7ea9a429 100644
--- a/docker/Dockerfile.curobo
+++ b/docker/Dockerfile.curobo
@@ -51,13 +51,11 @@ RUN apt-get update && \
# arm64-only build deps:
# - imgui-bundle has no prebuilt arm64 wheel; needs GL/X11 dev headers.
-# - swig is required for the nlopt source build (see arm64 nlopt step below).
RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
apt-get update && \
apt-get install -y --no-install-recommends \
libgl1-mesa-dev libopengl-dev libglx-dev \
- libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev \
- swig; \
+ libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev; \
fi
# Detect Ubuntu version and install CUDA 12.8 via NVIDIA network repo (cuda-keyring)
@@ -152,23 +150,26 @@ RUN rm -rf ${ISAACSIM_ROOT_PATH}/kit/python/lib/python3.12/site-packages/pip* &&
${ISAACLAB_PATH}/_isaac_sim/kit/python/bin/python3 get-pip.py && \
rm get-pip.py
-# On arm64, pre-install nlopt 2.6.2 (transitively pinned by isaacteleop[retargeters]).
-# There is no aarch64 wheel for this version, and pip's isolated build env hides the
-# system numpy from nlopt's cmake-based build, so we install it manually with
-# --no-build-isolation. setuptools+wheel+numpy must be importable in the host Python
-# for that mode (PEP 517 backend lookup). The subsequent isaaclab.sh --install then
-# sees nlopt as already satisfied and skips the from-source rebuild that would fail.
+# On arm64, temporarily install swig for the nlopt source build, keep it
+# through the Isaac Lab dependency install, then purge it before the layer ends.
+# This lets ./isaaclab.sh --install see nlopt as already satisfied without
+# leaving swig in the final container filesystem.
RUN --mount=type=cache,target=${DOCKER_USER_HOME}/.cache/pip \
if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
+ apt-get update && \
+ apt-get install -y --no-install-recommends swig && \
${ISAACLAB_PATH}/isaaclab.sh -p -m pip install setuptools wheel numpy && \
${ISAACLAB_PATH}/isaaclab.sh -p -m pip install --no-build-isolation nlopt==2.6.2; \
+ fi && \
+ ${ISAACLAB_PATH}/isaaclab.sh --install && \
+ if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
+ ${ISAACLAB_PATH}/isaaclab.sh -p -c "import nlopt" && \
+ apt-get purge -y --auto-remove swig && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/* && \
+ if command -v swig >/dev/null 2>&1; then exit 1; fi; \
fi
-# installing Isaac Lab dependencies
-# use pip caching to avoid reinstalling large packages
-RUN --mount=type=cache,target=${DOCKER_USER_HOME}/.cache/pip \
- ${ISAACLAB_PATH}/isaaclab.sh --install
-
# HACK: Uninstall quadprog as it causes issues with some reinforcement learning frameworks
RUN ${ISAACLAB_PATH}/isaaclab.sh -p -m pip uninstall -y quadprog
diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst
index 2ff0cf6174be..a0bfe388449a 100644
--- a/docs/source/api/index.rst
+++ b/docs/source/api/index.rst
@@ -214,6 +214,7 @@ The following modules are available in the ``isaaclab_ovphysx`` extension:
assets
cloner
physics
+ sim.views
isaaclab_experimental extension
diff --git a/docs/source/api/lab_ovphysx/isaaclab_ovphysx.sim.views.rst b/docs/source/api/lab_ovphysx/isaaclab_ovphysx.sim.views.rst
new file mode 100644
index 000000000000..a2a93b474e58
--- /dev/null
+++ b/docs/source/api/lab_ovphysx/isaaclab_ovphysx.sim.views.rst
@@ -0,0 +1,4 @@
+isaaclab\_ovphysx.sim.views
+===========================
+
+.. automodule:: isaaclab_ovphysx.sim.views
diff --git a/docs/source/deployment/docker.rst b/docs/source/deployment/docker.rst
index c5a540de66a0..c5eadb3c5416 100644
--- a/docs/source/deployment/docker.rst
+++ b/docs/source/deployment/docker.rst
@@ -322,7 +322,7 @@ To pull the minimal Isaac Lab container, run:
.. code:: bash
- docker pull nvcr.io/nvidia/isaac-lab:3.0.0-beta1
+ docker pull nvcr.io/nvidia/isaac-lab:3.0.0-beta2
.. attention::
@@ -353,7 +353,7 @@ To run the Isaac Lab container with an interactive bash session, run:
-v ~/docker/isaac-sim/logs:/root/.nvidia-omniverse/logs:rw \
-v ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw \
-v ~/docker/isaac-sim/documents:/root/Documents:rw \
- nvcr.io/nvidia/isaac-lab:3.0.0-beta1
+ nvcr.io/nvidia/isaac-lab:3.0.0-beta2
To enable rendering through X11 forwarding, run:
@@ -372,7 +372,7 @@ To enable rendering through X11 forwarding, run:
-v ~/docker/isaac-sim/logs:/root/.nvidia-omniverse/logs:rw \
-v ~/docker/isaac-sim/data:/root/.local/share/ov/data:rw \
-v ~/docker/isaac-sim/documents:/root/Documents:rw \
- nvcr.io/nvidia/isaac-lab:3.0.0-beta1
+ nvcr.io/nvidia/isaac-lab:3.0.0-beta2
To run an example within the container, run:
diff --git a/docs/source/features/hydra.rst b/docs/source/features/hydra.rst
index 711b224124af..9e75dd17db2c 100644
--- a/docs/source/features/hydra.rst
+++ b/docs/source/features/hydra.rst
@@ -411,6 +411,8 @@ to make intent explicit on the command line.
- Newton Warp renderer
* - ``ovrtx_renderer``
- OV RTX renderer
+ * - ``rtx``
+ - Automatic RTX renderer selection (Isaac Sim RTX when running with Isaac Sim, and OVRTX for kit-less)
Domain presets (observation modes, camera configurations, etc.) are task-specific.
Pass ``--task= --help`` to a training command to see all presets available
diff --git a/docs/source/overview/core-concepts/sensors/camera.rst b/docs/source/overview/core-concepts/sensors/camera.rst
index 9505dd74b180..23a6f5f11dae 100644
--- a/docs/source/overview/core-concepts/sensors/camera.rst
+++ b/docs/source/overview/core-concepts/sensors/camera.rst
@@ -38,19 +38,19 @@ The renderer used by a camera is configured via the ``renderer_cfg`` field on
- Supported data types
* - ``IsaacRtxRendererCfg`` *(default)*
- Yes
- - rgb, rgba, depth, normals, motion vectors, semantic/instance segmentation, and all other annotators
+ - All annotators (rgb, rgba, depth, distances, normals, motion vectors, semantic/instance segmentation)
* - ``NewtonWarpRendererCfg``
- No (kit-less)
- - ``rgb``, ``depth`` only
+ - rgb, rgba, rgb_hdr, depth, normals, instance segmentation
* - ``OVRTXRendererCfg``
- No (+ ``isaaclab_ov``)
- - ``rgb``, ``depth`` only
+ - rgb, rgba, rgb_hdr, depth, distances, normals, semantic segmentation
.. note::
- The Newton Warp renderer currently supports only **``rgb``** and **``depth``** data types.
- Annotators such as segmentation, normals, and motion vectors are Isaac RTX-specific features and
- require :class:`~isaaclab_physx.renderers.IsaacRtxRendererCfg`.
+ Backends differ in which annotators they produce. See
+ :ref:`the support matrix ` below for the
+ per-annotator breakdown across the Isaac RTX, OVRTX, and Newton Warp renderers.
Tiled Rendering
@@ -177,20 +177,15 @@ When using the RTX renderer, add ``--enable_cameras`` when launching:
--task=Isaac-Cartpole-Camera-Direct --enable_cameras
-Annotators (RTX only)
-~~~~~~~~~~~~~~~~~~~~~
-
-.. note::
+Annotators
+~~~~~~~~~~
- Annotators are a feature of the **Isaac RTX renderer** (``IsaacRtxRendererCfg``).
- They are **not** available with the Newton Warp renderer or ovrtx, which
- support only ``rgb`` and ``depth``.
-
-:class:`~sensors.Camera` exposes the following annotator
-data types when using the RTX renderer:
+:class:`~sensors.Camera` exposes the following annotator data types. Not every
+backend produces every annotator — see the support matrix below.
* ``"rgb"``: A 3-channel rendered color image.
* ``"rgba"``: A 4-channel rendered color image with alpha channel.
+* ``"rgb_hdr"``: A 3-channel scene-linear HDR color image.
* ``"distance_to_camera"``: Distance to the camera optical center per pixel.
* ``"distance_to_image_plane"``: Distance along the camera's Z-axis per pixel.
* ``"depth"``: Alias for ``"distance_to_image_plane"``.
@@ -200,6 +195,69 @@ data types when using the RTX renderer:
* ``"instance_segmentation_fast"``: Instance segmentation data.
* ``"instance_id_segmentation_fast"``: Instance ID segmentation data.
+.. _camera-supported-annotators:
+
+Supported annotators by renderer backend
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following matrix shows which annotators each renderer backend can produce.
+``Isaac RTX`` is :class:`~isaaclab_physx.renderers.IsaacRtxRendererCfg`, ``OVRTX``
+is :class:`~isaaclab_ov.renderers.OVRTXRendererCfg`, and ``Newton Warp`` is
+:class:`~isaaclab_newton.renderers.NewtonWarpRendererCfg`.
+
+.. list-table::
+ :header-rows: 1
+ :widths: 40 20 20 20
+
+ * - Data type
+ - Isaac RTX
+ - OVRTX
+ - Newton Warp
+ * - ``rgb``
+ - ✅
+ - ✅
+ - ✅
+ * - ``rgba``
+ - ✅
+ - ✅
+ - ✅
+ * - ``rgb_hdr``
+ - ✅
+ - ✅
+ - ✅
+ * - ``distance_to_camera``
+ - ✅
+ - ✅
+ - ❌
+ * - ``distance_to_image_plane``
+ - ✅
+ - ✅
+ - ❌
+ * - ``depth``
+ - ✅
+ - ✅
+ - ✅
+ * - ``normals``
+ - ✅
+ - ✅
+ - ✅
+ * - ``motion_vectors``
+ - ✅
+ - ❌
+ - ❌
+ * - ``semantic_segmentation``
+ - ✅
+ - ✅
+ - ❌
+ * - ``instance_segmentation_fast``
+ - ✅
+ - ❌
+ - ✅
+ * - ``instance_id_segmentation_fast``
+ - ✅
+ - ❌
+ - ❌
+
RGB and RGBA
~~~~~~~~~~~~
diff --git a/docs/source/overview/environments.rst b/docs/source/overview/environments.rst
index a9e6bc94cd2f..fc7fdb0951e3 100644
--- a/docs/source/overview/environments.rst
+++ b/docs/source/overview/environments.rst
@@ -68,7 +68,7 @@ modes. The **Presets** column in each table below is divided into three labeled
(e.g. ``physx``, ``newton_mjwarp``, ``newton_kamino``, ``ovphysx``,
``newton_mjwarp_vbd``)
* **renderer=** — renderer-backend name passed as ``renderer=NAME``
- (e.g. ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``)
+ (e.g. ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``)
* **presets=** — environment-specific (domain) preset name passed as
``presets=NAME[,NAME,...]``
(e.g. ``rgb``, ``depth``, ``single_camera``, ``duo_camera``)
@@ -910,14 +910,14 @@ inferencing, including reading from an already trained checkpoint and disabling
- Manager Based
- **rl_games** (PPO, FEATURE), **rsl_rl** (PPO, FEATURE)
- | **physics=** ``newton_kamino``, ``newton_mjwarp``, ``physx``
- | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
| **presets=** ``albedo``, ``depth``, ``resnet18``, ``rgb``, ``semantic_segmentation``, ``simple_shading_constant_diffuse``, ``simple_shading_diffuse_mdl``, ``simple_shading_full_mdl``, ``theia_tiny``
* - Isaac-Cartpole-Camera-Direct
-
- Direct
- **rl_games** (PPO), **rsl_rl** (PPO), **skrl** (PPO)
- | **physics=** ``newton_kamino``, ``newton_mjwarp``, ``ovphysx``, ``physx``
- | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
| **presets=** ``albedo``, ``depth``, ``rgb``, ``semantic_segmentation``, ``simple_shading_constant_diffuse``, ``simple_shading_diffuse_mdl``, ``simple_shading_full_mdl``
* - IsaacContrib-Cartpole-Camera-Showcase-Direct
-
@@ -1104,7 +1104,7 @@ inferencing, including reading from an already trained checkpoint and disabling
-
- Manager Based
- **rsl_rl** (PPO)
- - | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ - | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
| **presets=** ``albedo128``, ``albedo256``, ``albedo64``, ``cube``, ``depth128``, ``depth256``, ``depth64``, ``duo_camera``, ``raycaster_depth128``, ``raycaster_depth256``, ``raycaster_depth64``, ``rgb128``, ``rgb256``, ``rgb64``, ``semantic_segmentation128``, ``semantic_segmentation256``, ``semantic_segmentation64``, ``shapes``, ``simple_shading_constant_diffuse128``, ``simple_shading_constant_diffuse256``, ``simple_shading_constant_diffuse64``, ``simple_shading_diffuse_mdl128``, ``simple_shading_diffuse_mdl256``, ``simple_shading_diffuse_mdl64``, ``simple_shading_full_mdl128``, ``simple_shading_full_mdl256``, ``simple_shading_full_mdl64``, ``single_camera``
* - Isaac-Lift-KukaAllegro-Play
-
@@ -1281,14 +1281,14 @@ inferencing, including reading from an already trained checkpoint and disabling
- Direct
- **rl_games** (PPO), **rsl_rl** (PPO)
- | **physics=** ``newton_mjwarp``, ``physx``
- | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
| **presets=** ``albedo``, ``depth``, ``full``, ``rgb``, ``semantic_segmentation``, ``simple_shading_constant_diffuse``, ``simple_shading_diffuse_mdl``, ``simple_shading_full_mdl``
* - Isaac-Reorient-Cube-Shadow-Camera-Direct-Play
-
- Direct
- **rl_games** (PPO), **rsl_rl** (PPO)
- | **physics=** ``newton_mjwarp``, ``physx``
- | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
| **presets=** ``albedo``, ``depth``, ``full``, ``rgb``, ``semantic_segmentation``, ``simple_shading_constant_diffuse``, ``simple_shading_diffuse_mdl``, ``simple_shading_full_mdl``
* - Isaac-Reorient-Cube-Shadow-Direct
-
@@ -1314,7 +1314,7 @@ inferencing, including reading from an already trained checkpoint and disabling
-
- Manager Based
- **rsl_rl** (PPO)
- - | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ - | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
| **presets=** ``albedo128``, ``albedo256``, ``albedo64``, ``cube``, ``depth128``, ``depth256``, ``depth64``, ``duo_camera``, ``raycaster_depth128``, ``raycaster_depth256``, ``raycaster_depth64``, ``rgb128``, ``rgb256``, ``rgb64``, ``semantic_segmentation128``, ``semantic_segmentation256``, ``semantic_segmentation64``, ``shapes``, ``simple_shading_constant_diffuse128``, ``simple_shading_constant_diffuse256``, ``simple_shading_constant_diffuse64``, ``simple_shading_diffuse_mdl128``, ``simple_shading_diffuse_mdl256``, ``simple_shading_diffuse_mdl64``, ``simple_shading_full_mdl128``, ``simple_shading_full_mdl256``, ``simple_shading_full_mdl64``, ``single_camera``
* - Isaac-Reorient-KukaAllegro-Play
-
@@ -1386,7 +1386,7 @@ inferencing, including reading from an already trained checkpoint and disabling
- Manager Based
-
- | **physics=** ``newton_mjwarp``, ``physx``
- | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``
+ | **renderer=** ``isaacsim_rtx_renderer``, ``newton_renderer``, ``ovrtx_renderer``, ``rtx``
* - IsaacContrib-Stack-Cube-Galbot-Right-Arm-Suction-RmpFlow
-
- Manager Based
diff --git a/docs/source/setup/installation/index.rst b/docs/source/setup/installation/index.rst
index 18c83f3b6980..fef6b41726bd 100644
--- a/docs/source/setup/installation/index.rst
+++ b/docs/source/setup/installation/index.rst
@@ -103,6 +103,8 @@ Other notable limitations with respect to Isaac Lab include...
``pytetwild`` wheel is available for ARM (aarch64). ``pytetwild`` is required for
automatic tetrahedral mesh generation of volume deformables.
+#. RLinf support has not been verified on DGX Spark.
+
.. note::
**Build prerequisites on aarch64:** Some Python packages (notably ``imgui-bundle`` and ``quadprog``) do not ship
diff --git a/docs/source/setup/installation/isaaclab_pip_installation.rst b/docs/source/setup/installation/isaaclab_pip_installation.rst
index 4da9ee305ee3..1fa49c5532cc 100644
--- a/docs/source/setup/installation/isaaclab_pip_installation.rst
+++ b/docs/source/setup/installation/isaaclab_pip_installation.rst
@@ -32,7 +32,7 @@ pip extras include:
* - ``isaacsim``
- Isaac Sim (``isaacsim[all,extscache]==6.0.0.1``) from `pypi.nvidia.com `_
* - ``all``
- - RL frameworks (SB3, SKRL, RL-Games, RSL-RL). Combine with ``isaacsim`` for a full install.
+ - RL frameworks (SB3, SKRL, RSL-RL). Combine with ``isaacsim`` for a full install.
Install with ``isaaclab[isaacsim,all]`` for the full workflow.
@@ -50,6 +50,15 @@ Install with ``isaaclab[isaacsim,all]`` for the full workflow.
pip install "isaaclab[isaacsim,all]" --extra-index-url https://pypi.nvidia.com --pre
+.. note::
+
+ ``rl_games`` is not included in the Isaac Lab pip wheel extras. If your workflow requires
+ ``rl_games``, install it manually from the Isaac Lab-compatible branch:
+
+ .. code-block:: bash
+
+ pip install "rl-games @ git+https://github.com/isaac-sim/rl_games.git@python3.11" gym standard-distutils
+
Installing dependencies
~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/source/setup/quickstart_details.rst b/docs/source/setup/quickstart_details.rst
index 7346f5614e68..7e3e8f504ce7 100644
--- a/docs/source/setup/quickstart_details.rst
+++ b/docs/source/setup/quickstart_details.rst
@@ -84,16 +84,24 @@ Available Presets
- ``isaacsim_rtx_renderer`` — Isaac Sim RTX (default with Isaac Sim)
- ``newton_renderer`` — Newton Warp renderer
- ``ovrtx_renderer`` — OV RTX renderer (kit-less)
+- ``rtx`` — automatic RTX renderer selection
**Domain presets** (``presets=NAME[,NAME,...]``) are task-specific — run
``--task= --help`` to list them.
+Use ``renderer=rtx`` for automatic RTX selection on tasks that expose the
+multi-backend renderer selector. The selection follows the runtime: it uses
+Isaac Sim RTX when the run needs Isaac Sim/Kit, such as ``physics=physx`` or
+``--visualizer kit``, and uses OVRTX when the run is fully kit-less. For example,
+``physics=ovphysx renderer=rtx`` selects OVRTX;
+
Common combinations:
.. code-block:: bash
physics=newton_mjwarp renderer=newton_renderer presets=rgb
physics=newton_mjwarp renderer=newton_renderer presets=depth
+ physics=newton_mjwarp renderer=rtx presets=rgb
physics=physx renderer=isaacsim_rtx_renderer presets=rgb
physics=physx renderer=isaacsim_rtx_renderer presets=depth
physics=physx renderer=isaacsim_rtx_renderer presets=albedo
diff --git a/source/isaaclab/changelog.d/jmart-cartpole-rtx.minor.rst b/source/isaaclab/changelog.d/jmart-cartpole-rtx.minor.rst
deleted file mode 100644
index c7b1de77a767..000000000000
--- a/source/isaaclab/changelog.d/jmart-cartpole-rtx.minor.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-Added
-^^^^^
-
-* Added the :meth:`~isaaclab.physics.physics_manager.PhysicsManager.provides_implicit_damping` and
- :meth:`~isaaclab.renderers.base_renderer.BaseRenderer.provides_temporal_camera_data` capability
- classmethods on the runtime backend bases, so physics and renderer backends declare whether a
- camera observation carries the temporal information a policy needs to infer velocity (used to
- decide frame stacking). Base defaults: physics has implicit damping (``True``); a renderer
- provides no temporal data (``False``).
-* Added :meth:`~isaaclab.renderers.Renderer.resolve_class` to resolve a renderer's implementation
- class from its configuration without instantiating it (so tasks can query the above classmethod
- before a simulation exists).
diff --git a/source/isaaclab/changelog.d/jmart-dr-reset.rst b/source/isaaclab/changelog.d/jmart-dr-reset.rst
deleted file mode 100644
index 9088b9800e13..000000000000
--- a/source/isaaclab/changelog.d/jmart-dr-reset.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Fixed
-^^^^^
-
-* Fixed a crash where :class:`~isaaclab.envs.mdp.randomize_visual_color` used in ``reset`` mode
- raised ``AttributeError: 'NoneType' object has no attribute 'link_count'`` during environment
- startup on the PhysX backend. The randomizer authored USD (``SetInstanceable`` and material
- binding) on the articulation root prim, which invalidated the PhysX articulation view so that
- the subsequent at-play body-name resolution dereferenced a ``None`` metatype. It now scopes to
- descendant visual prims, mirroring :class:`~isaaclab.envs.mdp.randomize_visual_texture_material`.
diff --git a/source/isaaclab/changelog.d/vidurv-schema-frag-jointdrive.minor.rst b/source/isaaclab/changelog.d/vidurv-schema-frag-jointdrive.minor.rst
new file mode 100644
index 000000000000..03873c2b0efb
--- /dev/null
+++ b/source/isaaclab/changelog.d/vidurv-schema-frag-jointdrive.minor.rst
@@ -0,0 +1,22 @@
+Added
+^^^^^
+
+* Added the joint-drive schema-fragment API: the
+ :class:`~isaaclab.sim.schemas.JointDriveFragment` marker and
+ :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` (writing the typed multi-instance
+ ``UsdPhysics.DriveAPI`` attributes). The drive fragment overrides its ``func`` with
+ :func:`~isaaclab.sim.schemas.apply_drive`, which selects the angular/linear instance, performs
+ the radian-to-degree conversion for angular drives, and skips tendon child prims.
+* Added :func:`~isaaclab.sim.schemas.apply_joint_drive_properties` (applies a list of joint-drive
+ fragments to all joint prims under a path; ``UsdPhysics.DriveAPI`` is presence-gated and applied
+ only when a :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` fragment is present).
+
+Changed
+^^^^^^^
+
+* Changed the spawner ``joint_drive_props`` slot
+ (:attr:`~isaaclab.sim.spawners.FileCfg.joint_drive_props`) to also accept a list of
+ :class:`~isaaclab.sim.schemas.JointDriveFragment` fragments. Legacy single cfgs continue to work
+ through a transition bridge at the from-files spawn site. Added the spawner-level
+ ``ensure_drives_exist`` flag to reproduce the legacy minimal-stiffness behaviour for the fragment
+ path.
diff --git a/source/isaaclab/changelog.d/vidurv-schema-frag-meshcollision.minor.rst b/source/isaaclab/changelog.d/vidurv-schema-frag-meshcollision.minor.rst
new file mode 100644
index 000000000000..3532b8f68ffe
--- /dev/null
+++ b/source/isaaclab/changelog.d/vidurv-schema-frag-meshcollision.minor.rst
@@ -0,0 +1,20 @@
+Added
+^^^^^
+
+* Added the mesh-collision schema-fragment API: the
+ :class:`~isaaclab.sim.schemas.MeshCollisionFragment` marker and
+ :class:`~isaaclab.sim.schemas.UsdPhysicsMeshCollisionCfg` (carrying the standard
+ ``physics:approximation`` token via ``UsdPhysics.MeshCollisionAPI``).
+* Added :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`, which applies
+ ``UsdPhysics.MeshCollisionAPI`` as the implicit anchor, resolves the
+ ``physics:approximation`` token from whichever cooking fragment is present (validated against
+ :const:`~isaaclab.sim.schemas.MESH_APPROXIMATION_TOKENS`), and dispatches each fragment via its
+ ``func``.
+
+Changed
+^^^^^^^
+
+* Changed the mesh-converter ``mesh_collision_props`` slot
+ (:attr:`~isaaclab.sim.converters.MeshConverterCfg.mesh_collision_props`) to also accept a list of
+ :class:`~isaaclab.sim.schemas.MeshCollisionFragment` fragments. Legacy single cfgs continue to
+ work through a transition bridge in the converter.
diff --git a/source/isaaclab/config/extension.toml b/source/isaaclab/config/extension.toml
index 6fd0197bebd3..bad36771b56e 100644
--- a/source/isaaclab/config/extension.toml
+++ b/source/isaaclab/config/extension.toml
@@ -1,7 +1,7 @@
[package]
# Note: Semantic Versioning is used: https://semver.org/
-version = "7.0.5"
+version = "7.4.0"
# Description
title = "Isaac Lab framework for Robot Learning"
diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst
index ba7727cba561..a229b694a3a4 100644
--- a/source/isaaclab/docs/CHANGELOG.rst
+++ b/source/isaaclab/docs/CHANGELOG.rst
@@ -1,6 +1,181 @@
Changelog
---------
+7.4.0 (2026-06-27)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added an ``"adaptive_dls"`` ``ik_method`` to :class:`~isaaclab.controllers.DifferentialIKController`:
+ a manipulability-aware damped least squares whose damping ramps from ``lambda_min`` toward
+ ``lambda_max`` as the smallest task-Jacobian singular value drops below ``sigma_thresh``
+ (Maciejewski-Klein style), keeping low-DOF / near-singular arms well-conditioned.
+* Added an optional per-axis :attr:`~isaaclab.controllers.differential_ik_cfg.DifferentialIKControllerCfg.orientation_weight`
+ (scalar or ``(wx, wy, wz)``) that soft-weights the orientation rows of a ``"pose"`` task, so an
+ arm that cannot serve a full 6-DOF pose degrades gracefully instead of leaking orientation error
+ into position.
+* Added null-space joint-limit avoidance to :class:`~isaaclab.controllers.DifferentialIKController`
+ via :attr:`~isaaclab.controllers.differential_ik_cfg.DifferentialIKControllerCfg.joint_limit_avoidance_gain` /
+ :attr:`~isaaclab.controllers.differential_ik_cfg.DifferentialIKControllerCfg.joint_limit_avoidance_margin` and
+ :meth:`~isaaclab.controllers.DifferentialIKController.set_joint_pos_limits`. When enabled, a
+ center-seeking bias is projected into the null space of the position rows so it never perturbs
+ the commanded end-effector position; :class:`~isaaclab.envs.mdp.actions.task_space_actions.DifferentialInverseKinematicsAction`
+ injects the joint limits automatically.
+* Added the tendon schema-fragment markers
+ :class:`~isaaclab.sim.schemas.FixedTendonFragment` and
+ :class:`~isaaclab.sim.schemas.SpatialTendonFragment`, which type the spawner
+ ``fixed_tendons_props`` / ``spatial_tendons_props`` slots.
+* Added :func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties` and
+ :func:`~isaaclab.sim.schemas.apply_spatial_tendon_properties`, the family writers that
+ dispatch a list of tendon fragments via each fragment's ``func``. Tendons are a
+ *tune-not-apply* family, so the writers tune the existing multi-instance tendon schemas
+ without applying a new anchor schema.
+
+Changed
+^^^^^^^
+
+* Changed :meth:`~isaaclab.controllers.DifferentialIKController.set_command` to renormalize the
+ commanded quaternion for absolute ``"pose"`` commands, hardening the controller against slightly
+ non-unit quaternion inputs. Existing unit-quaternion callers are unaffected.
+* Changed the spawner ``fixed_tendons_props`` / ``spatial_tendons_props`` slots
+ (:attr:`~isaaclab.sim.spawners.from_files.FileCfg.fixed_tendons_props`,
+ :attr:`~isaaclab.sim.spawners.from_files.FileCfg.spatial_tendons_props`) to also accept one
+ or more tendon fragments. Legacy single cfgs continue to work through a transition bridge in
+ the spawn writer.
+* :func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties` and
+ :func:`~isaaclab.sim.schemas.apply_spatial_tendon_properties` now raise
+ ``ValueError`` when the prim at ``prim_path`` does not exist in the stage.
+ Callers that previously relied on an implicit no-op for invalid paths must
+ either validate the path beforehand or catch ``ValueError``.
+ The aggregated return value is now ``False`` whenever any fragment applier
+ reports failure; callers must not assume the return is always ``True`` even
+ when the prim is valid.
+
+Fixed
+^^^^^
+
+* Fixed native (non-Docker) ARM installation failing when ``swig`` is missing.
+ The ``nlopt==2.6.2`` source build now installs ``swig`` via apt only for the
+ duration of the build and purges it afterwards, so the GPL-licensed ``swig``
+ is never left behind — in particular it is never shipped in the Docker image.
+* Fixed Linux ARM installation by pre-installing ``nlopt==2.6.2`` before
+ Isaac Lab dependencies are resolved, and by keeping ``swig`` available in
+ Docker only until dependency installation completes.
+
+
+7.3.0 (2026-06-26)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added the mass schema-fragment API: the :class:`~isaaclab.sim.schemas.MassFragment` marker and
+ :class:`~isaaclab.sim.schemas.MassCfg` (writes ``physics:mass`` / ``physics:density`` via
+ ``UsdPhysics.MassAPI``). The legacy :class:`~isaaclab.sim.schemas.MassPropertiesCfg` remains the
+ canonical name and continues to work unchanged.
+* Added :func:`~isaaclab.sim.schemas.apply_mass_properties`, which applies a list of mass fragments
+ with ``UsdPhysics.MassAPI`` as the implicit anchor.
+* Added the collision schema-fragment API: the
+ :class:`~isaaclab.sim.schemas.CollisionFragment` marker and
+ :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` (the ``physics:collisionEnabled``
+ single-namespace fragment). Each fragment carries ``_usd_namespace`` / ``_usd_applied_schema``
+ metadata and a ``func`` applier so a prim can carry collision properties from multiple USD
+ namespaces at once.
+* Added :func:`~isaaclab.sim.schemas.apply_collision_properties`, which applies a list of
+ collision fragments with ``UsdPhysics.CollisionAPI`` as the implicit anchor.
+
+Changed
+^^^^^^^
+
+* Changed automatic ``rtx`` launch-time renderer resolution to support the
+ ``renderer=rtx`` selector.
+* Changed the spawner ``mass_props`` slot
+ (:attr:`~isaaclab.sim.spawners.RigidObjectSpawnerCfg.mass_props`) to also accept a single
+ :class:`~isaaclab.sim.schemas.MassFragment` or a list of them. Legacy
+ :class:`~isaaclab.sim.schemas.MassPropertiesCfg` cfgs continue to work through a transition bridge
+ in the spawn writers.
+* Changed the spawner ``collision_props`` slot
+ (:attr:`~isaaclab.sim.spawners.RigidObjectSpawnerCfg.collision_props`) and the mesh-converter
+ ``collision_props`` slot to also accept a list of
+ :class:`~isaaclab.sim.schemas.CollisionFragment` fragments. Legacy single cfgs continue to work
+ through a transition bridge in the spawn writers.
+
+Fixed
+^^^^^
+
+* Fixed :func:`~isaaclab.sim.schemas.apply_mass_properties` to raise ``ValueError`` on an invalid
+ prim path and to aggregate per-fragment results instead of always returning ``True``, matching
+ :func:`~isaaclab.sim.schemas.apply_rigid_body_properties`.
+* Fixed the spawn writers so an empty ``mass_props`` list is a harmless no-op rather than being
+ forwarded to :func:`~isaaclab.sim.schemas.define_mass_properties` as an unexpected list.
+
+
+7.2.0 (2026-06-25)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :func:`~isaaclab.utils.renderers.isaac_rtx_per_env_scene_partition_enabled` to
+ query whether per-environment Isaac RTX scene partitioning is enabled. Set
+ ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` to enable authoring of
+ ``primvars:omni:scenePartition`` and ``omni:scenePartition`` on the USD stage.
+* Added the single-namespace schema-fragment API: :class:`~isaaclab.sim.schemas.SchemaFragment`,
+ the :class:`~isaaclab.sim.schemas.RigidBodyFragment` marker, and
+ :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg`. Each fragment carries
+ ``_usd_namespace`` / ``_usd_applied_schema`` metadata and a ``func`` applier so a prim can
+ carry rigid-body properties from multiple USD namespaces at once.
+* Added :func:`~isaaclab.sim.schemas.apply_namespaced` (generic fragment writer) and
+ :func:`~isaaclab.sim.schemas.apply_rigid_body_properties` (applies a list of rigid-body
+ fragments with ``UsdPhysics.RigidBodyAPI`` as the implicit anchor).
+
+Changed
+^^^^^^^
+
+* Changed the spawner ``rigid_props`` slot
+ (:attr:`~isaaclab.sim.spawners.RigidObjectSpawnerCfg.rigid_props`) to also accept a list of
+ :class:`~isaaclab.sim.schemas.RigidBodyFragment` fragments. Legacy single cfgs continue to
+ work through a transition bridge in the spawn writers.
+
+Fixed
+^^^^^
+
+* Fixed :func:`~isaaclab.sim.save_stage` rewriting URI asset paths, such as
+ DomeLight texture URLs, into relative filesystem paths.
+
+
+7.1.0 (2026-06-24)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added the :meth:`~isaaclab.physics.physics_manager.PhysicsManager.provides_implicit_damping` and
+ :meth:`~isaaclab.renderers.base_renderer.BaseRenderer.provides_temporal_camera_data` capability
+ classmethods on the runtime backend bases, so physics and renderer backends declare whether a
+ camera observation carries the temporal information a policy needs to infer velocity (used to
+ decide frame stacking). Base defaults: physics has implicit damping (``True``); a renderer
+ provides no temporal data (``False``).
+* Added :meth:`~isaaclab.renderers.Renderer.resolve_class` to resolve a renderer's implementation
+ class from its configuration without instantiating it (so tasks can query the above classmethod
+ before a simulation exists).
+
+Fixed
+^^^^^
+
+* Fixed a crash where :class:`~isaaclab.envs.mdp.randomize_visual_color` used in ``reset`` mode
+ raised ``AttributeError: 'NoneType' object has no attribute 'link_count'`` during environment
+ startup on the PhysX backend. The randomizer authored USD (``SetInstanceable`` and material
+ binding) on the articulation root prim, which invalidated the PhysX articulation view so that
+ the subsequent at-play body-name resolution dereferenced a ``None`` metatype. It now scopes to
+ descendant visual prims, mirroring :class:`~isaaclab.envs.mdp.randomize_visual_texture_material`.
+* Fixed the wheel-builder ``newton[sim]`` dependency pin to use Newton commit
+ ``79e95bf5571d70a0a46c8eaedc80644531d27368``, including the
+ RenderContext triangle-mesh construction fix from `newton-physics/newton#3199
+ `_.
+
+
7.0.5 (2026-06-23)
~~~~~~~~~~~~~~~~~~
@@ -451,8 +626,6 @@ Added
:func:`~isaaclab.sim.utils.resolve_matching_prims_from_source` to allow callers to opt out of
the default no-match error.
* Added Kit version, kernel version, and git hash logging to :class:`~isaaclab.app.AppLauncher` startup.
-* Added the ``rl-games`` optional dependency to the ``isaaclab`` wheel and
- included it in the wheel's ``all`` extra.
* Added :attr:`~isaaclab.managers.EventTermCfg.resample_interval_on_reset` to allow ``"interval"``
event terms to keep their per-environment timer across resets while still firing asynchronously
per environment. Defaults to ``True`` to preserve the existing behavior.
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 39662d3e967c..0a5ac08a1101 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -22,8 +22,10 @@
from typing import Any
from isaaclab_newton.physics import NewtonCfg
+from isaaclab_ov.renderers import OVRTXRendererCfg
from isaaclab_ovphysx.physics import OvPhysxCfg
from isaaclab_physx.physics import PhysxCfg
+from isaaclab_physx.renderers import IsaacRtxRendererCfg
from isaaclab.physics.physics_manager_cfg import PhysicsCfg
from isaaclab.renderers.renderer_cfg import RendererCfg
@@ -78,6 +80,11 @@ def _is_ovrtx_renderer(node) -> bool:
return isinstance(node, RendererCfg) and getattr(node, "renderer_type", None) == "ovrtx"
+def _is_auto_rtx_renderer(node) -> bool:
+ """True when the node is an automatic RTX renderer placeholder."""
+ return getattr(node, "renderer_type", None) == "auto_rtx"
+
+
def _is_kit_camera(node) -> bool:
"""True for a CameraCfg whose renderer requires Kit (not Newton)."""
if not isinstance(node, CameraCfg):
@@ -85,6 +92,10 @@ def _is_kit_camera(node) -> bool:
renderer_cfg = getattr(node, "renderer_cfg", None)
if renderer_cfg is None:
return True
+ if _is_auto_rtx_renderer(renderer_cfg):
+ # ``auto_rtx`` is resolved after the initial scan once physics and
+ # visualizer intent are known; ie. it may become OVRTX for a kitless run.
+ return False
if isinstance(renderer_cfg, RendererCfg):
return renderer_cfg.renderer_type in ("default", "isaac_rtx")
# PresetCfg renderers (e.g. MultiBackendRendererCfg) are resolved during
@@ -182,10 +193,12 @@ def _get_visualizer_intent(cfg) -> dict[str, bool]:
class Scan:
"""Signals gathered from one walk of the config tree (see :func:`scan`).
- Every field is a plain snapshot computed during that single walk; nothing here
- is recomputed or mutated afterwards. ``needs_kit`` is the headline decision: a
- Kit-renderer camera or non-kitless physics requires Kit (the launcher additionally
- forces Kit when ``--visualizer kit`` is requested).
+ Every field starts as a plain snapshot computed during that single walk.
+ Automatic RTX renderer placeholders are also recorded so launch-time resolution
+ can update the renderer-related fields without traversing the config tree again.
+ ``needs_kit`` is the headline decision: a Kit-renderer camera or non-kitless
+ physics requires Kit (the launcher additionally forces Kit when ``--visualizer
+ kit`` is requested).
"""
resolved_physics_cfg: PhysicsCfg | None # first physics config in walk order (post --physics override)
@@ -199,21 +212,30 @@ class Scan:
needs_kit: bool
-def scan(cfg, physics_str: str | None = None) -> Scan:
+def scan(cfg, launcher_args: argparse.Namespace | dict | None = None) -> Scan:
"""Walk *cfg* once, collecting all launch signals and applying ``--physics``.
- When *physics_str* is set, every physics config is replaced by the requested
- backend (see :func:`make_physics_cfg`): nested configs in place, a root config
- via :attr:`Scan.effective_cfg` (it cannot be mutated in place).
+ When the ``physics`` key is present in *launcher_args*, every physics config is
+ replaced by the requested backend (see :func:`make_physics_cfg`): nested configs
+ in place, a root config via :attr:`Scan.effective_cfg` (it cannot be mutated in
+ place). Automatic RTX renderer placeholders (``renderer_type="auto_rtx"``) are
+ also resolved at this stage using the full *launcher_args* context.
"""
+ physics_str = _get_arg(launcher_args, "physics", None)
physics_cfgs: list[PhysicsCfg] = []
effective_cfg: Any = cfg
has_ovrtx = False
+ has_auto_rtx = False
has_kit_camera = False
+ auto_rtx_locations: list[tuple[Any, Any, bool]] = [] # (parent, key, is_cam_renderer) for each auto RTX placeholder
visited: set[int] = set()
- def visit(node, parent, attr):
- nonlocal effective_cfg, has_ovrtx, has_kit_camera
+ def visit(node, parent, key):
+ nonlocal effective_cfg, has_ovrtx, has_auto_rtx, has_kit_camera
+ if _is_auto_rtx_renderer(node):
+ has_auto_rtx = True
+ auto_rtx_locations.append((parent, key, isinstance(parent, CameraCfg) and key == "renderer_cfg"))
+
if id(node) in visited:
return
visited.add(id(node))
@@ -222,7 +244,7 @@ def visit(node, parent, attr):
if physics_str:
node = make_physics_cfg(physics_str)
if parent is not None:
- setattr(parent, attr, node)
+ setattr(parent, key, node)
else:
effective_cfg = node
physics_cfgs.append(node)
@@ -244,7 +266,7 @@ def visit(node, parent, attr):
names = [type(pcfg).__name__ for pcfg in physics_cfgs]
has_kitless_physics = any(name in _KITLESS_PHYSICS_CFGS for name in names)
- return Scan(
+ config_scan = Scan(
resolved_physics_cfg=physics_cfgs[0] if physics_cfgs else None,
effective_cfg=effective_cfg,
visualizer_intent=_get_visualizer_intent(cfg),
@@ -256,20 +278,54 @@ def visit(node, parent, attr):
needs_kit=has_kit_camera or not has_kitless_physics,
)
+ # Resolve recorded auto RTX renderer placeholders
+ if not has_auto_rtx:
+ return config_scan
+
+ use_isaac_sim = _uses_isaac_sim_runtime(config_scan, launcher_args)
+ renderer_factory = IsaacRtxRendererCfg if use_isaac_sim else OVRTXRendererCfg
+
+ # Resolve every auto RTX placeholder in place, tracking camera renderers that may require Kit.
+ has_auto_camera = False
+ for location in auto_rtx_locations:
+ if location[0] is None:
+ raise ValueError("Automatic RTX renderer placeholders cannot be resolved as the root config.")
+ setattr(location[0], location[1], renderer_factory())
+ has_auto_camera = has_auto_camera or location[2]
+
+ # Update the scan with the resolved auto RTX renderer type and Kit-camera status.
+ if use_isaac_sim:
+ config_scan.has_kit_camera = config_scan.has_kit_camera or has_auto_camera
+ else:
+ config_scan.has_ovrtx = True
+ config_scan.needs_kit = config_scan.has_kit_camera or not config_scan.has_kitless_physics
+
+ return config_scan
+
"""
Launch Decisions (derived purely from a scan).
"""
+def _has_kit_visualizer(config_scan: Scan, launcher_args: argparse.Namespace | dict | None) -> bool:
+ """Return whether the run requests the Kit visualizer through config or CLI."""
+ visualizer_types = _get_visualizer_types(launcher_args)
+ return "kit" in visualizer_types or config_scan.visualizer_intent["has_kit_visualizer"]
+
+
+def _uses_isaac_sim_runtime(config_scan: Scan, launcher_args: argparse.Namespace | dict | None) -> bool:
+ """Return whether the scanned config requires Isaac Sim / Kit."""
+ return config_scan.needs_kit or _has_kit_visualizer(config_scan, launcher_args)
+
+
def _validate_runtime(scan: Scan, launcher_args: argparse.Namespace | dict | None) -> None:
"""Raise if *scan*'s physics/renderer/visualizer combination is unsupported.
OVRTX is kitless and cannot share a process with Kit-based runtimes (PhysX physics
or the Kit visualizer); OvPhysX physics likewise cannot run with the Kit visualizer.
"""
- visualizer_types = _get_visualizer_types(launcher_args)
- has_kit_visualizer = "kit" in visualizer_types or scan.visualizer_intent["has_kit_visualizer"]
+ has_kit_visualizer = _has_kit_visualizer(scan, launcher_args)
if scan.has_ovphysx_physics and has_kit_visualizer:
raise ValueError(
@@ -352,11 +408,14 @@ def launch_simulation(
Callers that do not need the value simply omit ``as``.
"""
+ # Livestreaming implies a Kit visualizer; make that visible to auto RTX
+ # resolution during the single scan.
+ _ensure_livestream_kit_visualizer(launcher_args)
+
# The single walk: collect every signal and apply the --physics override.
- config_scan = scan(cfg, _get_arg(launcher_args, "physics"))
+ config_scan = scan(cfg, launcher_args)
effective_cfg = config_scan.effective_cfg
physics_cfg = config_scan.resolved_physics_cfg
- _ensure_livestream_kit_visualizer(launcher_args)
visualizer_types = _get_visualizer_types(launcher_args)
# ovrtx + Kit visualizer share conflicting RTX hydra libraries under different USD
@@ -372,7 +431,7 @@ def launch_simulation(
)
_validate_runtime(config_scan, launcher_args)
- needs_kit = config_scan.needs_kit or "kit" in visualizer_types
+ needs_kit = _uses_isaac_sim_runtime(config_scan, launcher_args)
_set_arg(launcher_args, "visualizer_intent", config_scan.visualizer_intent)
if needs_kit and config_scan.has_kit_camera and launcher_args is not None:
diff --git a/source/isaaclab/isaaclab/cli/commands/install.py b/source/isaaclab/isaaclab/cli/commands/install.py
index be7c3aa5b0e9..6154d19b0ead 100644
--- a/source/isaaclab/isaaclab/cli/commands/install.py
+++ b/source/isaaclab/isaaclab/cli/commands/install.py
@@ -79,22 +79,6 @@ def _install_system_deps() -> None:
]
run_command(["sudo"] + cmd if os.geteuid() != 0 else cmd)
- # nlopt has no aarch64 manylinux wheel for the version pinned by
- # isaacteleop[retargeters], so pip falls back to a CMake source build
- # that needs SWIG. Mirrors the apt step in docker/Dockerfile.base.
- if not shutil.which("swig"):
- if os.geteuid() != 0 and not shutil.which("sudo"):
- print_info(
- "swig is missing and sudo is unavailable; skipping swig install. "
- "Pre-install swig in your image if you need to build nlopt from source."
- )
- else:
- print_info("Installing swig (required for building nlopt on ARM)...")
- cmd = ["apt-get", "update"]
- run_command(["sudo"] + cmd if os.geteuid() != 0 else cmd)
- cmd = ["apt-get", "install", "-y", "--no-install-recommends", "swig"]
- run_command(["sudo"] + cmd if os.geteuid() != 0 else cmd)
-
# imgui-bundle has no aarch64 manylinux wheel, so pip falls back to a
# CMake source build that needs GL/X11 dev headers (via glfw).
# Mirrors the apt step in docker/Dockerfile.base.
@@ -154,25 +138,6 @@ def _torch_first_on_sys_path_is_prebundle(python_exe: str, *, env: dict[str, str
return result.returncode == 1
-def _maybe_preinstall_arm_nlopt(pip_cmd: list[str]) -> None:
- """Pre-install ``nlopt==2.6.2`` on ARM Linux to skip the source-build fallback.
-
- There is no aarch64 manylinux wheel for the ``nlopt 2.6.2`` version pinned
- by ``isaacteleop[retargeters]``, so pip falls back to a CMake source build
- that hides the host-Python ``numpy`` from its isolated build env. Mirror
- the docker/Dockerfile.base arm64 step: install ``setuptools wheel numpy``
- in the host Python first, then ``--no-build-isolation`` install nlopt so
- later submodule installs see it as already satisfied.
- """
- if is_windows() or not is_arm():
- return
- print_info("Pre-installing nlopt==2.6.2 on ARM (no-build-isolation)...")
- print_info(" step 1/2: ensure setuptools/wheel/numpy are importable for the no-build-isolation backend")
- run_command(pip_cmd + ["install", "setuptools", "wheel", "numpy"])
- print_info(" step 2/2: install nlopt==2.6.2 with --no-build-isolation")
- run_command(pip_cmd + ["install", "--no-build-isolation", "nlopt==2.6.2"])
-
-
def _maybe_uninstall_prebundled_torch(
python_exe: str,
pip_cmd: list[str],
@@ -195,6 +160,92 @@ def _maybe_uninstall_prebundled_torch(
)
+def _ensure_swig_installed() -> bool:
+ """Install ``swig`` via apt when missing so the nlopt source build can run.
+
+ Returns:
+ ``True`` when this call installed ``swig`` (so the caller is responsible
+ for purging it afterwards), ``False`` when ``swig`` was already present or
+ could not be installed.
+ """
+ if shutil.which("swig"):
+ return False
+ if os.geteuid() != 0 and not shutil.which("sudo"):
+ print_warning(
+ "swig is required to build nlopt==2.6.2 from source on ARM but is missing and sudo is "
+ "unavailable. Pre-install swig (or nlopt==2.6.2) manually; the build below will fail otherwise."
+ )
+ return False
+ print_info("Temporarily installing swig to build nlopt==2.6.2 from source on ARM...")
+ update = ["apt-get", "update"]
+ run_command(["sudo"] + update if os.geteuid() != 0 else update)
+ install = ["apt-get", "install", "-y", "--no-install-recommends", "swig"]
+ run_command(["sudo"] + install if os.geteuid() != 0 else install)
+ return shutil.which("swig") is not None
+
+
+def _purge_swig() -> None:
+ """Remove the ``swig`` package that was installed for the nlopt build.
+
+ ``swig`` is GPL-licensed and must not be shipped (e.g. in the Docker image),
+ so it is purged immediately after nlopt is built. ``nlopt`` is already a
+ compiled wheel at this point and does not need ``swig`` at runtime.
+ Best-effort: failures are logged but do not abort the install.
+ """
+ print_info("Removing swig now that nlopt is built (it must not remain installed)...")
+ purge = ["apt-get", "purge", "-y", "--auto-remove", "swig"]
+ run_command(["sudo"] + purge if os.geteuid() != 0 else purge, check=False)
+
+
+def _maybe_preinstall_arm_nlopt(python_exe: str, pip_cmd: list[str]) -> None:
+ """Pre-install ``nlopt==2.6.2`` on ARM Linux to skip the source-build fallback.
+
+ There is no aarch64 manylinux wheel for the ``nlopt 2.6.2`` version pinned
+ by ``isaacteleop[retargeters]``, so pip falls back to a CMake source build
+ that hides the host-Python ``numpy`` from its isolated build env. Mirror
+ the docker/Dockerfile.base arm64 step: install ``setuptools wheel numpy``
+ in the host Python first, then ``--no-build-isolation`` install nlopt so
+ later submodule installs see it as already satisfied.
+
+ The source build requires ``swig``. When it is missing it is installed via
+ apt only for the duration of the build and purged afterwards, so the
+ GPL-licensed ``swig`` package is never left behind — in particular it is
+ never shipped in the Docker image. In the Docker build nlopt is pre-installed,
+ so this function returns early and never touches ``swig`` (the Dockerfile
+ manages its own temporary swig install and purge).
+ """
+ if is_windows() or not is_arm():
+ return
+
+ probe_result = run_command(
+ [
+ python_exe,
+ "-c",
+ "import importlib.metadata as metadata; import nlopt; "
+ "raise SystemExit(0 if metadata.version('nlopt') == '2.6.2' else 1)",
+ ],
+ check=False,
+ capture_output=True,
+ text=True,
+ )
+ if probe_result.returncode == 0:
+ print_info("nlopt==2.6.2 is already installed on ARM.")
+ return
+
+ # The from-source build needs swig; install it only if missing and purge it
+ # afterwards so swig is never left behind (it is GPL and must not ship).
+ swig_installed_by_us = _ensure_swig_installed()
+ try:
+ print_info("Pre-installing nlopt==2.6.2 on ARM (no-build-isolation)...")
+ print_info(" step 1/2: ensure setuptools/wheel/numpy are importable for the no-build-isolation backend")
+ run_command(pip_cmd + ["install", "setuptools", "wheel", "numpy"])
+ print_info(" step 2/2: install nlopt==2.6.2 with --no-build-isolation")
+ run_command(pip_cmd + ["install", "--no-build-isolation", "nlopt==2.6.2"])
+ finally:
+ if swig_installed_by_us:
+ _purge_swig()
+
+
# Dependency stack required by isaaclab.controllers.pink_ik. Pinocchio is installed
# via the cmeel ``pin`` wheel, which provides the ``pinocchio`` Python module under
# ``cmeel.prefix/lib/python3.12/site-packages/`` and registers it on sys.path via a
@@ -953,7 +1004,7 @@ def append_submodules_once(package_dirs: tuple[str, ...]) -> None:
run_command(pip_cmd + ["install", "setuptools<82.0.0"])
# On ARM Linux pre-install nlopt to dodge its from-source build fallback.
- _maybe_preinstall_arm_nlopt(pip_cmd)
+ _maybe_preinstall_arm_nlopt(python_exe, pip_cmd)
# Drop pip-installed torch if Isaac Sim's deprecated ML prebundle would shadow it.
_maybe_uninstall_prebundled_torch(python_exe, pip_cmd, using_uv, probe_env=probe_env)
diff --git a/source/isaaclab/isaaclab/controllers/differential_ik.py b/source/isaaclab/isaaclab/controllers/differential_ik.py
index 9c8f74bade85..51f399ba4be7 100644
--- a/source/isaaclab/isaaclab/controllers/differential_ik.py
+++ b/source/isaaclab/isaaclab/controllers/differential_ik.py
@@ -69,6 +69,20 @@ def __init__(self, cfg: DifferentialIKControllerCfg, num_envs: int, device: str)
self.ee_quat_des = torch.zeros(self.num_envs, 4, device=self._device)
# -- input command
self._command = torch.zeros(self.num_envs, self.action_dim, device=self._device)
+ # -- optional per-axis orientation task weights (used for "pose" command types only)
+ if self.cfg.orientation_weight is None:
+ self._orientation_weight = None
+ else:
+ ori_weight = self.cfg.orientation_weight
+ weight_tuple = (
+ (float(ori_weight),) * 3
+ if isinstance(ori_weight, (int, float))
+ else tuple(float(value) for value in ori_weight)
+ )
+ self._orientation_weight = torch.tensor(weight_tuple, device=self._device)
+ # -- optional joint position limits for null-space joint-limit avoidance (set externally)
+ self._joint_pos_lower = None
+ self._joint_pos_upper = None
"""
Properties.
@@ -144,7 +158,24 @@ def set_command(
self.ee_pos_des, self.ee_quat_des = apply_delta_pose(ee_pos, ee_quat, self._command)
else:
self.ee_pos_des = self._command[:, 0:3]
- self.ee_quat_des = self._command[:, 3:7]
+ # renormalize the commanded quaternion (callers may pass a slightly non-unit quat)
+ quat = self._command[:, 3:7]
+ self.ee_quat_des = quat / torch.linalg.norm(quat, dim=-1, keepdim=True)
+
+ def set_joint_pos_limits(self, lower: torch.Tensor, upper: torch.Tensor) -> None:
+ """Provide the controlled joints' position limits for null-space joint-limit avoidance.
+
+ Only used when
+ :attr:`~isaaclab.controllers.differential_ik_cfg.DifferentialIKControllerCfg.joint_limit_avoidance_gain`
+ is positive. The IK action term injects these automatically on its first step; call this
+ manually only when using the controller standalone.
+
+ Args:
+ lower: Lower joint-position limits in shape (num_joints,).
+ upper: Upper joint-position limits in shape (num_joints,).
+ """
+ self._joint_pos_lower = lower.to(self._device)
+ self._joint_pos_upper = upper.to(self._device)
def compute(
self, ee_pos: torch.Tensor, ee_quat: torch.Tensor, jacobian: torch.Tensor, joint_pos: torch.Tensor
@@ -160,17 +191,16 @@ def compute(
Returns:
The target joint positions commands in shape (N, num_joints).
"""
- # compute the delta in joint-space
+ # assemble the task Jacobian and task-space error
if "position" in self.cfg.command_type:
- position_error = self.ee_pos_des - ee_pos
- jacobian_pos = jacobian[:, 0:3]
- delta_joint_pos = self._compute_delta_joint_pos(delta_pose=position_error, jacobian=jacobian_pos)
+ task_jacobian = jacobian[:, 0:3]
+ task_error = self.ee_pos_des - ee_pos
else:
- position_error, axis_angle_error = compute_pose_error(
- ee_pos, ee_quat, self.ee_pos_des, self.ee_quat_des, rot_error_type="axis_angle"
- )
- pose_error = torch.cat((position_error, axis_angle_error), dim=1)
- delta_joint_pos = self._compute_delta_joint_pos(delta_pose=pose_error, jacobian=jacobian)
+ task_jacobian, task_error = self._compute_pose_task(ee_pos, ee_quat, jacobian)
+ # compute the delta in joint-space
+ delta_joint_pos = self._compute_delta_joint_pos(delta_pose=task_error, jacobian=task_jacobian)
+ # add an optional null-space joint-limit-avoidance bias (a no-op when joint_limit_avoidance_gain == 0)
+ delta_joint_pos = delta_joint_pos + self._joint_limit_avoidance(joint_pos, task_jacobian)
# return the desired joint positions
return joint_pos + delta_joint_pos
@@ -235,7 +265,87 @@ def _compute_delta_joint_pos(self, delta_pose: torch.Tensor, jacobian: torch.Ten
jacobian_T @ torch.inverse(jacobian @ jacobian_T + lambda_matrix) @ delta_pose.unsqueeze(-1)
)
delta_joint_pos = delta_joint_pos.squeeze(-1)
+ elif self.cfg.ik_method == "adaptive_dls": # manipulability-aware damped least squares
+ # parameters
+ lambda_min = self.cfg.ik_params["lambda_min"]
+ lambda_max = self.cfg.ik_params["lambda_max"]
+ sigma_thresh = self.cfg.ik_params["sigma_thresh"]
+ # per-environment squared damping: lambda_min^2 away from singularities, ramping
+ # quadratically up to lambda_max^2 as the smallest task-Jacobian singular value -> 0
+ # (Maciejewski-Klein). Keying off the full task Jacobian damps both position and
+ # orientation rank-loss configurations.
+ sigma_min = torch.linalg.svdvals(jacobian)[:, -1] # (N,)
+ ratio = (sigma_min / sigma_thresh).clamp(max=1.0)
+ lambda_sq = lambda_min**2 + (1.0 - ratio**2) * (lambda_max**2 - lambda_min**2) # (N,)
+ jacobian_T = torch.transpose(jacobian, dim0=1, dim1=2)
+ lambda_matrix = lambda_sq.view(-1, 1, 1) * torch.eye(n=jacobian.shape[1], device=self._device)
+ delta_joint_pos = torch.bmm(
+ jacobian_T,
+ torch.linalg.solve(torch.bmm(jacobian, jacobian_T) + lambda_matrix, delta_pose.unsqueeze(-1)),
+ ).squeeze(-1)
else:
raise ValueError(f"Unsupported inverse-kinematics method: {self.cfg.ik_method}")
return delta_joint_pos
+
+ def _compute_pose_task(
+ self, ee_pos: torch.Tensor, ee_quat: torch.Tensor, jacobian: torch.Tensor
+ ) -> tuple[torch.Tensor, torch.Tensor]:
+ """Assemble the (optionally orientation-weighted) pose task Jacobian and error.
+
+ The orientation error is the axis-angle of ``q_des * q_cur^-1`` from
+ :func:`~isaaclab.utils.math.compute_pose_error`. When
+ :attr:`~isaaclab.controllers.differential_ik_cfg.DifferentialIKControllerCfg.orientation_weight`
+ is set, the 3 orientation rows of both the Jacobian and the error are scaled per
+ base-frame axis (a weight of 0 drops that axis from the solve). Subclasses may override
+ this to further shape the task (e.g. masking which joints serve orientation).
+
+ Args:
+ ee_pos: Current end-effector position in shape (N, 3).
+ ee_quat: Current end-effector orientation (x, y, z, w) in shape (N, 4).
+ jacobian: The geometric Jacobian in shape (N, 6, num_joints).
+
+ Returns:
+ A tuple ``(task_jacobian, task_error)`` with the (N, 6, num_joints) task Jacobian and
+ the (N, 6) task-space error.
+ """
+ position_error, axis_angle_error = compute_pose_error(
+ ee_pos, ee_quat, self.ee_pos_des, self.ee_quat_des, rot_error_type="axis_angle"
+ )
+ task_jacobian = jacobian
+ if self._orientation_weight is not None:
+ weight = self._orientation_weight
+ task_jacobian = torch.cat([jacobian[:, 0:3, :], jacobian[:, 3:6, :] * weight.view(1, 3, 1)], dim=1)
+ axis_angle_error = axis_angle_error * weight.view(1, 3)
+ task_error = torch.cat((position_error, axis_angle_error), dim=1)
+ return task_jacobian, task_error
+
+ def _joint_limit_avoidance(self, joint_pos: torch.Tensor, task_jacobian: torch.Tensor) -> torch.Tensor:
+ """Null-space joint-centering bias that keeps joints off their position limits.
+
+ Projects a center-seeking joint velocity (active only within
+ :attr:`~isaaclab.controllers.differential_ik_cfg.DifferentialIKControllerCfg.joint_limit_avoidance_margin`
+ of a limit) into the null space of the position (linear) task rows, so it never perturbs
+ the commanded end-effector position. Returns zeros when disabled (``joint_limit_avoidance_gain == 0``) or
+ before joint limits are provided via :meth:`set_joint_pos_limits`.
+
+ Args:
+ joint_pos: Current joint positions in shape (N, num_joints).
+ task_jacobian: The task Jacobian in shape (N, T, num_joints); rows 0-2 are the
+ position (linear) rows.
+
+ Returns:
+ The joint-space correction in shape (N, num_joints).
+ """
+ if self.cfg.joint_limit_avoidance_gain <= 0.0 or self._joint_pos_lower is None:
+ return torch.zeros_like(joint_pos)
+ lower, upper = self._joint_pos_lower, self._joint_pos_upper
+ q_mid = 0.5 * (lower + upper)
+ dist = torch.minimum(joint_pos - lower, upper - joint_pos) # margin to nearest limit
+ activation = 1.0 - (dist / self.cfg.joint_limit_avoidance_margin).clamp(0.0, 1.0) # 1 at the limit, 0 mid-range
+ dq_center = -self.cfg.joint_limit_avoidance_gain * activation * (joint_pos - q_mid) # toward the joint center
+ j_pos = task_jacobian[:, :3, :]
+ j_pos_pinv = torch.linalg.pinv(j_pos)
+ num_joints = task_jacobian.shape[2]
+ null_proj = torch.eye(num_joints, device=self._device) - torch.bmm(j_pos_pinv, j_pos)
+ return torch.bmm(null_proj, dq_center.unsqueeze(-1)).squeeze(-1)
diff --git a/source/isaaclab/isaaclab/controllers/differential_ik_cfg.py b/source/isaaclab/isaaclab/controllers/differential_ik_cfg.py
index 409ecc9429f5..58c2fbcce2ca 100644
--- a/source/isaaclab/isaaclab/controllers/differential_ik_cfg.py
+++ b/source/isaaclab/isaaclab/controllers/differential_ik_cfg.py
@@ -35,7 +35,7 @@ class DifferentialIKControllerCfg:
Otherwise, the controller treats the input command as the absolute position/pose.
"""
- ik_method: Literal["pinv", "svd", "trans", "dls"] = MISSING
+ ik_method: Literal["pinv", "svd", "trans", "dls", "adaptive_dls"] = MISSING
"""Method for computing inverse of Jacobian."""
ik_params: dict[str, float] | None = None
@@ -51,13 +51,48 @@ class DifferentialIKControllerCfg:
- "k_val": Scaling of computed delta-joint positions (default: 1.0).
- Damped Moore-Penrose pseudo-inverse ("dls"):
- "lambda_val": Damping coefficient (default: 0.01).
+ - Manipulability-aware damped least squares ("adaptive_dls"):
+ - "lambda_min": Baseline damping coefficient used away from singularities (default: 0.05).
+ - "lambda_max": Maximum damping coefficient, reached as the smallest task-Jacobian
+ singular value approaches zero (default: 0.2).
+ - "sigma_thresh": Smallest-singular-value threshold below which the damping ramps
+ quadratically from ``lambda_min`` toward ``lambda_max`` (Maciejewski-Klein style)
+ (default: 0.02).
"""
+ orientation_weight: float | tuple[float, float, float] | None = None
+ """Soft weight on the orientation task rows for ``"pose"`` command types. Defaults to ``None``
+ (the orientation rows keep weight 1, i.e. unchanged behavior).
+
+ A scalar weights all three orientation rows equally; a per-axis ``(wx, wy, wz)`` weights the
+ base-frame orientation axes independently. Scaling an orientation row (and its error) by a
+ weight de-emphasises -- or, at weight 0, drops -- that rotation DOF in the solve without
+ changing the task dimensionality. This is useful for arms that cannot serve a full 6-DOF pose
+ (e.g. a 5-DOF arm) so the unreachable orientation DOF degrades gracefully instead of leaking
+ error into the position rows. Ignored for ``"position"`` command types.
+ """
+
+ joint_limit_avoidance_gain: float = 0.0
+ """Gain for the null-space joint-limit-avoidance bias. ``0`` disables it (default).
+
+ When positive, a center-seeking joint velocity (active only within
+ :attr:`joint_limit_avoidance_margin` of a limit) is projected into the null space of the
+ position task rows, so it keeps joints off their limits without perturbing the commanded
+ end-effector position. Active only once joint limits are provided via
+ :meth:`~isaaclab.controllers.differential_ik.DifferentialIKController.set_joint_pos_limits`
+ (the IK action term injects them automatically when ``joint_limit_avoidance_gain > 0``).
+ """
+
+ joint_limit_avoidance_margin: float = 0.3
+ """Joint-range margin within which the joint-limit-avoidance bias activates (1 at the limit,
+ ramping to 0 at ``joint_limit_avoidance_margin`` away from it). Units match the joints
+ (e.g. [rad] for revolute joints)."""
+
def __post_init__(self):
# check valid input
if self.command_type not in ["position", "pose"]:
raise ValueError(f"Unsupported inverse-kinematics command: {self.command_type}.")
- if self.ik_method not in ["pinv", "svd", "trans", "dls"]:
+ if self.ik_method not in ["pinv", "svd", "trans", "dls", "adaptive_dls"]:
raise ValueError(f"Unsupported inverse-kinematics method: {self.ik_method}.")
# default parameters for different inverse kinematics approaches.
default_ik_params = {
@@ -65,9 +100,30 @@ def __post_init__(self):
"svd": {"k_val": 1.0, "min_singular_value": 1e-5},
"trans": {"k_val": 1.0},
"dls": {"lambda_val": 0.01},
+ "adaptive_dls": {"lambda_min": 0.05, "lambda_max": 0.2, "sigma_thresh": 0.02},
}
# update parameters for IK-method if not provided
ik_params = default_ik_params[self.ik_method].copy()
if self.ik_params is not None:
ik_params.update(self.ik_params)
self.ik_params = ik_params
+ # validate adaptive_dls parameters
+ if self.ik_method == "adaptive_dls":
+ if self.ik_params["sigma_thresh"] <= 0.0:
+ raise ValueError(f"adaptive_dls sigma_thresh must be > 0, got {self.ik_params['sigma_thresh']}.")
+ if self.ik_params["lambda_min"] > self.ik_params["lambda_max"]:
+ raise ValueError(
+ f"adaptive_dls lambda_min ({self.ik_params['lambda_min']}) must be <= "
+ f"lambda_max ({self.ik_params['lambda_max']})."
+ )
+ # validate optional orientation weighting / joint-limit-avoidance settings
+ if self.orientation_weight is not None and not isinstance(self.orientation_weight, (int, float)):
+ if len(self.orientation_weight) != 3:
+ raise ValueError(
+ "orientation_weight must be a scalar or a length-3 (wx, wy, wz) tuple, got "
+ f"{self.orientation_weight}."
+ )
+ if self.joint_limit_avoidance_gain < 0.0:
+ raise ValueError(f"joint_limit_avoidance_gain must be >= 0, got {self.joint_limit_avoidance_gain}.")
+ if self.joint_limit_avoidance_margin <= 0.0:
+ raise ValueError(f"joint_limit_avoidance_margin must be > 0, got {self.joint_limit_avoidance_margin}.")
diff --git a/source/isaaclab/isaaclab/envs/mdp/actions/task_space_actions.py b/source/isaaclab/isaaclab/envs/mdp/actions/task_space_actions.py
index 8d5496b7678d..ac1a713d234d 100644
--- a/source/isaaclab/isaaclab/envs/mdp/actions/task_space_actions.py
+++ b/source/isaaclab/isaaclab/envs/mdp/actions/task_space_actions.py
@@ -90,6 +90,9 @@ def __init__(self, cfg: actions_cfg.DifferentialInverseKinematicsActionCfg, env:
self._ik_controller = DifferentialIKController(
cfg=self.cfg.controller, num_envs=self.num_envs, device=self.device
)
+ # joint limits are injected lazily on the first apply (asset data is populated by then) so
+ # the controller can do null-space joint-limit avoidance; only needed when joint_limit_avoidance_gain > 0.
+ self._limits_injected = False
# create tensors for raw and processed actions
self._raw_actions = torch.zeros(self.num_envs, self.action_dim, device=self.device)
@@ -201,6 +204,12 @@ def apply_actions(self):
# obtain quantities from simulation
ee_pos_curr, ee_quat_curr = self._compute_frame_pose()
joint_pos = self._asset.data.joint_pos.torch[:, self._joint_ids]
+ # lazily provide joint limits to the controller for null-space joint-limit avoidance
+ # (limits are uniform across envs for these articulations; env 0 is representative)
+ if not self._limits_injected and getattr(self.cfg.controller, "joint_limit_avoidance_gain", 0.0) > 0.0:
+ limits = self._asset.data.soft_joint_pos_limits.torch[0, self._joint_ids, :]
+ self._ik_controller.set_joint_pos_limits(limits[:, 0].clone(), limits[:, 1].clone())
+ self._limits_injected = True
# compute the delta in joint-space
if ee_quat_curr.norm() != 0:
jacobian = self._compute_frame_jacobian()
diff --git a/source/isaaclab/isaaclab/sim/__init__.pyi b/source/isaaclab/isaaclab/sim/__init__.pyi
index 05b76be4270c..d8d4e1beda24 100644
--- a/source/isaaclab/isaaclab/sim/__init__.pyi
+++ b/source/isaaclab/isaaclab/sim/__init__.pyi
@@ -39,12 +39,17 @@ __all__ = [
"BoundingCubePropertiesCfg",
"BoundingSpherePropertiesCfg",
"CollisionBaseCfg",
+ "CollisionFragment",
"ConvexDecompositionPropertiesCfg",
"ConvexHullPropertiesCfg",
"DeformableBodyPropertiesBaseCfg",
"DeformableBodyPropertiesCfg",
+ "FixedTendonFragment",
"FixedTendonPropertiesCfg",
"JointDriveBaseCfg",
+ "MassCfg",
+ "MassFragment",
+ "JointDriveFragment",
"MassPropertiesCfg",
"MeshCollisionPropertiesCfg",
"MujocoJointDrivePropertiesCfg",
@@ -56,9 +61,27 @@ __all__ = [
"NewtonMeshCollisionPropertiesCfg",
"NewtonRigidBodyPropertiesCfg",
"NewtonSDFCollisionPropertiesCfg",
+ "MeshCollisionFragment",
"PhysxJointDrivePropertiesCfg",
"PhysxRigidBodyPropertiesCfg",
"RigidBodyBaseCfg",
+ "RigidBodyFragment",
+ "SchemaFragment",
+ "SpatialTendonFragment",
+ "UsdPhysicsCollisionCfg",
+ "UsdPhysicsMeshCollisionCfg",
+ "UsdPhysicsRigidBodyCfg",
+ "apply_collision_properties",
+ "apply_fixed_tendon_properties",
+ "apply_mass_properties",
+ "UsdPhysicsDriveCfg",
+ "apply_drive",
+ "apply_joint_drive_properties",
+ "apply_mesh_collision",
+ "apply_mesh_collision_properties",
+ "apply_namespaced",
+ "apply_rigid_body_properties",
+ "apply_spatial_tendon_properties",
"SDFMeshPropertiesCfg",
"SpatialTendonPropertiesCfg",
"TriangleMeshPropertiesCfg",
@@ -192,8 +215,6 @@ __all__ = [
"XformPrimView",
]
-from .simulation_cfg import RenderCfg, SimulationCfg
-from .simulation_context import SimulationContext, build_simulation_context
from .converters import (
AssetConverterBase,
AssetConverterBaseCfg,
@@ -208,42 +229,67 @@ from .schemas import (
MESH_APPROXIMATION_TOKENS,
PHYSX_MESH_COLLISION_CFGS,
USD_MESH_COLLISION_CFGS,
- activate_contact_sensors,
- define_articulation_root_properties,
- define_collision_properties,
- define_deformable_body_properties,
- define_mass_properties,
- define_mesh_collision_properties,
- define_rigid_body_properties,
- modify_articulation_root_properties,
- modify_collision_properties,
- modify_deformable_body_properties,
- modify_fixed_tendon_properties,
- modify_joint_drive_properties,
- modify_mass_properties,
- modify_mesh_collision_properties,
- modify_rigid_body_properties,
- modify_spatial_tendon_properties,
ArticulationRootPropertiesCfg,
BoundingCubePropertiesCfg,
BoundingSpherePropertiesCfg,
CollisionBaseCfg,
+ CollisionFragment,
ConvexDecompositionPropertiesCfg,
ConvexHullPropertiesCfg,
DeformableBodyPropertiesBaseCfg,
DeformableBodyPropertiesCfg,
+ FixedTendonFragment,
FixedTendonPropertiesCfg,
JointDriveBaseCfg,
+ MassCfg,
+ MassFragment,
+ JointDriveFragment,
MassPropertiesCfg,
+ MeshCollisionFragment,
MeshCollisionPropertiesCfg,
PhysxJointDrivePropertiesCfg,
PhysxRigidBodyPropertiesCfg,
RigidBodyBaseCfg,
+ RigidBodyFragment,
+ SchemaFragment,
SDFMeshPropertiesCfg,
+ SpatialTendonFragment,
SpatialTendonPropertiesCfg,
TriangleMeshPropertiesCfg,
TriangleMeshSimplificationPropertiesCfg,
+ UsdPhysicsCollisionCfg,
+ UsdPhysicsMeshCollisionCfg,
+ UsdPhysicsRigidBodyCfg,
+ activate_contact_sensors,
+ apply_collision_properties,
+ apply_fixed_tendon_properties,
+ apply_mass_properties,
+ UsdPhysicsDriveCfg,
+ apply_drive,
+ apply_joint_drive_properties,
+ apply_mesh_collision,
+ apply_mesh_collision_properties,
+ apply_namespaced,
+ apply_rigid_body_properties,
+ apply_spatial_tendon_properties,
+ define_articulation_root_properties,
+ define_collision_properties,
+ define_deformable_body_properties,
+ define_mass_properties,
+ define_mesh_collision_properties,
+ define_rigid_body_properties,
+ modify_articulation_root_properties,
+ modify_collision_properties,
+ modify_deformable_body_properties,
+ modify_fixed_tendon_properties,
+ modify_joint_drive_properties,
+ modify_mass_properties,
+ modify_mesh_collision_properties,
+ modify_rigid_body_properties,
+ modify_spatial_tendon_properties,
)
+from .simulation_cfg import RenderCfg, SimulationCfg
+from .simulation_context import SimulationContext, build_simulation_context
# Forwarded to isaaclab_newton.sim.schemas via __getattr__ shim
MujocoJointDrivePropertiesCfg = ...
@@ -256,46 +302,22 @@ NewtonMeshCollisionPropertiesCfg = ...
NewtonRigidBodyPropertiesCfg = ...
NewtonSDFCollisionPropertiesCfg = ...
from .spawners import (
- SpawnerCfg,
- RigidObjectSpawnerCfg,
- DeformableObjectSpawnerCfg,
- spawn_from_mjcf,
- spawn_from_urdf,
- spawn_from_usd,
- spawn_from_usd_with_compliant_contact_material,
- spawn_ground_plane,
- GroundPlaneCfg,
- MjcfFileCfg,
- UrdfFileCfg,
- UsdFileCfg,
- UsdFileWithCompliantContactCfg,
- spawn_light,
+ CapsuleCfg,
+ ConeCfg,
+ CuboidCfg,
+ CylinderCfg,
CylinderLightCfg,
+ DeformableBodyMaterialBaseCfg,
+ DeformableBodyMaterialCfg,
+ DeformableObjectSpawnerCfg,
DiskLightCfg,
DistantLightCfg,
DomeLightCfg,
- LightCfg,
- SphereLightCfg,
- spawn_rigid_body_material,
- spawn_deformable_body_material,
- PhysicsMaterialCfg,
- RigidBodyMaterialCfg,
- DeformableBodyMaterialBaseCfg,
- DeformableBodyMaterialCfg,
- SurfaceDeformableBodyMaterialBaseCfg,
- SurfaceDeformableBodyMaterialCfg,
- spawn_from_mdl_file,
- spawn_preview_surface,
+ FisheyeCameraCfg,
GlassMdlCfg,
+ GroundPlaneCfg,
+ LightCfg,
MdlFileCfg,
- PreviewSurfaceCfg,
- VisualMaterialCfg,
- spawn_mesh_capsule,
- spawn_mesh_cone,
- spawn_mesh_cuboid,
- spawn_mesh_cylinder,
- spawn_mesh_rectangle,
- spawn_mesh_sphere,
MeshCapsuleCfg,
MeshCfg,
MeshConeCfg,
@@ -303,83 +325,111 @@ from .spawners import (
MeshCylinderCfg,
MeshRectangleCfg,
MeshSphereCfg,
- spawn_camera,
- spawn_sensor_frame,
- FisheyeCameraCfg,
+ MjcfFileCfg,
+ MultiAssetSpawnerCfg,
+ MultiUsdFileCfg,
+ PhysicsMaterialCfg,
PinholeCameraCfg,
+ PreviewSurfaceCfg,
+ RigidBodyMaterialCfg,
+ RigidObjectSpawnerCfg,
SensorFrameCfg,
+ ShapeCfg,
+ SpawnerCfg,
+ SphereCfg,
+ SphereLightCfg,
+ SurfaceDeformableBodyMaterialBaseCfg,
+ SurfaceDeformableBodyMaterialCfg,
+ UrdfFileCfg,
+ UsdFileCfg,
+ UsdFileWithCompliantContactCfg,
+ VisualMaterialCfg,
+ spawn_camera,
spawn_capsule,
spawn_cone,
spawn_cuboid,
spawn_cylinder,
- spawn_sphere,
- CapsuleCfg,
- ConeCfg,
- CuboidCfg,
- CylinderCfg,
- ShapeCfg,
- SphereCfg,
+ spawn_deformable_body_material,
+ spawn_from_mdl_file,
+ spawn_from_mjcf,
+ spawn_from_urdf,
+ spawn_from_usd,
+ spawn_from_usd_with_compliant_contact_material,
+ spawn_ground_plane,
+ spawn_light,
+ spawn_mesh_capsule,
+ spawn_mesh_cone,
+ spawn_mesh_cuboid,
+ spawn_mesh_cylinder,
+ spawn_mesh_rectangle,
+ spawn_mesh_sphere,
spawn_multi_asset,
spawn_multi_usd_file,
- MultiAssetSpawnerCfg,
- MultiUsdFileCfg,
+ spawn_preview_surface,
+ spawn_rigid_body_material,
+ spawn_sensor_frame,
+ spawn_sphere,
)
from .utils import (
+ add_labels,
add_reference_to_stage,
- get_stage_up_axis,
- traverse_stage,
- get_prim_at_path,
- get_prim_path,
- is_prim_path_valid,
- define_prim,
- get_prim_type_name,
- get_next_free_path,
+ add_usd_reference,
+ apply_nested,
+ bind_physics_material,
+ bind_visual_material,
+ change_prim_property,
+ check_missing_labels,
+ clear_stage,
+ clone,
+ close_stage,
+ convert_world_pose_to_local,
+ count_total_labels,
+ create_new_stage,
create_prim,
+ define_prim,
delete_prim,
- make_uninstanceable,
- set_prim_visibility,
- safe_set_attribute_on_usd_schema,
- safe_set_attribute_on_usd_prim,
- change_prim_property,
export_prim_to_file,
- apply_nested,
- clone,
- bind_visual_material,
- bind_physics_material,
- add_usd_reference,
- get_usd_references,
- select_usd_variants,
- get_next_free_prim_path,
- get_first_matching_ancestor_prim,
- get_first_matching_child_prim,
- get_all_matching_child_prims,
find_first_matching_prim,
- find_matching_prims,
- matches_path_expr_prefix,
- resolve_matching_prims_from_source,
- find_matching_prim_paths,
find_global_fixed_joint_prim,
- add_labels,
+ find_matching_prim_paths,
+ find_matching_prims,
+ get_all_matching_child_prims,
+ get_current_stage,
+ get_current_stage_id,
+ get_first_matching_ancestor_prim,
+ get_first_matching_child_prim,
get_labels,
- remove_labels,
- check_missing_labels,
- count_total_labels,
- resolve_paths,
- create_new_stage,
+ get_next_free_path,
+ get_next_free_prim_path,
+ get_prim_at_path,
+ get_prim_path,
+ get_prim_type_name,
+ get_stage_up_axis,
+ get_usd_references,
is_current_stage_in_memory,
+ is_prim_path_valid,
+ make_uninstanceable,
+ matches_path_expr_prefix,
open_stage,
- use_stage,
- update_stage,
+ remove_labels,
+ resolve_matching_prims_from_source,
+ resolve_paths,
+ resolve_prim_pose,
+ resolve_prim_scale,
+ safe_set_attribute_on_usd_prim,
+ safe_set_attribute_on_usd_schema,
save_stage,
- close_stage,
- clear_stage,
- get_current_stage,
- get_current_stage_id,
+ select_usd_variants,
+ set_prim_visibility,
standardize_xform_ops,
+ traverse_stage,
+ update_stage,
+ use_stage,
validate_standard_xform_ops,
- resolve_prim_pose,
- resolve_prim_scale,
- convert_world_pose_to_local,
)
-from .views import BaseFrameView, UsdFrameView, FrameView
-from .views import XformPrimView # deprecated alias
+from .views import (
+ BaseFrameView,
+ FrameView,
+ UsdFrameView,
+ XformPrimView, # deprecated alias
+)
diff --git a/source/isaaclab/isaaclab/sim/converters/mesh_converter.py b/source/isaaclab/isaaclab/sim/converters/mesh_converter.py
index 74ba8b470c3a..186811143b7f 100644
--- a/source/isaaclab/isaaclab/sim/converters/mesh_converter.py
+++ b/source/isaaclab/isaaclab/sim/converters/mesh_converter.py
@@ -15,6 +15,7 @@
from isaaclab.sim.converters.asset_converter_base import AssetConverterBase
from isaaclab.sim.converters.mesh_converter_cfg import MeshConverterCfg
from isaaclab.sim.schemas import schemas
+from isaaclab.sim.schemas.schemas_cfg import SchemaFragment
from isaaclab.sim.utils import delete_prim, export_prim_to_file
# import logger
@@ -126,14 +127,34 @@ def _convert_asset(self, cfg: MeshConverterCfg):
# Apply collider properties to mesh
if cfg.collision_props is not None:
# -- Collider properties such as offset, scale, etc.
- schemas.define_collision_properties(
- prim_path=child_mesh_prim.GetPath(), cfg=cfg.collision_props, stage=stage
+ # transition shim, remove later: new fragment list -> apply_*; legacy single cfg -> define_*
+ coll_frags = (
+ cfg.collision_props if isinstance(cfg.collision_props, (list, tuple)) else [cfg.collision_props]
)
+ if coll_frags and all(isinstance(f, SchemaFragment) for f in coll_frags):
+ schemas.apply_collision_properties(str(child_mesh_prim.GetPath()), coll_frags, stage=stage)
+ else:
+ schemas.define_collision_properties(
+ prim_path=child_mesh_prim.GetPath(), cfg=cfg.collision_props, stage=stage
+ )
# Add collision mesh
if cfg.mesh_collision_props is not None:
- schemas.define_mesh_collision_properties(
- prim_path=child_mesh_prim.GetPath(), cfg=cfg.mesh_collision_props, stage=stage
+ # Transition bridge: route a fragment (or list of fragments) through the new
+ # ``apply_mesh_collision_properties`` family writer; otherwise fall back to the
+ # legacy single-cfg ``define_mesh_collision_properties`` path.
+ mesh_collision_frags = (
+ cfg.mesh_collision_props
+ if isinstance(cfg.mesh_collision_props, (list, tuple))
+ else [cfg.mesh_collision_props]
)
+ if all(isinstance(f, SchemaFragment) for f in mesh_collision_frags):
+ schemas.apply_mesh_collision_properties(
+ prim_path=child_mesh_prim.GetPath(), fragments=mesh_collision_frags, stage=stage
+ )
+ else:
+ schemas.define_mesh_collision_properties(
+ prim_path=child_mesh_prim.GetPath(), cfg=cfg.mesh_collision_props, stage=stage
+ )
# Delete the old Xform and make the new Xform the default prim
stage.SetDefaultPrim(xform_prim)
# Apply default Xform rotation to mesh -> enable to set rotation and scale
@@ -182,12 +203,21 @@ def _convert_asset(self, cfg: MeshConverterCfg):
# Apply mass and rigid body properties after everything else
# Properties are applied to the top level prim to avoid the case where all instances of this
# asset unintentionally share the same rigid body properties
- # apply mass properties
+ # apply mass properties (transition shim, remove later: fragment list -> apply_*; legacy cfg -> define_*)
if cfg.mass_props is not None:
- schemas.define_mass_properties(prim_path=xform_prim.GetPath(), cfg=cfg.mass_props, stage=stage)
- # apply rigid body properties
+ # normalize a single fragment to a list so the convenience form routes like a list
+ mass_frags = [cfg.mass_props] if isinstance(cfg.mass_props, SchemaFragment) else cfg.mass_props
+ if isinstance(mass_frags, (list, tuple)) and all(isinstance(f, SchemaFragment) for f in mass_frags):
+ schemas.apply_mass_properties(str(xform_prim.GetPath()), mass_frags, stage=stage)
+ else:
+ schemas.define_mass_properties(prim_path=xform_prim.GetPath(), cfg=cfg.mass_props, stage=stage)
+ # apply rigid body properties (transition shim, remove later: fragment list -> apply_*; legacy cfg -> define_*)
if cfg.rigid_props is not None:
- schemas.define_rigid_body_properties(prim_path=xform_prim.GetPath(), cfg=cfg.rigid_props, stage=stage)
+ rigid_frags = cfg.rigid_props if isinstance(cfg.rigid_props, (list, tuple)) else [cfg.rigid_props]
+ if rigid_frags and all(isinstance(f, SchemaFragment) for f in rigid_frags):
+ schemas.apply_rigid_body_properties(str(xform_prim.GetPath()), rigid_frags, stage=stage)
+ else:
+ schemas.define_rigid_body_properties(prim_path=xform_prim.GetPath(), cfg=cfg.rigid_props, stage=stage)
# Save changes to USD stage
stage.Save()
diff --git a/source/isaaclab/isaaclab/sim/converters/mesh_converter_cfg.py b/source/isaaclab/isaaclab/sim/converters/mesh_converter_cfg.py
index 73ec37e777b6..df25b5cba3f8 100644
--- a/source/isaaclab/isaaclab/sim/converters/mesh_converter_cfg.py
+++ b/source/isaaclab/isaaclab/sim/converters/mesh_converter_cfg.py
@@ -26,14 +26,35 @@ class MeshConverterCfg(AssetConverterBaseCfg):
If None, then no rigid body properties will be added.
"""
- collision_props: schemas_cfg.CollisionPropertiesCfg = None
+ collision_props: (
+ schemas_cfg.CollisionPropertiesCfg | schemas_cfg.CollisionFragment | list[schemas_cfg.CollisionFragment]
+ ) = None
"""Collision properties to apply to the USD. Defaults to None.
+ Accepts either a single legacy cfg (e.g. :class:`~isaaclab.sim.schemas.CollisionBaseCfg`) or a
+ list of :class:`~isaaclab.sim.schemas.CollisionFragment` fragments. When a fragment list is
+ given, ``UsdPhysics.CollisionAPI`` is applied as the implicit anchor and each fragment writes
+ its own namespace.
+
Note:
If None, then no collision properties will be added.
"""
- mesh_collision_props: schemas_cfg.MeshCollisionBaseCfg = None
+ mesh_collision_props: (
+ schemas_cfg.MeshCollisionBaseCfg
+ | schemas_cfg.MeshCollisionFragment
+ | list[schemas_cfg.MeshCollisionFragment]
+ | None
+ ) = None
"""Mesh approximation properties to apply to all collision meshes in the USD.
+
+ Accepts either a single legacy cfg (e.g. :class:`~isaaclab.sim.schemas.MeshCollisionBaseCfg` or
+ a ``Physx*PropertiesCfg`` cooking cfg) or a list of
+ :class:`~isaaclab.sim.schemas.MeshCollisionFragment` fragments (e.g.
+ ``[UsdPhysicsMeshCollisionCfg(...), PhysxConvexHullCfg(...)]``). When a fragment list is given,
+ ``UsdPhysics.MeshCollisionAPI`` is applied as the implicit anchor, the ``physics:approximation``
+ token is resolved from whichever cooking fragment is present, and each fragment writes its own
+ namespace.
+
Note:
If None, then no mesh approximation properties will be added.
"""
diff --git a/source/isaaclab/isaaclab/sim/schemas/__init__.pyi b/source/isaaclab/isaaclab/sim/schemas/__init__.pyi
index 49eff741c8c8..b4f86cefcfc8 100644
--- a/source/isaaclab/isaaclab/sim/schemas/__init__.pyi
+++ b/source/isaaclab/isaaclab/sim/schemas/__init__.pyi
@@ -8,6 +8,16 @@ __all__ = [
"PHYSX_MESH_COLLISION_CFGS",
"USD_MESH_COLLISION_CFGS",
"activate_contact_sensors",
+ "apply_collision_properties",
+ "apply_fixed_tendon_properties",
+ "apply_mass_properties",
+ "apply_drive",
+ "apply_joint_drive_properties",
+ "apply_mesh_collision",
+ "apply_mesh_collision_properties",
+ "apply_namespaced",
+ "apply_rigid_body_properties",
+ "apply_spatial_tendon_properties",
"define_actuator_properties",
"define_articulation_root_properties",
"define_collision_properties",
@@ -28,11 +38,24 @@ __all__ = [
"BoundingCubePropertiesCfg",
"BoundingSpherePropertiesCfg",
"CollisionBaseCfg",
+ "CollisionFragment",
"DeformableBodyPropertiesBaseCfg",
"DeformableBodyPropertiesCfg",
+ "FixedTendonFragment",
"JointDriveBaseCfg",
+ "MassCfg",
+ "MassFragment",
+ "JointDriveFragment",
"MassPropertiesCfg",
"MeshCollisionBaseCfg",
+ "MeshCollisionFragment",
+ "RigidBodyFragment",
+ "SchemaFragment",
+ "SpatialTendonFragment",
+ "UsdPhysicsCollisionCfg",
+ "UsdPhysicsDriveCfg",
+ "UsdPhysicsMeshCollisionCfg",
+ "UsdPhysicsRigidBodyCfg",
"MujocoJointDrivePropertiesCfg",
"MujocoRigidBodyPropertiesCfg",
"NewtonArticulationRootPropertiesCfg",
@@ -50,6 +73,16 @@ from .schemas import (
PHYSX_MESH_COLLISION_CFGS,
USD_MESH_COLLISION_CFGS,
activate_contact_sensors,
+ apply_collision_properties,
+ apply_fixed_tendon_properties,
+ apply_mass_properties,
+ apply_drive,
+ apply_joint_drive_properties,
+ apply_mesh_collision,
+ apply_mesh_collision_properties,
+ apply_namespaced,
+ apply_rigid_body_properties,
+ apply_spatial_tendon_properties,
define_articulation_root_properties,
define_collision_properties,
define_deformable_body_properties,
@@ -74,12 +107,25 @@ from .schemas_cfg import (
BoundingCubePropertiesCfg,
BoundingSpherePropertiesCfg,
CollisionBaseCfg,
+ CollisionFragment,
DeformableBodyPropertiesBaseCfg,
DeformableBodyPropertiesCfg,
+ FixedTendonFragment,
JointDriveBaseCfg,
+ MassCfg,
+ MassFragment,
+ JointDriveFragment,
MassPropertiesCfg,
MeshCollisionBaseCfg,
+ MeshCollisionFragment,
RigidBodyBaseCfg,
+ RigidBodyFragment,
+ SchemaFragment,
+ SpatialTendonFragment,
+ UsdPhysicsCollisionCfg,
+ UsdPhysicsDriveCfg,
+ UsdPhysicsMeshCollisionCfg,
+ UsdPhysicsRigidBodyCfg,
)
# Forwarded to isaaclab_newton.sim.schemas via __getattr__ shim
diff --git a/source/isaaclab/isaaclab/sim/schemas/_backend_hooks.py b/source/isaaclab/isaaclab/sim/schemas/_backend_hooks.py
new file mode 100644
index 000000000000..3c25d668a3fb
--- /dev/null
+++ b/source/isaaclab/isaaclab/sim/schemas/_backend_hooks.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Backend registration hooks for schema writers.
+
+This module holds the inversion-of-control registries that let physics backends (e.g.
+``isaaclab_physx``, ``isaaclab_newton``) inject backend-specific behaviour into the core schema
+writers without core importing any backend. It is deliberately kept free of ``pxr``/``omni`` imports
+so a backend can register its hook at package-import time without eagerly pulling USD libraries into
+an otherwise USD-free import path.
+"""
+
+from __future__ import annotations
+
+from collections.abc import Callable
+
+# Backend-registered predicates that exclude a joint prim from joint-drive authoring. Backends (e.g.
+# PhysX tendons) register here via :func:`register_joint_drive_skip_predicate` so the core joint-drive
+# writers can skip backend-controlled joints without core carrying any backend-specific schema name.
+_JOINT_DRIVE_SKIP_PREDICATES: list[Callable] = []
+
+
+def register_joint_drive_skip_predicate(predicate: Callable) -> None:
+ """Register a predicate that excludes a joint prim from joint-drive authoring.
+
+ The joint-drive writers (:func:`~isaaclab.sim.schemas.apply_drive`,
+ :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`) skip any joint for which a registered
+ predicate returns ``True``. This is the backend hook for cases like PhysX fixed tendons, where the
+ controlling backend owns certain joints and no drive should be authored on them -- the backend
+ registers its own detector so core needs no backend-specific knowledge.
+
+ Args:
+ predicate: A callable ``predicate(prim) -> bool`` returning True to exclude the prim.
+ """
+ if predicate not in _JOINT_DRIVE_SKIP_PREDICATES:
+ _JOINT_DRIVE_SKIP_PREDICATES.append(predicate)
+
+
+def _skip_joint_drive(prim) -> bool:
+ """Return whether any backend-registered predicate excludes ``prim`` from joint-drive authoring."""
+ return any(predicate(prim) for predicate in _JOINT_DRIVE_SKIP_PREDICATES)
diff --git a/source/isaaclab/isaaclab/sim/schemas/schemas.py b/source/isaaclab/isaaclab/sim/schemas/schemas.py
index 23f53b105cb3..bdcc073d35cd 100644
--- a/source/isaaclab/isaaclab/sim/schemas/schemas.py
+++ b/source/isaaclab/isaaclab/sim/schemas/schemas.py
@@ -9,6 +9,7 @@
import dataclasses
import logging
import math
+from collections.abc import Iterable
import numpy as np
import warp as wp
@@ -16,7 +17,7 @@
from pxr import Sdf, Usd, UsdGeom, UsdPhysics
from isaaclab.sim.utils.stage import get_current_stage
-from isaaclab.utils.string import to_camel_case
+from isaaclab.utils.string import string_to_callable, to_camel_case
from ..utils import (
apply_nested,
@@ -27,6 +28,7 @@
safe_set_attribute_on_usd_schema,
)
from . import schemas_cfg
+from ._backend_hooks import _skip_joint_drive
# import logger
logger = logging.getLogger(__name__)
@@ -214,6 +216,60 @@ class that declares it (walking the MRO). Each group writes under that class's
safe_set_attribute_on_usd_prim(prim, f"{namespace}:{usd_attr}", value, camel_case=False)
+def apply_namespaced(cfg: schemas_cfg.SchemaFragment, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Default fragment applier: apply the fragment's schema and write its namespaced attrs.
+
+ Reads :attr:`~isaaclab.sim.schemas.SchemaFragment._usd_namespace` /
+ :attr:`~isaaclab.sim.schemas.SchemaFragment._usd_applied_schema` from the cfg's class. If the
+ fragment owns an applied schema, it is applied (once). Each non-``None`` dataclass field is
+ written as ``:``; the ``func`` field is skipped. ``None`` fields
+ are left unchanged on the prim (partial update).
+
+ Args:
+ cfg: The fragment instance carrying ``_usd_namespace`` / ``_usd_applied_schema`` metadata.
+ prim_path: The prim path to author on.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the properties were successfully set.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ # fail loudly on an invalid path (matches the legacy define_/modify_ writers)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ namespace = type(cfg)._usd_namespace
+ applied = type(cfg)._usd_applied_schema
+ # every fragment field is a namespaced USD attribute, so a namespace is required
+ if namespace is None:
+ raise ValueError(
+ f"Fragment '{type(cfg).__name__}' has no '_usd_namespace' set. Every fragment field is"
+ " authored as ':', so a USD namespace is required; non-USD state must"
+ " live on the spawner cfg or be passed as a writer keyword argument, not as a fragment"
+ " field."
+ )
+ if applied and applied not in prim.GetAppliedSchemas():
+ prim.AddAppliedSchema(applied)
+ for f in dataclasses.fields(cfg):
+ # ``func`` is the only non-USD field; non-scalar values raise in the setter
+ if f.name == "func":
+ continue
+ # ``mesh_approximation_name`` is not a namespaced attribute: it is the standard
+ # ``physics:approximation`` token, written by ``apply_mesh_collision_properties`` (the
+ # family writer) which validates it against ``MESH_APPROXIMATION_TOKENS``. Skip it here
+ # so a mesh-collision cooking fragment dispatched through this generic applier does not
+ # author a spurious ``:meshApproximationName`` attribute.
+ if f.name == "mesh_approximation_name":
+ continue
+ value = getattr(cfg, f.name)
+ if value is None:
+ continue
+ safe_set_attribute_on_usd_prim(prim, f"{namespace}:{to_camel_case(f.name, 'cC')}", value, camel_case=False)
+ return True
+
+
"""
Articulation root properties.
"""
@@ -386,6 +442,143 @@ def modify_articulation_root_properties(
"""
+def apply_rigid_body_properties(
+ prim_path: str, fragments: Iterable[schemas_cfg.RigidBodyFragment], stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a list of rigid-body fragments to a prim.
+
+ Applies ``UsdPhysics.RigidBodyAPI`` as the implicit anchor (the defining schema for a rigid
+ body), then dispatches each fragment via its :attr:`~isaaclab.sim.schemas.SchemaFragment.func`.
+ Backend fragments carry backend-specific funcs, so core never imports a backend.
+
+ Args:
+ prim_path: The prim path to apply the rigid-body schemas on.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.RigidBodyFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the properties were successfully set.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ # fail loudly on an invalid path (matches the legacy define_rigid_body_properties writer)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ if not UsdPhysics.RigidBodyAPI(prim):
+ UsdPhysics.RigidBodyAPI.Apply(prim)
+ # aggregate per-fragment results so a reported failure is not masked by the always-applied anchor
+ success = True
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ success = bool(func(cfg, prim_path, stage)) and success
+ return success
+
+
+def apply_mesh_collision(
+ cfg: schemas_cfg.MeshCollisionFragment, prim_path: str, stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a single mesh-collision fragment: its namespaced cooking attrs plus the shared token.
+
+ This is the default :attr:`~isaaclab.sim.schemas.SchemaFragment.func` for every
+ :class:`~isaaclab.sim.schemas.MeshCollisionFragment`. Unlike the generic :func:`apply_namespaced`,
+ a mesh-collision fragment additionally authors the shared ``physics:approximation`` token (via the
+ standard ``UsdPhysics.MeshCollisionAPI``) on top of its own backend cooking namespace.
+
+ The token is *not* a plain namespaced attribute -- it is shared state on the family anchor implied
+ by the present cooking fragment. Each fragment carries a :attr:`mesh_approximation_name` whose
+ default encodes the token its schema implies (e.g. ``"convexHull"`` for :class:`PhysxConvexHullCfg`,
+ ``"sdf"`` for :class:`PhysxSDFMeshCfg`). A name of ``"none"`` leaves the token unchanged, so when
+ several fragments are dispatched in order by :func:`apply_mesh_collision_properties` the last one
+ with a non-``"none"`` name wins -- this is how a core fragment composes with a backend cooking
+ fragment. The name is validated against :const:`MESH_APPROXIMATION_TOKENS`; an unknown name raises
+ ``ValueError``. :attr:`mesh_approximation_name` is skipped by :func:`apply_namespaced`, so it is
+ never authored as a spurious ``:meshApproximationName`` attribute.
+
+ Args:
+ cfg: The mesh-collision fragment to apply.
+ prim_path: The prim path to author on. This prim should be a Mesh.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the fragment was applied successfully.
+
+ Raises:
+ ValueError: If the prim at ``prim_path`` is not valid, or when the fragment's mesh
+ approximation name is not in :const:`MESH_APPROXIMATION_TOKENS`.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ # ensure the standard MeshCollisionAPI anchor (carrier of ``physics:approximation``) exists
+ if not UsdPhysics.MeshCollisionAPI(prim):
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ # write the fragment's backend cooking namespace + applied schema; ``mesh_approximation_name`` is
+ # skipped by the generic applier as it is the shared token handled below
+ success = apply_namespaced(cfg, prim_path, stage)
+ # author the shared ``physics:approximation`` token this fragment implies; ``"none"`` leaves the
+ # token untouched so a later non-"none" fragment in a list dispatch wins
+ name = getattr(cfg, "mesh_approximation_name", None)
+ if name is not None and name != "none":
+ if name not in MESH_APPROXIMATION_TOKENS:
+ raise ValueError(
+ f"Invalid mesh approximation name: '{name}'. "
+ f"Valid options are: {list(MESH_APPROXIMATION_TOKENS.keys())}"
+ )
+ safe_set_attribute_on_usd_schema(
+ UsdPhysics.MeshCollisionAPI(prim), "Approximation", MESH_APPROXIMATION_TOKENS[name], camel_case=False
+ )
+ return success
+
+
+def apply_mesh_collision_properties(
+ prim_path: str, fragments: Iterable[schemas_cfg.MeshCollisionFragment], stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a list of mesh-collision fragments to a prim.
+
+ Applies ``UsdPhysics.MeshCollisionAPI`` as the implicit anchor (the carrier of the
+ ``physics:approximation`` token), then dispatches each fragment via its
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func`. The default mesh-collision func
+ (:func:`apply_mesh_collision`) authors both the fragment's backend cooking namespace and the
+ shared approximation token it implies, so composing a core fragment with a backend cooking
+ fragment lets the last fragment with a non-``"none"`` :attr:`mesh_approximation_name` set the
+ token. Backend cooking fragments carry their own funcs, so core never imports a backend.
+
+ Args:
+ prim_path: The prim path to apply the mesh-collision schemas on. This prim should be a Mesh.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.MeshCollisionFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if all fragments applied successfully, False if any fragment reported failure.
+
+ Raises:
+ ValueError: If the prim at ``prim_path`` is not valid, or when a fragment's mesh
+ approximation name is not in :const:`MESH_APPROXIMATION_TOKENS`.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ # fail loudly on an invalid path (matches the sibling apply_* writers)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ # apply the standard MeshCollisionAPI anchor (carrier of ``physics:approximation``)
+ if not UsdPhysics.MeshCollisionAPI(prim):
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ # dispatch each fragment via its ``func`` (cooking-schema namespace + implied approximation
+ # token), aggregating per-fragment results so a reported failure is not masked by the anchor
+ success = True
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ success = bool(func(cfg, prim_path, stage)) and success
+ return success
+
+
def define_rigid_body_properties(prim_path: str, cfg: schemas_cfg.RigidBodyBaseCfg, stage: Usd.Stage | None = None):
"""Apply the rigid body schema on the input prim and set its properties.
@@ -475,6 +668,36 @@ def modify_rigid_body_properties(
"""
+def apply_collision_properties(
+ prim_path: str, fragments: Iterable[schemas_cfg.CollisionFragment], stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a list of collision fragments to a prim.
+
+ Applies ``UsdPhysics.CollisionAPI`` as the implicit anchor (the defining schema for a
+ collider), then dispatches each fragment via its
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func`. Backend fragments carry backend-specific
+ funcs, so core never imports a backend.
+
+ Args:
+ prim_path: The prim path to apply the collision schemas on.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.CollisionFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the properties were successfully set.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ if not UsdPhysics.CollisionAPI(prim):
+ UsdPhysics.CollisionAPI.Apply(prim)
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ func(cfg, prim_path, stage)
+ return True
+
+
def define_collision_properties(
prim_path: str, cfg: schemas_cfg.CollisionPropertiesCfg, stage: Usd.Stage | None = None
):
@@ -569,6 +792,39 @@ def modify_collision_properties(
"""
+def apply_mass_properties(
+ prim_path: str, fragments: Iterable[schemas_cfg.MassFragment], stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a list of mass fragments to a prim.
+
+ Applies ``UsdPhysics.MassAPI`` as the implicit anchor (the defining schema for mass properties),
+ then dispatches each fragment via its :attr:`~isaaclab.sim.schemas.SchemaFragment.func`.
+
+ Args:
+ prim_path: The prim path to apply the mass schemas on.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.MassFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the properties were successfully set.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ # fail loudly on an invalid path (matches the legacy define_mass_properties writer)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ if not UsdPhysics.MassAPI(prim):
+ UsdPhysics.MassAPI.Apply(prim)
+ # aggregate per-fragment results so a reported failure is not masked by the always-applied anchor
+ success = True
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ success = bool(func(cfg, prim_path, stage)) and success
+ return success
+
+
def define_mass_properties(prim_path: str, cfg: schemas_cfg.MassPropertiesCfg, stage: Usd.Stage | None = None):
"""Apply the mass schema on the input prim and set its properties.
@@ -730,6 +986,226 @@ def activate_contact_sensors(prim_path: str, threshold: float = 0.0, stage: Usd.
"""
+def _drive_instance_name(prim) -> str | None:
+ """Return the ``UsdPhysics.DriveAPI`` instance for a joint prim, or ``None`` if it has no drive.
+
+ Revolute joints use the ``"angular"`` instance, prismatic joints the ``"linear"`` instance; any
+ other prim type has no joint drive. Shared by :func:`apply_drive` and :func:`_ensure_drive_exists`.
+
+ Args:
+ prim: The candidate joint prim.
+
+ Returns:
+ ``"angular"``, ``"linear"``, or ``None`` when the prim is not a revolute/prismatic joint.
+ """
+ if prim.IsA(UsdPhysics.RevoluteJoint):
+ return "angular"
+ if prim.IsA(UsdPhysics.PrismaticJoint):
+ return "linear"
+ return None
+
+
+def apply_drive(cfg, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Apply a :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` fragment to a single joint prim.
+
+ This is the override ``func`` for the ``UsdPhysics.DriveAPI`` fragment: the drive attributes
+ live under a multi-instance schema, so the generic :func:`apply_namespaced` writer cannot be
+ used. The writer reproduces the solver-common drive logic of
+ :func:`modify_joint_drive_properties`:
+
+ * Selects the drive instance: ``"angular"`` for a revolute joint, ``"linear"`` for a prismatic
+ joint. For any other prim type, the function is a no-op and returns ``False``.
+ * Skips joints excluded by a backend-registered predicate (see
+ :func:`register_joint_drive_skip_predicate`, e.g. PhysX tendon members), returning ``False``.
+ * Applies ``UsdPhysics.DriveAPI`` for the selected instance (presence-gated -- only applied when
+ this fragment is present).
+ * Converts angular-drive :attr:`stiffness` and :attr:`damping` from radians to degrees
+ (``N·m/rad`` -> ``N·m/deg`` and ``N·m·s/rad`` -> ``N·m·s/deg``); linear drives are written
+ as-is.
+ * Writes the typed ``drive::physics:{type,maxForce,stiffness,damping}`` attributes,
+ mapping the :attr:`drive_type` field to the USD attribute named ``type``.
+
+ Args:
+ cfg: The :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` fragment to apply.
+ prim_path: The joint prim path to author on.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the drive was applied to a joint prim, False if the prim is not a revolute or
+ prismatic joint (or is a tendon child).
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+
+ # select the drive instance based on the joint type
+ drive_api_name = _drive_instance_name(prim)
+ if drive_api_name is None:
+ return False
+ # skip joints a backend owns (e.g. PhysX tendon members); see register_joint_drive_skip_predicate
+ if _skip_joint_drive(prim):
+ return False
+
+ # apply the multi-instance drive API (presence-gated anchor for the joint-drive family)
+ usd_drive_api = UsdPhysics.DriveAPI(prim, drive_api_name)
+ if not usd_drive_api:
+ usd_drive_api = UsdPhysics.DriveAPI.Apply(prim, drive_api_name)
+
+ # gather the solver-common drive fields
+ drive_type = cfg.drive_type
+ max_force = cfg.max_force
+ stiffness = cfg.stiffness
+ damping = cfg.damping
+
+ # angular drives use degree units in USD; convert stiffness/damping from radian units
+ if drive_api_name == "angular":
+ if stiffness is not None:
+ # N-m/rad --> N-m/deg
+ stiffness = stiffness * math.pi / 180.0
+ if damping is not None:
+ # N-m-s/rad --> N-m-s/deg
+ damping = damping * math.pi / 180.0
+
+ # ``drive_type`` is a permanent inline carve-out: the USD attribute is named ``type``
+ # (a Python keyword-like name we cannot use as a cfg field). All other solver-common
+ # joint-drive fields follow the snake_case = camelCase convention.
+ for field_name, value in (
+ ("drive_type", drive_type),
+ ("max_force", max_force),
+ ("stiffness", stiffness),
+ ("damping", damping),
+ ):
+ if value is None:
+ continue
+ usd_attr_name = "type" if field_name == "drive_type" else field_name
+ safe_set_attribute_on_usd_schema(usd_drive_api, usd_attr_name, value, camel_case=True)
+
+ return True
+
+
+def apply_joint_drive_properties(
+ prim_path: str, fragments, stage: Usd.Stage | None = None, ensure_drives_exist: bool = False
+) -> bool:
+ """Apply a list of joint-drive fragments to all joint prims under a prim path.
+
+ Mirrors the recursion behaviour of :func:`modify_joint_drive_properties` (decorated with
+ :func:`~isaaclab.sim.utils.apply_nested`): the prim path and all its descendants are visited,
+ and the fragments are dispatched to every revolute/prismatic joint prim found. As soon as a
+ prim is successfully handled, its children are not descended into (nested joints are not
+ allowed).
+
+ Unlike :func:`apply_rigid_body_properties`, the joint-drive family has no implicit anchor:
+ ``UsdPhysics.DriveAPI`` is *presence-gated* and applied only by :func:`apply_drive` when a
+ :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` fragment is present in ``fragments``. Each
+ fragment is dispatched via its :attr:`~isaaclab.sim.schemas.SchemaFragment.func`, so backend
+ fragments carry backend-specific funcs and core never imports a backend.
+
+ Args:
+ prim_path: The root prim path to search for joint prims under.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.JointDriveFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+ ensure_drives_exist: If True, write a minimal stiffness (``1e-3``) to any drive whose
+ authored stiffness *and* damping are both zero, so that backends (e.g. Newton) treat
+ the drive as active. Reproduces the legacy
+ :attr:`~isaaclab.sim.schemas.JointDriveBaseCfg.ensure_drives_exist` behaviour. This is
+ a spawner-level flag, not a fragment field.
+
+ Returns:
+ True if the fragments were applied to at least one joint prim, False otherwise.
+ """
+ if stage is None:
+ stage = get_current_stage()
+
+ fragments = list(fragments)
+ # detect whether a UsdPhysics.DriveAPI fragment is present (governs presence-gating + the
+ # ensure_drives_exist behaviour, which only makes sense for the solver-common drive fragment)
+ drive_cfg = next((f for f in fragments if isinstance(f, schemas_cfg.UsdPhysicsDriveCfg)), None)
+
+ root_prim = stage.GetPrimAtPath(prim_path)
+ if not root_prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+
+ count_success = 0
+ instanced_prim_paths = []
+ all_prims = [root_prim]
+ while len(all_prims) > 0:
+ child_prim = all_prims.pop(0)
+ child_prim_path = child_prim.GetPath().pathString
+ # skip instanced prims (cannot author on prototypes)
+ if child_prim.IsInstance():
+ instanced_prim_paths.append(child_prim_path)
+ continue
+ # a prim is a valid joint-drive target only if it is a revolute/prismatic joint
+ is_joint = child_prim.IsA(UsdPhysics.RevoluteJoint) or child_prim.IsA(UsdPhysics.PrismaticJoint)
+ if not is_joint:
+ all_prims += child_prim.GetChildren()
+ continue
+ # skip backend-owned joints wholesale (e.g. PhysX tendon members): no fragment may author on
+ # them. The backend registers the detector via register_joint_drive_skip_predicate, so this
+ # gate carries no backend-specific knowledge; descend into children to reach nested joints.
+ if _skip_joint_drive(child_prim):
+ all_prims += child_prim.GetChildren()
+ continue
+ # dispatch each fragment via its func
+ success = False
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ if func(cfg, child_prim_path, stage):
+ success = True
+ # seed a minimal stiffness only when the drive fragment authored neither stiffness nor
+ # damping and the resulting drive is fully passive
+ if ensure_drives_exist and drive_cfg is not None and success:
+ _ensure_drive_exists(drive_cfg, child_prim)
+ if success:
+ count_success += 1
+ else:
+ all_prims += child_prim.GetChildren()
+
+ if count_success == 0:
+ logger.warning(
+ f"Could not apply joint-drive properties on any prims under: '{prim_path}'."
+ " This might be because no revolute/prismatic joint prims were found, or they are"
+ f" instanced. Discovered list of instanced prim paths: {instanced_prim_paths}"
+ )
+ return count_success > 0
+
+
+def _ensure_drive_exists(drive_cfg, prim) -> None:
+ """Seed a minimal stiffness on a fully-passive drive so backends treat it as active.
+
+ Reproduces the legacy ``ensure_drives_exist`` behaviour: if the drive fragment authored
+ neither :attr:`stiffness` nor :attr:`damping` and the authored drive currently has zero
+ (or unset) stiffness *and* damping, write a minimal stiffness of ``1e-3`` directly to the
+ drive API (converted to degree units for angular drives, matching :func:`apply_drive`). The
+ fragment is not mutated, so this is safe across multiple joint prims sharing one fragment.
+
+ Args:
+ drive_cfg: The :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` fragment.
+ prim: The joint prim being authored.
+ """
+ if drive_cfg.stiffness is not None or drive_cfg.damping is not None:
+ return
+ drive_api_name = _drive_instance_name(prim)
+ if drive_api_name is None:
+ return
+ usd_drive_api = UsdPhysics.DriveAPI(prim, drive_api_name)
+ if not usd_drive_api:
+ usd_drive_api = UsdPhysics.DriveAPI.Apply(prim, drive_api_name)
+ cur_stiffness = usd_drive_api.GetStiffnessAttr().Get()
+ cur_damping = usd_drive_api.GetDampingAttr().Get()
+ if (cur_stiffness is None or cur_stiffness == 0.0) and (cur_damping is None or cur_damping == 0.0):
+ # mirror the legacy writer: 1e-3 is set before the rad->deg conversion, so an angular
+ # drive ends up with ``1e-3 * pi / 180``.
+ stiffness = 1e-3
+ if drive_api_name == "angular":
+ stiffness = stiffness * math.pi / 180.0
+ safe_set_attribute_on_usd_schema(usd_drive_api, "stiffness", stiffness, camel_case=True)
+
+
@apply_nested
def modify_joint_drive_properties(
prim_path: str, cfg: schemas_cfg.JointDriveBaseCfg, stage: Usd.Stage | None = None
@@ -845,6 +1321,48 @@ def modify_joint_drive_properties(
"""
+def apply_fixed_tendon_properties(
+ prim_path: str, fragments: Iterable[schemas_cfg.FixedTendonFragment], stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a list of fixed-tendon fragments to a prim.
+
+ Fixed tendons are a *tune-not-apply* family: the applied ``PhysxTendonAxisRootAPI``
+ multi-instance schemas already exist on the prim (authored in the source asset). This writer
+ therefore applies no anchor schema; it only dispatches each fragment via its
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func`, which tunes the existing instances.
+ Backend fragments carry backend-specific funcs, so core never imports a backend.
+
+ Each fragment tunes only its own schema and returns ``False`` when that schema is not
+ present on the prim. A prim carries a single tendon backend, so compose backends across
+ prims rather than mixing PhysX and Mujoco fragments in one list on one prim.
+
+ Args:
+ prim_path: The prim path to apply the fixed-tendon schemas on.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.FixedTendonFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if all fragments applied successfully, False if any fragment reported failure.
+
+ Raises:
+ ValueError: If the prim at ``prim_path`` is not valid.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ # fail loudly on an invalid path (matches the sibling apply_* writers)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ # tune-not-apply: the PhysxTendonAxisRootAPI instances already exist; apply no anchor.
+ # aggregate per-fragment results so a reported failure is not silently masked.
+ success = True
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ success = bool(func(cfg, prim_path, stage)) and success
+ return success
+
+
@apply_nested
def modify_fixed_tendon_properties(
prim_path: str, cfg: schemas_cfg.PhysxFixedTendonPropertiesCfg, stage: Usd.Stage | None = None
@@ -876,6 +1394,9 @@ def modify_fixed_tendon_properties(
Raises:
ValueError: If the input prim path is not valid.
"""
+ # Retained for backward compatibility with callers passing PhysxFixedTendonPropertiesCfg
+ # directly. Will be removed in a future release once callers adopt the fragment-based
+ # apply_fixed_tendon_properties path.
# get stage handle
if stage is None:
stage = get_current_stage()
@@ -903,6 +1424,7 @@ def modify_fixed_tendon_properties(
camel_case=False,
)
else:
+ # NOTE: ``mjc:*`` branch (``MjcTendon`` prim) kept inline; future split candidate into isaaclab_newton.
# only stiffness and damping in the cfg map to mjc attributes
for attr_name, value in cfg.items():
safe_set_attribute_on_usd_prim(
@@ -917,6 +1439,50 @@ def modify_fixed_tendon_properties(
"""
+def apply_spatial_tendon_properties(
+ prim_path: str, fragments: Iterable[schemas_cfg.SpatialTendonFragment], stage: Usd.Stage | None = None
+) -> bool:
+ """Apply a list of spatial-tendon fragments to a prim.
+
+ Spatial tendons are a *tune-not-apply* family: the applied
+ ``PhysxTendonAttachmentRootAPI`` / ``PhysxTendonAttachmentLeafAPI`` multi-instance schemas
+ already exist on the prim (authored in the source asset). This writer therefore applies no
+ anchor schema; it only dispatches each fragment via its
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func`, which tunes the existing instances.
+ Backend fragments carry backend-specific funcs, so core never imports a backend.
+
+ Each fragment tunes only its own schema and returns ``False`` when that schema is not
+ present on the prim. A prim carries a single tendon backend, so compose backends across
+ prims rather than mixing PhysX and Mujoco fragments in one list on one prim.
+
+ Args:
+ prim_path: The prim path to apply the spatial-tendon schemas on.
+ fragments: An iterable of :class:`~isaaclab.sim.schemas.SpatialTendonFragment` instances.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if all fragments applied successfully, False if any fragment reported failure.
+
+ Raises:
+ ValueError: If the prim at ``prim_path`` is not valid.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ # fail loudly on an invalid path (matches the sibling apply_* writers)
+ if not prim.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ # tune-not-apply: the PhysxTendonAttachmentRootAPI / PhysxTendonAttachmentLeafAPI instances
+ # already exist; apply no anchor.
+ # aggregate per-fragment results so a reported failure is not silently masked.
+ success = True
+ for cfg in fragments:
+ func = cfg.func if callable(cfg.func) else string_to_callable(cfg.func)
+ success = bool(func(cfg, prim_path, stage)) and success
+ return success
+
+
@apply_nested
def modify_spatial_tendon_properties(
prim_path: str, cfg: schemas_cfg.PhysxSpatialTendonPropertiesCfg, stage: Usd.Stage | None = None
@@ -950,6 +1516,9 @@ def modify_spatial_tendon_properties(
Raises:
ValueError: If the input prim path is not valid.
"""
+ # Retained for backward compatibility with callers passing PhysxSpatialTendonPropertiesCfg
+ # directly. Will be removed in a future release once callers adopt the fragment-based
+ # apply_spatial_tendon_properties path.
# obtain stage
if stage is None:
stage = get_current_stage()
diff --git a/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py b/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py
index 4eaec2004e91..f64838322141 100644
--- a/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py
+++ b/source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py
@@ -6,6 +6,7 @@
from __future__ import annotations
import warnings
+from collections.abc import Callable
from typing import ClassVar, Literal
from isaaclab.utils.configclass import configclass
@@ -106,6 +107,269 @@ def _deprecate_field_alias(cfg, alias: str, canonical: str) -> None:
setattr(cfg, alias, None)
+@configclass
+class SchemaFragment:
+ """Base for a single-namespace USD-schema config fragment.
+
+ Each subclass mirrors exactly one USD applied schema. The fragment carries class-level
+ metadata describing which USD namespace its fields write to (:attr:`_usd_namespace`) and
+ which applied schema, if any, it owns (:attr:`_usd_applied_schema`). The :attr:`func`
+ field names the callable that applies the fragment to a prim; the default generic applier
+ (:func:`~isaaclab.sim.schemas.apply_namespaced`) reads the metadata and writes each
+ non-``None`` field as ``:``. Irregular APIs override
+ :attr:`func` with a custom applier.
+
+ .. note::
+ A fragment present in a spawner slot means its schema is applied. ``None`` fields are
+ left unchanged on the prim (partial update).
+
+ .. important::
+ Every dataclass field other than :attr:`func` is authored as a USD attribute
+ ``<_usd_namespace>:``. A fragment must not carry non-USD/bookkeeping
+ fields -- such state belongs on the spawner cfg or as a writer keyword argument (this is
+ why ``fix_root_link`` / ``ensure_drives_exist`` are not fragment fields). The generic
+ applier (:func:`~isaaclab.sim.schemas.apply_namespaced`) enforces the invariant: it raises
+ when a fragment has no ``_usd_namespace``, and unsupported (non-scalar) value types raise
+ when written.
+ """
+
+ # -- Class metadata (not dataclass fields) --
+ _usd_namespace: ClassVar[str | None] = None
+ _usd_applied_schema: ClassVar[str | None] = None
+
+ func: Callable | str = "isaaclab.sim.schemas:apply_namespaced"
+ """Callable (or its ``module:attr`` import string) that applies this fragment to a prim.
+
+ Resolved via :func:`~isaaclab.utils.string.string_to_callable` when a string. The callable
+ signature is ``func(cfg, prim_path, stage)``.
+ """
+
+
+@configclass
+class RigidBodyFragment(SchemaFragment):
+ """Marker base for rigid-body fragments; types the ``rigid_props`` slot."""
+
+ pass
+
+
+@configclass
+class UsdPhysicsRigidBodyCfg(RigidBodyFragment):
+ """``physics:*`` rigid-body attributes from `UsdPhysics.RigidBodyAPI`_.
+
+ The ``UsdPhysics.RigidBodyAPI`` schema is applied as the implicit anchor by the rigid-body
+ family writer, so this fragment owns no applied schema of its own.
+
+ .. _UsdPhysics.RigidBodyAPI: https://openusd.org/dev/api/class_usd_physics_rigid_body_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physics"
+ _usd_applied_schema: ClassVar[str | None] = None # RigidBodyAPI applied by the family anchor
+
+ rigid_body_enabled: bool | None = None
+ """Whether to enable or disable the rigid body."""
+
+ kinematic_enabled: bool | None = None
+ """Determines whether the body is kinematic or not.
+
+ A kinematic body is moved through animated or user-defined poses; the simulation still
+ derives velocities for it based on the external motion.
+ """
+
+
+@configclass
+class CollisionFragment(SchemaFragment):
+ """Marker base for collision fragments; types the ``collision_props`` slot."""
+
+ pass
+
+
+@configclass
+class JointDriveFragment(SchemaFragment):
+ """Marker base for joint-drive fragments; types the ``joint_drive_props`` slot."""
+
+ pass
+
+
+@configclass
+class MeshCollisionFragment(SchemaFragment):
+ """Marker base for mesh-collision fragments; types the ``mesh_collision_props`` slot.
+
+ A mesh-collision concept is split across one *core* fragment carrying the standard
+ ``physics:approximation`` token (:class:`UsdPhysicsMeshCollisionCfg`) and one cooking
+ fragment per backend cooking schema (PhysX convex hull / decomposition / triangle mesh /
+ SDF, Newton mesh / SDF). Whichever cooking fragment is present implies the approximation
+ token written to ``physics:approximation`` -- see
+ :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+ """
+
+ # Mesh-collision fragments author the shared ``physics:approximation`` token in addition to their
+ # own namespaced cooking attrs, so they dispatch through :func:`~isaaclab.sim.schemas.apply_mesh_collision`
+ # (not the generic :func:`~isaaclab.sim.schemas.apply_namespaced`). See that func for the token coupling.
+ func: Callable | str = "isaaclab.sim.schemas:apply_mesh_collision"
+
+
+@configclass
+class FixedTendonFragment(SchemaFragment):
+ """Marker base for fixed-tendon fragments; types the ``fixed_tendons_props`` slot.
+
+ Fixed tendons are a *tune-not-apply* family: the applied ``PhysxTendonAxisRootAPI``
+ multi-instance schemas already exist on the prim (authored in the source asset), so the
+ family writer (:func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties`) does not apply
+ any anchor schema; it only tunes the existing instances via each fragment's
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func`.
+ """
+
+ pass
+
+
+@configclass
+class SpatialTendonFragment(SchemaFragment):
+ """Marker base for spatial-tendon fragments; types the ``spatial_tendons_props`` slot.
+
+ Spatial tendons are a *tune-not-apply* family: the applied
+ ``PhysxTendonAttachmentRootAPI`` / ``PhysxTendonAttachmentLeafAPI`` multi-instance schemas
+ already exist on the prim (authored in the source asset), so the family writer
+ (:func:`~isaaclab.sim.schemas.apply_spatial_tendon_properties`) does not apply any anchor
+ schema; it only tunes the existing instances via each fragment's
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func`.
+ """
+
+ pass
+
+
+@configclass
+class UsdPhysicsCollisionCfg(CollisionFragment):
+ """``physics:*`` collision attributes from `UsdPhysics.CollisionAPI`_.
+
+ The ``UsdPhysics.CollisionAPI`` schema is applied as the implicit anchor by the collision
+ family writer (:func:`~isaaclab.sim.schemas.apply_collision_properties`), so this fragment
+ owns no applied schema of its own.
+
+ .. _UsdPhysics.CollisionAPI: https://openusd.org/dev/api/class_usd_physics_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physics"
+ _usd_applied_schema: ClassVar[str | None] = None # CollisionAPI applied by the family anchor
+
+ collision_enabled: bool | None = None
+ """Whether to enable or disable collisions.
+
+ Writes ``physics:collisionEnabled`` via :class:`UsdPhysics.CollisionAPI`.
+ """
+
+
+@configclass
+class UsdPhysicsDriveCfg(JointDriveFragment):
+ """``drive::physics:*`` joint-drive attributes from `UsdPhysics.DriveAPI`_.
+
+ The drive attributes live under a multi-instance ``UsdPhysics.DriveAPI`` (instance
+ ``"angular"`` for revolute joints, ``"linear"`` for prismatic joints), so this fragment
+ cannot use the generic :func:`~isaaclab.sim.schemas.apply_namespaced` writer. It overrides
+ :attr:`func` with :func:`~isaaclab.sim.schemas.apply_drive`, which selects the instance,
+ applies ``UsdPhysics.DriveAPI`` (presence-gated, the conditional anchor for the joint-drive
+ family), performs the radian-to-degree conversion for angular drives, and writes the typed
+ ``drive::physics:{type,maxForce,stiffness,damping}`` attributes.
+
+ .. note::
+ Unlike most fragments, this one is not a metadata-driven write. ``DriveAPI`` is applied
+ only when this fragment is present in the slot.
+
+ .. _UsdPhysics.DriveAPI: https://openusd.org/dev/api/class_usd_physics_drive_a_p_i.html
+ """
+
+ # No metadata-driven namespace: the typed multi-instance ``UsdPhysics.DriveAPI`` is written
+ # directly by ``apply_drive``. ``DriveAPI`` is presence-gated, not an implicit anchor.
+ _usd_namespace: ClassVar[str | None] = None
+ _usd_applied_schema: ClassVar[str | None] = None
+
+ func: Callable | str = "isaaclab.sim.schemas:apply_drive"
+
+ def __post_init__(self):
+ # Deprecation alias: ``max_effort`` -> ``max_force`` (the USD attr is ``maxForce``).
+ # Mirrors the legacy :class:`JointDriveBaseCfg` alias forwarding.
+ _deprecate_field_alias(self, "max_effort", "max_force")
+
+ drive_type: Literal["force", "acceleration"] | None = None
+ """Joint drive type to apply.
+
+ If the drive type is ``"force"``, then the joint is driven by a force. If the drive type is
+ ``"acceleration"``, then the joint is driven by an acceleration (usually used for kinematic
+ joints). Written to ``drive::physics:type`` (the USD attr is ``type``, a permanent
+ inline carve-out from the snake-to-camel convention).
+ """
+
+ max_force: float | None = None
+ """Maximum force/torque that can be applied to the joint [N for linear joints, N·m for angular joints].
+
+ Written to ``drive::physics:maxForce`` via :class:`UsdPhysics.DriveAPI`.
+ """
+
+ max_effort: float | None = None
+ """Deprecated alias for :attr:`max_force`.
+
+ .. deprecated:: 4.6.25
+ Use :attr:`max_force` instead. The cfg field is renamed so its snake_case name maps
+ identity-style to the USD camelCase attribute (``maxForce`` on ``UsdPhysics.DriveAPI``).
+ The alias is forwarded to :attr:`max_force` in :meth:`__post_init__` and will be removed
+ in 4.0.
+ """
+
+ stiffness: float | None = None
+ """Stiffness of the joint drive.
+
+ The unit depends on the joint model:
+
+ * For linear joints, the unit is kg-m/s² (N/m).
+ * For angular joints, the unit is kg-m²/s²/rad (N·m/rad).
+
+ Angular drives are converted from radians to degrees (``N·m/rad`` -> ``N·m/deg``) before
+ being written to ``drive:angular:physics:stiffness``.
+ """
+
+ damping: float | None = None
+ """Damping of the joint drive.
+
+ The unit depends on the joint model:
+
+ * For linear joints, the unit is kg-m/s (N·s/m).
+ * For angular joints, the unit is kg-m²/s/rad (N·m·s/rad).
+
+ Angular drives are converted from radians to degrees (``N·m·s/rad`` -> ``N·m·s/deg``) before
+ being written to ``drive:angular:physics:damping``.
+ """
+
+
+@configclass
+class UsdPhysicsMeshCollisionCfg(MeshCollisionFragment):
+ """``physics:approximation`` mesh-collision token from `UsdPhysics.MeshCollisionAPI`_.
+
+ Carries the standard mesh-collision approximation token (:attr:`mesh_approximation_name`
+ written to ``physics:approximation``). The ``UsdPhysics.MeshCollisionAPI`` schema is applied
+ as the implicit anchor by the mesh-collision family writer
+ (:func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`), so this fragment owns no
+ applied schema of its own.
+
+ .. note::
+ The ``physics:approximation`` attribute is a ``TfToken`` validated against
+ :const:`~isaaclab.sim.schemas.MESH_APPROXIMATION_TOKENS`; the family writer (not the generic
+ :func:`~isaaclab.sim.schemas.apply_namespaced` applier) handles the token write, so this
+ fragment overrides nothing but the namespace metadata. When a PhysX/Newton cooking fragment
+ is present alongside this one, its default :attr:`mesh_approximation_name` sets the token.
+
+ .. _UsdPhysics.MeshCollisionAPI: https://openusd.org/release/api/class_usd_physics_mesh_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physics"
+ _usd_applied_schema: ClassVar[str | None] = None # MeshCollisionAPI applied by the family anchor
+
+ mesh_approximation_name: str = "none"
+ """Name of mesh collision approximation method. Default: "none".
+
+ Writes the ``physics:approximation`` token via :class:`UsdPhysics.MeshCollisionAPI`.
+ Refer to :const:`~isaaclab.sim.schemas.MESH_APPROXIMATION_TOKENS` for available options.
+ """
+
+
@configclass
class ArticulationRootBaseCfg:
"""Solver-common properties to apply to the root of an articulation.
@@ -335,6 +599,48 @@ class MassPropertiesCfg:
"""
+@configclass
+class MassFragment(SchemaFragment):
+ """Marker base for mass fragments; types the ``mass_props`` slot."""
+
+ pass
+
+
+@configclass
+class MassCfg(MassFragment):
+ """``physics:*`` mass attributes from `UsdPhysics.MassAPI`_.
+
+ The ``UsdPhysics.MassAPI`` schema is applied as the implicit anchor by the mass family writer
+ (:func:`~isaaclab.sim.schemas.apply_mass_properties`), so this fragment owns no applied schema
+ of its own. Mirrors the legacy :class:`MassPropertiesCfg`.
+
+ .. note::
+ A fragment present in a spawner slot means its schema is applied. ``None`` fields are left
+ unchanged on the prim (partial update).
+
+ .. _UsdPhysics.MassAPI: https://openusd.org/dev/api/class_usd_physics_mass_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physics"
+ _usd_applied_schema: ClassVar[str | None] = None # MassAPI applied by the family anchor
+
+ mass: float | None = None
+ """The mass of the rigid body [kg].
+
+ Writes ``physics:mass`` via :class:`UsdPhysics.MassAPI`.
+
+ Note:
+ If ``density`` is non-zero, it takes precedence and is used to compute the mass instead.
+ """
+
+ density: float | None = None
+ """The density of the rigid body [kg/m^3].
+
+ Writes ``physics:density`` via :class:`UsdPhysics.MassAPI`. The density indirectly defines the
+ mass of the rigid body. It is generally computed using the collision approximation of the body.
+ """
+
+
@configclass
class JointDriveBaseCfg:
"""Solver-common properties to define the drive mechanism of a joint.
@@ -468,10 +774,7 @@ class MeshCollisionBaseCfg:
"""
# -- Class metadata (not dataclass fields) --
- # The standard ``UsdPhysics.MeshCollisionAPI`` is always applied by the writer when a
- # mesh-collision cfg is supplied; ``_usd_applied_schema`` here records the standard
- # API name so subclasses that author no PhysX namespace can rely on the writer's
- # standard-vs-PhysX gating logic. PhysX-cooking subclasses override this.
+ # Records the standard API name for the writer's standard-vs-PhysX gating; cooking subclasses override.
_usd_applied_schema: ClassVar[str | None] = "MeshCollisionAPI"
# Base class authors no PhysX-namespaced fields, so no namespace is defined.
_usd_namespace: ClassVar[str | None] = None
diff --git a/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py b/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py
index 3a6fa939a63e..d9f789b666f3 100644
--- a/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py
+++ b/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py
@@ -344,46 +344,103 @@ def _spawn_from_usd_file(
# modify rigid body properties
if cfg.rigid_props is not None:
- schemas.modify_rigid_body_properties(prim_path, cfg.rigid_props)
+ # transition shim, remove later: new fragment list -> apply_*; legacy single cfg -> modify_*
+ rigid_frags = cfg.rigid_props if isinstance(cfg.rigid_props, (list, tuple)) else [cfg.rigid_props]
+ if rigid_frags and all(isinstance(f, schemas.SchemaFragment) for f in rigid_frags):
+ schemas.apply_rigid_body_properties(prim_path, rigid_frags)
+ else:
+ schemas.modify_rigid_body_properties(prim_path, cfg.rigid_props)
# modify collision properties
if cfg.collision_props is not None:
- schemas.modify_collision_properties(prim_path, cfg.collision_props)
- # modify mass properties
+ # transition shim, remove later: new fragment list -> apply_*; legacy single cfg -> modify_*
+ coll_frags = cfg.collision_props if isinstance(cfg.collision_props, (list, tuple)) else [cfg.collision_props]
+ if coll_frags and all(isinstance(f, schemas.SchemaFragment) for f in coll_frags):
+ schemas.apply_collision_properties(prim_path, coll_frags)
+ else:
+ schemas.modify_collision_properties(prim_path, cfg.collision_props)
+ # modify mass properties (transition shim, remove later: fragment list -> apply_*; legacy cfg -> modify_*)
if cfg.mass_props is not None:
- schemas.modify_mass_properties(prim_path, cfg.mass_props)
+ # normalize a single fragment to a list so the convenience form routes like a list
+ mass_frags = [cfg.mass_props] if isinstance(cfg.mass_props, schemas.SchemaFragment) else cfg.mass_props
+ if isinstance(mass_frags, (list, tuple)) and all(isinstance(f, schemas.SchemaFragment) for f in mass_frags):
+ schemas.apply_mass_properties(prim_path, mass_frags)
+ else:
+ schemas.modify_mass_properties(prim_path, cfg.mass_props)
# modify articulation root properties
if cfg.articulation_props is not None:
schemas.modify_articulation_root_properties(prim_path, cfg.articulation_props)
# modify tendon properties
if cfg.fixed_tendons_props is not None:
- schemas.modify_fixed_tendon_properties(prim_path, cfg.fixed_tendons_props)
+ # transition shim, remove later: fragment(s) -> apply_*; legacy cfg -> modify_*
+ # normalize a single fragment to a list so the convenience form (and an empty list) route like a list
+ fixed_tendon_frags = (
+ [cfg.fixed_tendons_props]
+ if isinstance(cfg.fixed_tendons_props, schemas.SchemaFragment)
+ else cfg.fixed_tendons_props
+ )
+ if isinstance(fixed_tendon_frags, (list, tuple)) and all(
+ isinstance(f, schemas.SchemaFragment) for f in fixed_tendon_frags
+ ):
+ schemas.apply_fixed_tendon_properties(prim_path, fixed_tendon_frags)
+ else:
+ schemas.modify_fixed_tendon_properties(prim_path, cfg.fixed_tendons_props)
if cfg.spatial_tendons_props is not None:
- schemas.modify_spatial_tendon_properties(prim_path, cfg.spatial_tendons_props)
+ # transition shim, remove later: fragment(s) -> apply_*; legacy cfg -> modify_*
+ # normalize a single fragment to a list so the convenience form (and an empty list) route like a list
+ spatial_tendon_frags = (
+ [cfg.spatial_tendons_props]
+ if isinstance(cfg.spatial_tendons_props, schemas.SchemaFragment)
+ else cfg.spatial_tendons_props
+ )
+ if isinstance(spatial_tendon_frags, (list, tuple)) and all(
+ isinstance(f, schemas.SchemaFragment) for f in spatial_tendon_frags
+ ):
+ schemas.apply_spatial_tendon_properties(prim_path, spatial_tendon_frags)
+ else:
+ schemas.modify_spatial_tendon_properties(prim_path, cfg.spatial_tendons_props)
# define drive API on the joints
# note: these are only for setting low-level simulation properties. all others should be set or are
# and overridden by the articulation/actuator properties.
if cfg.joint_drive_props is not None:
- # auto-enable body-level gravcomp if joint-level actuator gravcomp is requested
- # without it — actuatorgravcomp has no effect since there are no forces to route.
- # Only auto-populates when the user did not already set ``gravcomp`` themselves;
- # an explicit ``MujocoRigidBodyPropertiesCfg(gravcomp=0.5)`` is preserved as-is.
- from isaaclab_newton.sim.schemas.schemas_cfg import MujocoJointDrivePropertiesCfg, MujocoRigidBodyPropertiesCfg
-
- body_gravcomp_unset = (
- not isinstance(cfg.rigid_props, MujocoRigidBodyPropertiesCfg) or cfg.rigid_props.gravcomp is None
+ # transition shim, remove later: a fragment list -> apply_joint_drive_properties (the
+ # MujocoJointCfg fragment handles its own body-gravcomp coupling in apply_mujoco_joint, so
+ # the fragment path adds no backend coupling here); a legacy single cfg -> the pre-existing
+ # gravcomp auto-enable + modify_joint_drive_properties below.
+ joint_frags = (
+ cfg.joint_drive_props if isinstance(cfg.joint_drive_props, (list, tuple)) else [cfg.joint_drive_props]
)
- if (
- isinstance(cfg.joint_drive_props, MujocoJointDrivePropertiesCfg)
- and cfg.joint_drive_props.actuatorgravcomp
- and body_gravcomp_unset
- ):
- logger.info(
- "Joint-level actuator gravity compensation requires body-level gravcomp."
- " Auto-setting MujocoRigidBodyPropertiesCfg(gravcomp=1.0)."
+ if joint_frags and all(isinstance(f, schemas.SchemaFragment) for f in joint_frags):
+ schemas.apply_joint_drive_properties(prim_path, joint_frags, ensure_drives_exist=cfg.ensure_drives_exist)
+ else:
+ # auto-enable body-level gravcomp if joint-level actuator gravcomp is requested
+ # without it — actuatorgravcomp has no effect since there are no forces to route.
+ # Only auto-populates when the user did not already set ``gravcomp`` themselves;
+ # an explicit ``MujocoRigidBodyPropertiesCfg(gravcomp=0.5)`` is preserved as-is.
+ from isaaclab_newton.sim.schemas.schemas_cfg import (
+ MujocoJointDrivePropertiesCfg,
+ MujocoRigidBodyCfg,
+ MujocoRigidBodyPropertiesCfg,
+ )
+
+ # gravcomp may be authored either via the legacy MujocoRigidBodyPropertiesCfg or via a
+ # MujocoRigidBodyCfg fragment in a rigid_props list. Treat either as "already set".
+ rigid_props_list = cfg.rigid_props if isinstance(cfg.rigid_props, (list, tuple)) else [cfg.rigid_props]
+ body_gravcomp_unset = not any(
+ isinstance(f, (MujocoRigidBodyPropertiesCfg, MujocoRigidBodyCfg)) and f.gravcomp is not None
+ for f in rigid_props_list
)
- schemas.modify_rigid_body_properties(prim_path, MujocoRigidBodyPropertiesCfg(gravcomp=1.0))
- schemas.modify_joint_drive_properties(prim_path, cfg.joint_drive_props)
+ if (
+ isinstance(cfg.joint_drive_props, MujocoJointDrivePropertiesCfg)
+ and cfg.joint_drive_props.actuatorgravcomp
+ and body_gravcomp_unset
+ ):
+ logger.info(
+ "Joint-level actuator gravity compensation requires body-level gravcomp."
+ " Auto-setting MujocoRigidBodyPropertiesCfg(gravcomp=1.0)."
+ )
+ schemas.modify_rigid_body_properties(prim_path, MujocoRigidBodyPropertiesCfg(gravcomp=1.0))
+ schemas.modify_joint_drive_properties(prim_path, cfg.joint_drive_props)
# define deformable body properties, or modify if deformable body API is present (PhysX only)
if cfg.deformable_props is not None:
diff --git a/source/isaaclab/isaaclab/sim/spawners/from_files/from_files_cfg.py b/source/isaaclab/isaaclab/sim/spawners/from_files/from_files_cfg.py
index 22857f8d45b1..ea2cfe9b6c9f 100644
--- a/source/isaaclab/isaaclab/sim/spawners/from_files/from_files_cfg.py
+++ b/source/isaaclab/isaaclab/sim/spawners/from_files/from_files_cfg.py
@@ -37,15 +37,36 @@ class FileCfg(RigidObjectSpawnerCfg, DeformableObjectSpawnerCfg):
articulation_props: schemas.ArticulationRootPropertiesCfg | None = None
"""Properties to apply to the articulation root."""
- fixed_tendons_props: schemas.FixedTendonPropertiesCfg | None = None
- """Properties to apply to the fixed tendons (if any)."""
+ fixed_tendons_props: (
+ schemas.FixedTendonPropertiesCfg | schemas.FixedTendonFragment | list[schemas.FixedTendonFragment] | None
+ ) = None
+ """Properties to apply to the fixed tendons (if any).
- spatial_tendons_props: schemas.SpatialTendonPropertiesCfg | None = None
- """Properties to apply to the spatial tendons (if any)."""
+ Accepts either the legacy :class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonPropertiesCfg`
+ or one or more :class:`~isaaclab.sim.schemas.FixedTendonFragment` instances.
+ """
+
+ spatial_tendons_props: (
+ schemas.SpatialTendonPropertiesCfg | schemas.SpatialTendonFragment | list[schemas.SpatialTendonFragment] | None
+ ) = None
+ """Properties to apply to the spatial tendons (if any).
+
+ Accepts either the legacy :class:`~isaaclab_physx.sim.schemas.PhysxSpatialTendonPropertiesCfg`
+ or one or more :class:`~isaaclab.sim.schemas.SpatialTendonFragment` instances.
+ """
- joint_drive_props: schemas.JointDriveBaseCfg | None = None
+ joint_drive_props: (
+ schemas.JointDriveBaseCfg | schemas.JointDriveFragment | list[schemas.JointDriveFragment] | None
+ ) = None
"""Properties to apply to a joint.
+ Accepts either a single legacy cfg (e.g. :class:`~isaaclab.sim.schemas.JointDriveBaseCfg`) or a
+ list of :class:`~isaaclab.sim.schemas.JointDriveFragment` fragments
+ (e.g. ``[UsdPhysicsDriveCfg(...), PhysxJointCfg(...)]``). When a fragment list is given,
+ ``UsdPhysics.DriveAPI`` is applied (presence-gated) only when a
+ :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` fragment is present, and each fragment writes
+ its own namespace.
+
.. note::
The joint drive properties set the USD attributes of all the joint drives in the asset.
We recommend using this attribute sparingly and only when necessary. Instead, please use the
@@ -53,6 +74,17 @@ class FileCfg(RigidObjectSpawnerCfg, DeformableObjectSpawnerCfg):
for specific joints in an articulation.
"""
+ ensure_drives_exist: bool = False
+ """Whether to ensure every joint drive is active when authoring :attr:`joint_drive_props`.
+
+ When True, any joint drive whose authored stiffness *and* damping are both zero is given a
+ minimal stiffness (``1e-3``) so that backends (e.g. Newton) create proper actuators for it.
+ This is a spawner-level behavior flag (not a USD attribute and not a fragment field). It is
+ only consumed when :attr:`joint_drive_props` is given as a fragment list; legacy
+ :class:`~isaaclab.sim.schemas.JointDriveBaseCfg` cfgs carry their own
+ ``ensure_drives_exist`` field.
+ """
+
visual_material_path: str = "material"
"""Path to the visual material to use for the prim. Defaults to "material".
diff --git a/source/isaaclab/isaaclab/sim/spawners/meshes/meshes.py b/source/isaaclab/isaaclab/sim/spawners/meshes/meshes.py
index cfc7f51b9ff2..bf0df38db129 100644
--- a/source/isaaclab/isaaclab/sim/spawners/meshes/meshes.py
+++ b/source/isaaclab/isaaclab/sim/spawners/meshes/meshes.py
@@ -415,7 +415,12 @@ def _spawn_mesh_geom_from_mesh(
mesh_collision_api = UsdPhysics.MeshCollisionAPI.Apply(mesh_prim)
mesh_collision_api.GetApproximationAttr().Set(collision_approximation)
# apply collision properties
- schemas.define_collision_properties(mesh_prim_path, cfg.collision_props, stage=stage)
+ # transition shim, remove later: new fragment list -> apply_*; legacy single cfg -> define_*
+ coll_frags = cfg.collision_props if isinstance(cfg.collision_props, (list, tuple)) else [cfg.collision_props]
+ if coll_frags and all(isinstance(f, schemas.SchemaFragment) for f in coll_frags):
+ schemas.apply_collision_properties(mesh_prim_path, coll_frags, stage=stage)
+ else:
+ schemas.define_collision_properties(mesh_prim_path, cfg.collision_props, stage=stage)
# apply visual material
if cfg.visual_material is not None:
@@ -441,8 +446,17 @@ def _spawn_mesh_geom_from_mesh(
# note: we apply the rigid properties to the parent prim in case of rigid objects.
if cfg.rigid_props is not None:
- # apply mass properties
+ # apply mass properties (transition shim, remove later: fragment list -> apply_*; legacy cfg -> define_*)
if cfg.mass_props is not None:
- schemas.define_mass_properties(prim_path, cfg.mass_props, stage=stage)
- # apply rigid properties
- schemas.define_rigid_body_properties(prim_path, cfg.rigid_props, stage=stage)
+ # normalize a single fragment to a list so the convenience form routes like a list
+ mass_frags = [cfg.mass_props] if isinstance(cfg.mass_props, schemas.SchemaFragment) else cfg.mass_props
+ if isinstance(mass_frags, (list, tuple)) and all(isinstance(f, schemas.SchemaFragment) for f in mass_frags):
+ schemas.apply_mass_properties(prim_path, mass_frags, stage=stage)
+ else:
+ schemas.define_mass_properties(prim_path, cfg.mass_props, stage=stage)
+ # apply rigid properties (transition shim, remove later: fragment list -> apply_*; legacy cfg -> define_*)
+ rigid_frags = cfg.rigid_props if isinstance(cfg.rigid_props, (list, tuple)) else [cfg.rigid_props]
+ if rigid_frags and all(isinstance(f, schemas.SchemaFragment) for f in rigid_frags):
+ schemas.apply_rigid_body_properties(prim_path, rigid_frags, stage=stage)
+ else:
+ schemas.define_rigid_body_properties(prim_path, cfg.rigid_props, stage=stage)
diff --git a/source/isaaclab/isaaclab/sim/spawners/shapes/shapes.py b/source/isaaclab/isaaclab/sim/spawners/shapes/shapes.py
index 9e8eafc1c578..2d1b721e9567 100644
--- a/source/isaaclab/isaaclab/sim/spawners/shapes/shapes.py
+++ b/source/isaaclab/isaaclab/sim/spawners/shapes/shapes.py
@@ -294,7 +294,12 @@ def _spawn_geom_from_prim_type(
create_prim(mesh_prim_path, prim_type, scale=scale, attributes=attributes, stage=stage)
# apply collision properties
if cfg.collision_props is not None:
- schemas.define_collision_properties(mesh_prim_path, cfg.collision_props, stage=stage)
+ # transition shim, remove later: new fragment list -> apply_*; legacy single cfg -> define_*
+ coll_frags = cfg.collision_props if isinstance(cfg.collision_props, (list, tuple)) else [cfg.collision_props]
+ if coll_frags and all(isinstance(f, schemas.SchemaFragment) for f in coll_frags):
+ schemas.apply_collision_properties(mesh_prim_path, coll_frags, stage=stage)
+ else:
+ schemas.define_collision_properties(mesh_prim_path, cfg.collision_props, stage=stage)
# apply visual material
if cfg.visual_material is not None:
if not cfg.visual_material_path.startswith("/"):
@@ -319,7 +324,18 @@ def _spawn_geom_from_prim_type(
# note: we apply rigid properties in the end to later make the instanceable prim
# apply mass properties
if cfg.mass_props is not None:
- schemas.define_mass_properties(prim_path, cfg.mass_props, stage=stage)
+ # transition shim, remove later: fragment(s) -> apply_*; legacy cfg -> define_*
+ # normalize a single fragment to a list so the convenience form routes like a list
+ mass_frags = [cfg.mass_props] if isinstance(cfg.mass_props, schemas.SchemaFragment) else cfg.mass_props
+ if isinstance(mass_frags, (list, tuple)) and all(isinstance(f, schemas.SchemaFragment) for f in mass_frags):
+ schemas.apply_mass_properties(prim_path, mass_frags, stage=stage)
+ else:
+ schemas.define_mass_properties(prim_path, cfg.mass_props, stage=stage)
# apply rigid body properties
if cfg.rigid_props is not None:
- schemas.define_rigid_body_properties(prim_path, cfg.rigid_props, stage=stage)
+ # transition shim, remove later: new fragment list -> apply_*; legacy single cfg -> define_*
+ rigid_frags = cfg.rigid_props if isinstance(cfg.rigid_props, (list, tuple)) else [cfg.rigid_props]
+ if rigid_frags and all(isinstance(f, schemas.SchemaFragment) for f in rigid_frags):
+ schemas.apply_rigid_body_properties(prim_path, rigid_frags, stage=stage)
+ else:
+ schemas.define_rigid_body_properties(prim_path, cfg.rigid_props, stage=stage)
diff --git a/source/isaaclab/isaaclab/sim/spawners/spawner_cfg.py b/source/isaaclab/isaaclab/sim/spawners/spawner_cfg.py
index 3f1eef72a2fa..5a655ce38dbe 100644
--- a/source/isaaclab/isaaclab/sim/spawners/spawner_cfg.py
+++ b/source/isaaclab/isaaclab/sim/spawners/spawner_cfg.py
@@ -82,18 +82,40 @@ class RigidObjectSpawnerCfg(SpawnerCfg):
to the prim outside of the properties available by default when spawning the prim.
"""
- mass_props: schemas.MassPropertiesCfg | None = None
- """Mass properties."""
+ mass_props: schemas.MassPropertiesCfg | schemas.MassFragment | list[schemas.MassFragment] | None = None
+ """Mass properties.
+
+ Accepts either a single legacy :class:`~isaaclab.sim.schemas.MassPropertiesCfg` or a list of
+ :class:`~isaaclab.sim.schemas.MassFragment` fragments (e.g. ``[MassCfg(...)]``). When a fragment
+ list is given, ``UsdPhysics.MassAPI`` is applied as the implicit anchor and each fragment writes
+ its own namespace.
+ """
- rigid_props: schemas.RigidBodyBaseCfg | None = None
+ rigid_props: schemas.RigidBodyBaseCfg | schemas.RigidBodyFragment | list[schemas.RigidBodyFragment] | None = None
"""Rigid body properties.
+ Accepts either a single legacy cfg (e.g. :class:`~isaaclab.sim.schemas.RigidBodyBaseCfg`) or a
+ list of :class:`~isaaclab.sim.schemas.RigidBodyFragment` fragments
+ (e.g. ``[UsdPhysicsRigidBodyCfg(...), PhysxRigidBodyCfg(...)]``). When a fragment list is given,
+ ``UsdPhysics.RigidBodyAPI`` is applied as the implicit anchor and each fragment writes its own
+ namespace.
+
For making a rigid object static, set the :attr:`schemas.RigidBodyBaseCfg.kinematic_enabled`
- as True. This will make the object static and will not be affected by gravity or other forces.
+ (or :attr:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg.kinematic_enabled`) as True. This will
+ make the object static and will not be affected by gravity or other forces.
"""
- collision_props: schemas.CollisionPropertiesCfg | None = None
- """Properties to apply to all collision meshes."""
+ collision_props: (
+ schemas.CollisionPropertiesCfg | schemas.CollisionFragment | list[schemas.CollisionFragment] | None
+ ) = None
+ """Properties to apply to all collision meshes.
+
+ Accepts either a single legacy cfg (e.g. :class:`~isaaclab.sim.schemas.CollisionBaseCfg`) or a
+ list of :class:`~isaaclab.sim.schemas.CollisionFragment` fragments
+ (e.g. ``[UsdPhysicsCollisionCfg(...), PhysxCollisionCfg(...)]``). When a fragment list is given,
+ ``UsdPhysics.CollisionAPI`` is applied as the implicit anchor and each fragment writes its own
+ namespace.
+ """
activate_contact_sensors: bool = False
"""Activate contact reporting on all rigid bodies. Defaults to False.
diff --git a/source/isaaclab/isaaclab/sim/utils/stage.py b/source/isaaclab/isaaclab/sim/utils/stage.py
index 2a9cf12ffddd..d4c87f4c2e75 100644
--- a/source/isaaclab/isaaclab/sim/utils/stage.py
+++ b/source/isaaclab/isaaclab/sim/utils/stage.py
@@ -59,6 +59,17 @@ def _check_ancestral_node(node) -> bool:
return _check_ancestral_node(prim_index.rootNode)
+def _is_uri_path(asset_path: str) -> bool:
+ """Return whether an asset path has an explicit URI scheme."""
+ scheme = asset_path.split("://", 1)[0]
+ return (
+ scheme != asset_path
+ and len(scheme) > 1
+ and scheme[0].isalpha()
+ and all(c.isalnum() or c in "+-." for c in scheme[1:])
+ )
+
+
def resolve_paths(
src_layer_identifier: str,
dst_layer_identifier: str,
@@ -105,9 +116,11 @@ def resolve_paths(
dst_dir = os.path.dirname(dst_layer.realPath or dst_layer.identifier)
def _modify_path(asset_path: str) -> str:
- if not asset_path:
+ if not asset_path or _is_uri_path(asset_path):
return asset_path
resolved = src_layer.ComputeAbsolutePath(asset_path)
+ if resolved and _is_uri_path(resolved):
+ return resolved
if store_relative_path and resolved and dst_dir:
try:
return os.path.relpath(resolved, dst_dir)
diff --git a/source/isaaclab/isaaclab/utils/renderers.py b/source/isaaclab/isaaclab/utils/renderers.py
new file mode 100644
index 000000000000..171204e95014
--- /dev/null
+++ b/source/isaaclab/isaaclab/utils/renderers.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Renderer-related utility helpers."""
+
+import os
+
+
+def isaac_rtx_per_env_scene_partition_enabled() -> bool:
+ """Return whether per-environment RTX scene partitioning is enabled.
+
+ Partitioning is opt-in: set ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1``
+ to enable authoring of ``primvars:omni:scenePartition`` and ``omni:scenePartition``
+ on the USD stage.
+ """
+ return os.environ.get("ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION", "0") == "1"
diff --git a/source/isaaclab/pyproject.toml b/source/isaaclab/pyproject.toml
index 03511cf9f6db..f78b99332415 100644
--- a/source/isaaclab/pyproject.toml
+++ b/source/isaaclab/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab"
-version = "7.0.5"
+version = "7.4.0"
description = "Extension providing main framework interfaces and abstractions for robot learning."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
diff --git a/source/isaaclab/test/assets/test_articulation_iface.py b/source/isaaclab/test/assets/test_articulation_iface.py
index 8dbf19291c80..989cfa4667f2 100644
--- a/source/isaaclab/test/assets/test_articulation_iface.py
+++ b/source/isaaclab/test/assets/test_articulation_iface.py
@@ -1097,6 +1097,133 @@ def test_body_com_pose_b(self, backend, num_instances, num_joints, num_bodies, d
name="body_com_pose_b",
)
+ @pytest.mark.skipif("physx" not in BACKENDS, reason="PhysX backend unavailable")
+ def test_physx_body_com_pose_b_is_cached_across_sim_timestamps(self):
+ art, view = get_articulation("physx", num_instances=2, num_joints=3, num_bodies=4, device="cpu")
+
+ num_get_coms_calls = 0
+ get_coms = view.get_coms
+
+ def counted_get_coms():
+ nonlocal num_get_coms_calls
+ num_get_coms_calls += 1
+ return get_coms()
+
+ view.get_coms = counted_get_coms
+
+ art.data.update(dt=0.01)
+ art.data.body_com_pose_b
+ assert num_get_coms_calls == 1
+
+ art.data.update(dt=0.01)
+ art.data.body_com_pose_b
+ assert num_get_coms_calls == 1
+
+ @pytest.mark.skipif("physx" not in BACKENDS, reason="PhysX backend unavailable")
+ def test_physx_set_coms_index_updates_body_com_pose_b_cache(self):
+ art, view = get_articulation("physx", num_instances=2, num_joints=3, num_bodies=4, device="cpu")
+
+ num_get_coms_calls = 0
+ get_coms = view.get_coms
+
+ def counted_get_coms():
+ nonlocal num_get_coms_calls
+ num_get_coms_calls += 1
+ return get_coms()
+
+ view.get_coms = counted_get_coms
+
+ coms = wp.zeros((art.num_instances, art.num_bodies), dtype=wp.transformf, device="cpu")
+ art.set_coms_index(coms=coms, full_data=True)
+ art.data.body_com_pose_b
+
+ assert num_get_coms_calls == 0
+
+ @pytest.mark.skipif("physx" not in BACKENDS, reason="PhysX backend unavailable")
+ def test_physx_joint_position_write_preserves_body_com_pose_b_cache(self):
+ art, view = get_articulation("physx", num_instances=2, num_joints=3, num_bodies=4, device="cpu")
+
+ num_get_coms_calls = 0
+ get_coms = view.get_coms
+
+ def counted_get_coms():
+ nonlocal num_get_coms_calls
+ num_get_coms_calls += 1
+ return get_coms()
+
+ view.get_coms = counted_get_coms
+
+ art.data.update(dt=0.01)
+ art.data.body_com_pose_b
+ assert num_get_coms_calls == 1
+
+ joint_pos = torch.zeros((art.num_instances, art.num_joints), device="cpu")
+ art.write_joint_position_to_sim_index(position=joint_pos, full_data=True)
+ art.data.body_com_pose_b
+
+ assert num_get_coms_calls == 1
+
+ @pytest.mark.skipif("physx" not in BACKENDS, reason="PhysX backend unavailable")
+ def test_physx_partial_set_coms_index_initializes_cold_body_com_pose_b_cache(self):
+ art, view = get_articulation("physx", num_instances=2, num_joints=3, num_bodies=4, device="cpu")
+ initial_coms = view.get_coms().numpy().copy()
+
+ num_get_coms_calls = 0
+ get_coms = view.get_coms
+
+ def counted_get_coms():
+ nonlocal num_get_coms_calls
+ num_get_coms_calls += 1
+ return get_coms()
+
+ view.get_coms = counted_get_coms
+
+ coms = wp.zeros((1, 1), dtype=wp.transformf, device="cpu")
+ art.set_coms_index(
+ coms=coms,
+ env_ids=wp.array([0], dtype=wp.int32, device="cpu"),
+ body_ids=wp.array([0], dtype=wp.int32, device="cpu"),
+ )
+ body_com_pose_b = art.data.body_com_pose_b.torch
+
+ assert num_get_coms_calls == 1
+ torch.testing.assert_close(body_com_pose_b[1, 1], torch.from_numpy(initial_coms[1, 1]))
+
+ @pytest.mark.skipif("physx" not in BACKENDS, reason="PhysX backend unavailable")
+ def test_physx_set_coms_index_invalidates_body_com_pose_b_dependents(self):
+ art, _ = get_articulation("physx", num_instances=2, num_joints=3, num_bodies=4, device="cpu")
+
+ art.data.update(dt=0.01)
+ dependent_buffers = [
+ ("root_com_pose_w", art.data._root_com_pose_w),
+ ("root_com_vel_w", art.data._root_com_vel_w),
+ ("root_link_vel_w", art.data._root_link_vel_w),
+ ("body_com_pose_w", art.data._body_com_pose_w),
+ ("body_com_vel_w", art.data._body_com_vel_w),
+ ("body_link_vel_w", art.data._body_link_vel_w),
+ ("root_link_lin_vel_b", art.data._root_link_lin_vel_b),
+ ("root_link_ang_vel_b", art.data._root_link_ang_vel_b),
+ ("root_com_lin_vel_b", art.data._root_com_lin_vel_b),
+ ("root_com_ang_vel_b", art.data._root_com_ang_vel_b),
+ ("root_state_w", art.data._root_state_w),
+ ("root_link_state_w", art.data._root_link_state_w),
+ ("root_com_state_w", art.data._root_com_state_w),
+ ("body_state_w", art.data._body_state_w),
+ ("body_link_state_w", art.data._body_link_state_w),
+ ("body_com_state_w", art.data._body_com_state_w),
+ ("body_com_jacobian_w", art.data._body_com_jacobian_w),
+ ("mass_matrix", art.data._mass_matrix),
+ ("gravity_compensation_forces", art.data._gravity_compensation_forces),
+ ]
+ for _, buffer in dependent_buffers:
+ buffer.timestamp = art.data._sim_timestamp
+
+ coms = wp.zeros((art.num_instances, art.num_bodies), dtype=wp.transformf, device="cpu")
+ art.set_coms_index(coms=coms, full_data=True)
+
+ for name, buffer in dependent_buffers:
+ assert buffer.timestamp < art.data._sim_timestamp, name
+
@_backends
@_default_dims
@_default_devices
diff --git a/source/isaaclab/test/controllers/test_differential_ik_features.py b/source/isaaclab/test/controllers/test_differential_ik_features.py
new file mode 100644
index 000000000000..40ce0dd3d5c8
--- /dev/null
+++ b/source/isaaclab/test/controllers/test_differential_ik_features.py
@@ -0,0 +1,195 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Sim-free unit tests for the optional :class:`DifferentialIKController` features.
+
+Covers the ``adaptive_dls`` ik-method, per-axis orientation weighting, null-space joint-limit
+avoidance, and quaternion renormalization -- all exercised with hand-built tensors (no gym.make,
+USD, or GPU). The simulated convergence tests live in ``test_differential_ik.py``.
+"""
+
+import math
+
+import pytest
+import torch
+
+from isaaclab.controllers.differential_ik import DifferentialIKController
+from isaaclab.controllers.differential_ik_cfg import DifferentialIKControllerCfg
+
+_NUM_JOINTS = 5
+_ID_QUAT = [0.0, 0.0, 0.0, 1.0] # xyzw identity
+
+
+def _quat_xyzw(axis: list[float], angle: float) -> list[float]:
+ """Build a unit xyzw quaternion from an axis (need not be unit) and angle [rad]."""
+ norm = math.sqrt(sum(a * a for a in axis)) or 1.0
+ s = math.sin(angle / 2.0)
+ return [axis[0] / norm * s, axis[1] / norm * s, axis[2] / norm * s, math.cos(angle / 2.0)]
+
+
+def _make_controller(
+ command_type: str = "pose",
+ ik_method: str = "adaptive_dls",
+ ik_params: dict | None = None,
+ orientation_weight=None,
+ joint_limit_avoidance_gain: float = 0.0,
+ joint_limit_avoidance_margin: float = 0.3,
+ num_envs: int = 1,
+) -> DifferentialIKController:
+ cfg = DifferentialIKControllerCfg(
+ command_type=command_type,
+ use_relative_mode=False,
+ ik_method=ik_method,
+ ik_params=ik_params,
+ orientation_weight=orientation_weight,
+ joint_limit_avoidance_gain=joint_limit_avoidance_gain,
+ joint_limit_avoidance_margin=joint_limit_avoidance_margin,
+ )
+ return DifferentialIKController(cfg, num_envs=num_envs, device="cpu")
+
+
+def test_adaptive_dls_default_params():
+ """The cfg fills the adaptive_dls defaults when ``ik_params`` is not provided."""
+ cfg = DifferentialIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="adaptive_dls")
+ assert set(cfg.ik_params) == {"lambda_min", "lambda_max", "sigma_thresh"}
+
+
+def test_cfg_rejects_bad_orientation_weight():
+ with pytest.raises(ValueError):
+ DifferentialIKControllerCfg(
+ command_type="pose", use_relative_mode=False, ik_method="dls", orientation_weight=(0.3, 0.3)
+ )
+
+
+def test_cfg_rejects_bad_adaptive_params():
+ with pytest.raises(ValueError):
+ DifferentialIKControllerCfg(
+ command_type="pose",
+ use_relative_mode=False,
+ ik_method="adaptive_dls",
+ ik_params={"lambda_min": 0.5, "lambda_max": 0.1, "sigma_thresh": 0.02},
+ )
+
+
+def test_set_command_renormalizes_quat():
+ """A non-unit commanded quaternion is stored renormalized in pose (absolute) mode."""
+ c = _make_controller()
+ raw = torch.tensor([0.2588, 0.0, 0.0, 0.9659]) # xyzw
+ cmd = torch.cat([torch.tensor([0.3, -0.1, 0.2]), raw * 3.0]).unsqueeze(0) # non-unit
+ c.set_command(cmd)
+ stored = c.ee_quat_des[0]
+ assert torch.linalg.norm(stored).item() == pytest.approx(1.0, abs=1e-6)
+ torch.testing.assert_close(stored, raw / torch.linalg.norm(raw), atol=1e-6, rtol=0.0)
+
+
+def test_orientation_weight_none_is_unweighted():
+ """With no orientation weight, the pose task Jacobian equals the raw Jacobian."""
+ c = _make_controller(orientation_weight=None)
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ ee_quat = torch.tensor([_ID_QUAT])
+ c.set_command(torch.tensor([[0.31, 0.0, 0.2] + _quat_xyzw([1.0, 0.0, 0.0], 0.5)]))
+ jac = torch.arange(6 * _NUM_JOINTS, dtype=torch.float32).reshape(1, 6, _NUM_JOINTS)
+ task_jac, _ = c._compute_pose_task(ee_pos, ee_quat, jac)
+ torch.testing.assert_close(task_jac, jac)
+
+
+def test_orientation_weight_per_axis_scales_rows_and_error():
+ """A per-axis (wx, wy, wz) weight scales each base-frame orientation row and error; wz=0 drops
+ the yaw row. Position rows/error are untouched."""
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ ee_quat = torch.tensor([_ID_QUAT])
+ jac = torch.arange(6 * _NUM_JOINTS, dtype=torch.float32).reshape(1, 6, _NUM_JOINTS)
+ cmd = torch.tensor([[0.31, 0.0, 0.2] + _quat_xyzw([0.3, 0.5, 0.8], 0.7)])
+
+ base = _make_controller(orientation_weight=None)
+ base.set_command(cmd)
+ jb, eb = base._compute_pose_task(ee_pos, ee_quat, jac)
+
+ c = _make_controller(orientation_weight=(0.4, 0.2, 0.0))
+ c.set_command(cmd)
+ jp, ep = c._compute_pose_task(ee_pos, ee_quat, jac)
+
+ torch.testing.assert_close(jp[:, :3, :], jb[:, :3, :]) # position rows unchanged
+ torch.testing.assert_close(jp[:, 3, :], 0.4 * jb[:, 3, :])
+ torch.testing.assert_close(jp[:, 4, :], 0.2 * jb[:, 4, :])
+ torch.testing.assert_close(jp[:, 5, :], torch.zeros_like(jb[:, 5, :])) # yaw dropped
+ torch.testing.assert_close(ep[:, :3], eb[:, :3])
+ torch.testing.assert_close(ep[:, 3], 0.4 * eb[:, 3])
+ torch.testing.assert_close(ep[:, 5], torch.zeros_like(eb[:, 5]))
+
+
+def test_compute_pose_task_quat_convention_xyzw():
+ """Discriminating regression for the xyzw quaternion convention: commanding the EE's current
+ orientation yields zero orientation error. A wxyz mis-read would corrupt this."""
+ rot = pytest.importorskip("scipy.spatial.transform").Rotation.from_euler("x", 30.0, degrees=True)
+ q_xyzw = rot.as_quat() # [x, y, z, w]
+ ee_quat = torch.tensor(q_xyzw, dtype=torch.float32).unsqueeze(0)
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ c = _make_controller(orientation_weight=1.0)
+ cmd = torch.cat([torch.tensor([0.3, 0.0, 0.2]), torch.tensor(q_xyzw, dtype=torch.float32)]).unsqueeze(0)
+ c.set_command(cmd)
+ _, err = c._compute_pose_task(ee_pos, ee_quat, torch.zeros(1, 6, _NUM_JOINTS))
+ assert torch.linalg.norm(err[0, 3:6]).item() == pytest.approx(0.0, abs=1e-6)
+
+
+def test_adaptive_dls_damps_singularity():
+ """Near a task-Jacobian singularity, the adaptive ramp produces a smaller (more damped) and
+ finite step than a fixed ``lambda_min`` solve would."""
+ c = _make_controller(ik_params={"lambda_min": 0.01, "lambda_max": 0.5, "sigma_thresh": 0.1})
+ j_task = torch.zeros(1, 6, _NUM_JOINTS)
+ j_task[0, 0, 0] = j_task[0, 1, 1] = j_task[0, 2, 2] = 1.0 # well-conditioned position block
+ eps = 1e-3
+ j_task[0, 3, 3] = j_task[0, 4, 4] = eps # near-singular orientation block
+ err = torch.zeros(1, 6)
+ err[0, 3] = err[0, 4] = 1.0
+
+ dq = c._compute_delta_joint_pos(delta_pose=err, jacobian=j_task)
+ # reference: fixed lambda_min damped least squares
+ jt = j_task.transpose(1, 2)
+ a_min = torch.bmm(j_task, jt) + (0.01**2) * torch.eye(6)
+ dq_min = torch.bmm(jt, torch.linalg.solve(a_min, err.unsqueeze(-1))).squeeze(-1)
+ assert torch.isfinite(dq).all()
+ assert dq.norm().item() < dq_min.norm().item()
+
+
+def test_joint_limit_avoidance_zero_when_disabled():
+ """JLA returns zeros when joint_limit_avoidance_gain == 0 (default) or before limits are provided."""
+ c = _make_controller(joint_limit_avoidance_gain=0.0)
+ out = c._joint_limit_avoidance(torch.zeros(1, _NUM_JOINTS), torch.ones(1, 6, _NUM_JOINTS))
+ torch.testing.assert_close(out, torch.zeros(1, _NUM_JOINTS))
+ # enabled but limits not set yet -> still zeros
+ c2 = _make_controller(joint_limit_avoidance_gain=1.0)
+ out2 = c2._joint_limit_avoidance(torch.zeros(1, _NUM_JOINTS), torch.ones(1, 6, _NUM_JOINTS))
+ torch.testing.assert_close(out2, torch.zeros(1, _NUM_JOINTS))
+
+
+def test_joint_limit_avoidance_stays_in_position_nullspace():
+ """When enabled, the JLA correction lies in the null space of the position rows, so it does not
+ perturb the commanded end-effector position (``J_pos @ correction ~= 0``)."""
+ c = _make_controller(joint_limit_avoidance_gain=2.0, joint_limit_avoidance_margin=0.3)
+ c.set_joint_pos_limits(torch.full((_NUM_JOINTS,), -1.0), torch.full((_NUM_JOINTS,), 1.0))
+ # a generic well-conditioned task Jacobian
+ torch.manual_seed(0)
+ j_task = torch.randn(1, 6, _NUM_JOINTS)
+ # joints near their limits -> non-zero center-seeking bias
+ joint_pos = torch.tensor([[0.95, -0.9, 0.0, 0.8, -0.85]])
+ correction = c._joint_limit_avoidance(joint_pos, j_task)
+ assert correction.norm().item() > 0.0 # bias is active
+ residual = torch.bmm(j_task[:, :3, :], correction.unsqueeze(-1)).squeeze(-1)
+ torch.testing.assert_close(residual, torch.zeros_like(residual), atol=1e-5, rtol=0.0)
+
+
+def test_compute_returns_joint_targets_shape():
+ """compute returns one target per joint (joint_pos + delta)."""
+ c = _make_controller(orientation_weight=(0.5, 0.5, 0.0), joint_limit_avoidance_gain=0.5)
+ c.set_joint_pos_limits(torch.full((_NUM_JOINTS,), -1.0), torch.full((_NUM_JOINTS,), 1.0))
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ ee_quat = torch.tensor([_ID_QUAT])
+ c.set_command(torch.tensor([[0.31, 0.0, 0.2] + _ID_QUAT]))
+ jac = torch.zeros(1, 6, _NUM_JOINTS)
+ for i in range(5):
+ jac[0, i, i] = 1.0
+ out = c.compute(ee_pos, ee_quat, jac, torch.zeros(1, _NUM_JOINTS))
+ assert out.shape == (1, _NUM_JOINTS)
diff --git a/source/isaaclab/test/install_ci/Dockerfile.installci b/source/isaaclab/test/install_ci/Dockerfile.installci
index 662af204ce33..68b127df7b34 100644
--- a/source/isaaclab/test/install_ci/Dockerfile.installci
+++ b/source/isaaclab/test/install_ci/Dockerfile.installci
@@ -42,9 +42,9 @@ RUN apt-get update && \
sudo \
&& rm -rf /var/lib/apt/lists/*
-# ARM-specific build deps (swig, GL/X11 dev headers) are intentionally NOT
-# pre-installed here. ``./isaaclab.sh -i`` auto-installs them via apt when
-# missing, so install_ci exercises the real user-visible install path on ARM.
+# ARM-specific GL/X11 dev headers are intentionally NOT pre-installed here.
+# ``./isaaclab.sh -i`` auto-installs them via apt when missing, so install_ci
+# exercises the real user-visible install path on ARM.
# Make python3 the default python
RUN ln -sf /usr/bin/python3 /usr/bin/python
@@ -100,7 +100,7 @@ RUN if getent passwd ubuntu >/dev/null; then userdel -r ubuntu; fi \
&& chown -R isaaclab:isaaclab ${ISAACLAB_PATH}
# Passwordless sudo for the runtime user so ``./isaaclab.sh -i`` can apt-get
-# install missing build deps (swig, GL/X11) without prompting at test time.
+# install missing GL/X11 build deps without prompting at test time.
RUN echo "isaaclab ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/isaaclab \
&& chmod 0440 /etc/sudoers.d/isaaclab
diff --git a/source/isaaclab/test/sim/test_collision_fragments.py b/source/isaaclab/test/sim/test_collision_fragments.py
new file mode 100644
index 000000000000..698006595928
--- /dev/null
+++ b/source/isaaclab/test/sim/test_collision_fragments.py
@@ -0,0 +1,170 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch Isaac Sim Simulator first."""
+
+from isaaclab.app import AppLauncher
+
+# launch omniverse app
+simulation_app = AppLauncher(headless=True).app
+
+"""Rest everything follows."""
+
+from pxr import UsdGeom, UsdPhysics
+
+import isaaclab.sim as sim_utils
+from isaaclab.sim import SimulationCfg, SimulationContext
+
+
+def _make_xform(stage, path="/World/Body"):
+ UsdGeom.Xform.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+# -------------------------------------------------------------------------------------
+# CollisionFragment marker + UsdPhysicsCollisionCfg
+# -------------------------------------------------------------------------------------
+
+
+def test_collision_fragment_metadata_defaults():
+ from isaaclab.sim.schemas import CollisionFragment, SchemaFragment, UsdPhysicsCollisionCfg
+
+ cfg = UsdPhysicsCollisionCfg(collision_enabled=True)
+ assert isinstance(cfg, CollisionFragment) and isinstance(cfg, SchemaFragment)
+ assert type(cfg)._usd_namespace == "physics"
+ assert type(cfg)._usd_applied_schema is None # anchor applies CollisionAPI, not the fragment
+ assert cfg.func == "isaaclab.sim.schemas:apply_namespaced"
+ assert cfg.collision_enabled is True
+
+
+# -------------------------------------------------------------------------------------
+# UsdPhysicsCollisionCfg writes its physics namespace via apply_namespaced
+# -------------------------------------------------------------------------------------
+
+
+def test_usd_physics_collision_fragment_writes_physics_namespace():
+ from isaaclab.sim.schemas import UsdPhysicsCollisionCfg, apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage)
+ UsdPhysics.CollisionAPI.Apply(prim)
+ apply_namespaced(UsdPhysicsCollisionCfg(collision_enabled=True), "/World/Body", stage)
+ assert prim.GetAttribute("physics:collisionEnabled").Get() is True
+
+
+# -------------------------------------------------------------------------------------
+# PhysxCollisionCfg (isaaclab_physx)
+# -------------------------------------------------------------------------------------
+
+
+def test_physx_collision_fragment_writes_physx_namespace():
+ from isaaclab_physx.sim.schemas import PhysxCollisionCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/C2")
+ UsdPhysics.CollisionAPI.Apply(prim)
+ apply_namespaced(
+ PhysxCollisionCfg(contact_offset=0.02, rest_offset=0.0, torsional_patch_radius=0.1), "/World/C2", stage
+ )
+ assert abs(prim.GetAttribute("physxCollision:contactOffset").Get() - 0.02) < 1e-6
+ assert abs(prim.GetAttribute("physxCollision:restOffset").Get() - 0.0) < 1e-6
+ assert abs(prim.GetAttribute("physxCollision:torsionalPatchRadius").Get() - 0.1) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# NewtonCollisionCfg (isaaclab_newton)
+# -------------------------------------------------------------------------------------
+
+
+def test_newton_collision_fragment_writes_newton_namespace():
+ from isaaclab_newton.sim.schemas import NewtonCollisionCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/C3")
+ UsdPhysics.CollisionAPI.Apply(prim)
+ apply_namespaced(NewtonCollisionCfg(contact_margin=0.01, contact_gap=0.005), "/World/C3", stage)
+ assert abs(prim.GetAttribute("newton:contactMargin").Get() - 0.01) < 1e-6
+ assert abs(prim.GetAttribute("newton:contactGap").Get() - 0.005) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# apply_collision_properties dispatch (implicit anchor + multi-namespace)
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_collision_properties_composes_namespaces():
+ from isaaclab_newton.sim.schemas import NewtonCollisionCfg
+ from isaaclab_physx.sim.schemas import PhysxCollisionCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsCollisionCfg, apply_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/C4")
+ apply_collision_properties(
+ "/World/C4",
+ [
+ UsdPhysicsCollisionCfg(collision_enabled=True),
+ PhysxCollisionCfg(contact_offset=0.02),
+ NewtonCollisionCfg(contact_margin=0.01),
+ ],
+ stage,
+ )
+ prim = stage.GetPrimAtPath("/World/C4")
+ assert bool(UsdPhysics.CollisionAPI(prim)) # implicit anchor applied
+ assert prim.GetAttribute("physics:collisionEnabled").Get() is True
+ assert abs(prim.GetAttribute("physxCollision:contactOffset").Get() - 0.02) < 1e-6
+ assert abs(prim.GetAttribute("newton:contactMargin").Get() - 0.01) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# spawner slot accepts a fragment list + transition routing
+# -------------------------------------------------------------------------------------
+
+
+def test_spawn_shape_with_collision_fragment_list():
+ from isaaclab_physx.sim.schemas import PhysxCollisionCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsCollisionCfg
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ cfg = sim_utils.CuboidCfg(
+ size=(1, 1, 1),
+ collision_props=[UsdPhysicsCollisionCfg(collision_enabled=True), PhysxCollisionCfg(contact_offset=0.03)],
+ )
+ cfg.func("/World/Cube", cfg)
+ prim = sim_utils.get_current_stage().GetPrimAtPath("/World/Cube/geometry/mesh")
+ assert bool(UsdPhysics.CollisionAPI(prim))
+ assert abs(prim.GetAttribute("physxCollision:contactOffset").Get() - 0.03) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# public imports
+# -------------------------------------------------------------------------------------
+
+
+def test_public_imports():
+ from isaaclab_newton.sim.schemas import NewtonCollisionCfg # noqa: F401
+ from isaaclab_physx.sim.schemas import PhysxCollisionCfg # noqa: F401
+
+ from isaaclab.sim.schemas import ( # noqa: F401
+ CollisionFragment,
+ SchemaFragment,
+ UsdPhysicsCollisionCfg,
+ apply_collision_properties,
+ apply_namespaced,
+ )
diff --git a/source/isaaclab/test/sim/test_joint_drive_fragments.py b/source/isaaclab/test/sim/test_joint_drive_fragments.py
new file mode 100644
index 000000000000..8e43f6f3d5f0
--- /dev/null
+++ b/source/isaaclab/test/sim/test_joint_drive_fragments.py
@@ -0,0 +1,406 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch Isaac Sim Simulator first."""
+
+from isaaclab.app import AppLauncher
+
+# launch omniverse app
+simulation_app = AppLauncher(headless=True).app
+
+"""Rest everything follows."""
+
+import math
+
+import pytest
+
+from pxr import UsdGeom, UsdPhysics
+
+import isaaclab.sim as sim_utils
+from isaaclab.sim import SimulationCfg, SimulationContext
+
+
+def _make_revolute_joint(stage, path="/World/Articulation/joint_0"):
+ UsdGeom.Xform.Define(stage, "/World/Articulation")
+ UsdGeom.Cube.Define(stage, "/World/Articulation/body0")
+ UsdGeom.Cube.Define(stage, "/World/Articulation/body1")
+ UsdPhysics.RevoluteJoint.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+def _make_prismatic_joint(stage, path="/World/Articulation/joint_p"):
+ UsdGeom.Xform.Define(stage, "/World/Articulation")
+ UsdGeom.Cube.Define(stage, "/World/Articulation/body0")
+ UsdGeom.Cube.Define(stage, "/World/Articulation/body1")
+ UsdPhysics.PrismaticJoint.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+# -------------------------------------------------------------------------------------
+# Fragment metadata
+# -------------------------------------------------------------------------------------
+
+
+def test_drive_fragment_metadata_defaults():
+ from isaaclab.sim.schemas import JointDriveFragment, SchemaFragment, UsdPhysicsDriveCfg
+
+ cfg = UsdPhysicsDriveCfg(drive_type="acceleration", max_force=80.0, stiffness=10.0, damping=0.1)
+ assert isinstance(cfg, JointDriveFragment) and isinstance(cfg, SchemaFragment)
+ assert type(cfg)._usd_namespace is None # typed multi-instance DriveAPI, no namespace writes
+ assert type(cfg)._usd_applied_schema is None # DriveAPI applied by apply_drive (presence-gated)
+ assert cfg.func == "isaaclab.sim.schemas:apply_drive"
+ assert cfg.stiffness == 10.0 and cfg.damping == 0.1
+
+
+def test_drive_fragment_max_effort_alias():
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg
+
+ with pytest.warns(DeprecationWarning, match="max_effort"):
+ cfg = UsdPhysicsDriveCfg(max_effort=42.0)
+ assert cfg.max_force == 42.0
+ assert cfg.max_effort is None
+
+
+# -------------------------------------------------------------------------------------
+# apply_drive -- revolute (angular) rad->deg conversion
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_drive_revolute_converts_rad_to_deg():
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, apply_drive
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ assert apply_drive(
+ UsdPhysicsDriveCfg(drive_type="acceleration", max_force=80.0, stiffness=10.0, damping=0.1),
+ prim.GetPath().pathString,
+ stage,
+ )
+ assert bool(UsdPhysics.DriveAPI(prim, "angular"))
+ assert prim.GetAttribute("drive:angular:physics:type").Get() == "acceleration"
+ assert prim.GetAttribute("drive:angular:physics:maxForce").Get() == pytest.approx(80.0, rel=1e-6)
+ # angular stiffness/damping are converted from radian to degree units
+ assert prim.GetAttribute("drive:angular:physics:stiffness").Get() == pytest.approx(10.0 * math.pi / 180.0, rel=1e-6)
+ assert prim.GetAttribute("drive:angular:physics:damping").Get() == pytest.approx(0.1 * math.pi / 180.0, rel=1e-6)
+
+
+# -------------------------------------------------------------------------------------
+# apply_drive -- prismatic (linear) no conversion
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_drive_prismatic_writes_linear_unchanged():
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, apply_drive
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_prismatic_joint(stage)
+ assert apply_drive(
+ UsdPhysicsDriveCfg(drive_type="force", max_force=42.0, stiffness=10.0, damping=0.1),
+ prim.GetPath().pathString,
+ stage,
+ )
+ assert bool(UsdPhysics.DriveAPI(prim, "linear"))
+ assert prim.GetAttribute("drive:linear:physics:type").Get() == "force"
+ assert prim.GetAttribute("drive:linear:physics:maxForce").Get() == pytest.approx(42.0, rel=1e-6)
+ # linear drives are written as authored (no rad->deg conversion)
+ assert prim.GetAttribute("drive:linear:physics:stiffness").Get() == pytest.approx(10.0, rel=1e-6)
+ assert prim.GetAttribute("drive:linear:physics:damping").Get() == pytest.approx(0.1, rel=1e-6)
+
+
+def test_apply_drive_returns_false_on_non_joint():
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, apply_drive
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ UsdGeom.Xform.Define(stage, "/World/NotAJoint")
+ assert apply_drive(UsdPhysicsDriveCfg(stiffness=1.0), "/World/NotAJoint", stage) is False
+
+
+# -------------------------------------------------------------------------------------
+# PhysxJointCfg (isaaclab_physx) -- physxJoint namespace via apply_namespaced
+# -------------------------------------------------------------------------------------
+
+
+def test_physx_joint_fragment_converts_max_velocity_by_joint_type():
+ from isaaclab_physx.sim.schemas import PhysxJointCfg, apply_physx_joint
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ # angular (revolute) joint: rad/s -> deg/s conversion
+ rev = _make_revolute_joint(stage)
+ apply_physx_joint(PhysxJointCfg(max_joint_velocity=10.0), rev.GetPath().pathString, stage)
+ assert rev.GetAttribute("physxJoint:maxJointVelocity").Get() == pytest.approx(10.0 * 180.0 / math.pi, rel=1e-6)
+ # linear (prismatic) joint: written unchanged
+ prismatic = _make_prismatic_joint(stage)
+ apply_physx_joint(PhysxJointCfg(max_joint_velocity=10.0), prismatic.GetPath().pathString, stage)
+ assert prismatic.GetAttribute("physxJoint:maxJointVelocity").Get() == pytest.approx(10.0, rel=1e-6)
+
+
+def test_physx_joint_fragment_max_velocity_alias():
+ from isaaclab_physx.sim.schemas import PhysxJointCfg
+
+ with pytest.warns(DeprecationWarning, match="max_velocity"):
+ cfg = PhysxJointCfg(max_velocity=10.0)
+ assert cfg.max_joint_velocity == 10.0
+ assert cfg.max_velocity is None
+
+
+# -------------------------------------------------------------------------------------
+# MujocoJointCfg (isaaclab_newton) -- mjc namespace via apply_namespaced
+# -------------------------------------------------------------------------------------
+
+
+def test_mujoco_joint_fragment_writes_mjc_namespace():
+ from isaaclab_newton.sim.schemas import MujocoJointCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ apply_namespaced(MujocoJointCfg(actuatorgravcomp=True), prim.GetPath().pathString, stage)
+ assert prim.GetAttribute("mjc:actuatorgravcomp").Get() is True
+
+
+def test_mujoco_joint_applier_does_not_write_actuatorgravcomp_when_none():
+ # fragment-path equivalent of the legacy test_mujoco_actuatorgravcomp_not_written_when_none:
+ # an unset actuatorgravcomp must not *author* mjc:actuatorgravcomp through the joint applier.
+ # (Unlike the legacy path, the fragment applies its MjcJointAPI schema, so the attribute exists
+ # and resolves to the schema default ``False`` -- but it must not be authored to ``True``.)
+ from isaaclab_newton.sim.schemas import MujocoJointCfg, apply_mujoco_joint
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ apply_mujoco_joint(MujocoJointCfg(), prim.GetPath().pathString, stage)
+ assert not prim.GetAttribute("mjc:actuatorgravcomp").HasAuthoredValue()
+
+
+def test_mujoco_joint_actuatorgravcomp_enables_child_body_gravcomp():
+ # actuatorgravcomp is inert unless the actuated body has non-zero mjc:gravcomp, so the Mujoco
+ # joint applier flips gravcomp on the joint's child body (physics:body1) when it is unset
+ from isaaclab_newton.sim.schemas import MujocoJointCfg
+
+ from isaaclab.sim.schemas import apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ UsdPhysics.RevoluteJoint(prim).CreateBody1Rel().SetTargets(["/World/Articulation/body1"])
+ apply_joint_drive_properties("/World/Articulation", [MujocoJointCfg(actuatorgravcomp=True)], stage)
+ body = stage.GetPrimAtPath("/World/Articulation/body1")
+ assert body.GetAttribute("mjc:gravcomp").Get() == pytest.approx(1.0)
+
+
+def test_mujoco_joint_without_actuatorgravcomp_leaves_body_gravcomp_untouched():
+ # the gravcomp coupling must fire ONLY when actuatorgravcomp is requested; an unset flag leaves
+ # the child body's mjc:gravcomp unauthored
+ from isaaclab_newton.sim.schemas import MujocoJointCfg
+
+ from isaaclab.sim.schemas import apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ UsdPhysics.RevoluteJoint(prim).CreateBody1Rel().SetTargets(["/World/Articulation/body1"])
+ apply_joint_drive_properties("/World/Articulation", [MujocoJointCfg()], stage)
+ body = stage.GetPrimAtPath("/World/Articulation/body1")
+ assert body.GetAttribute("mjc:gravcomp").Get() is None
+
+
+def test_mujoco_joint_actuatorgravcomp_enables_gravcomp_on_every_joint_body():
+ # per-joint dispatch must enable gravcomp on each joint's own child body across the articulation
+ from isaaclab_newton.sim.schemas import MujocoJointCfg
+
+ from isaaclab.sim.schemas import apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ UsdGeom.Xform.Define(stage, "/World/Articulation")
+ for link in ("link_a", "link_b"):
+ UsdGeom.Cube.Define(stage, f"/World/Articulation/{link}")
+ j0 = UsdPhysics.RevoluteJoint.Define(stage, "/World/Articulation/joint_0")
+ j0.CreateBody1Rel().SetTargets(["/World/Articulation/link_a"])
+ j1 = UsdPhysics.PrismaticJoint.Define(stage, "/World/Articulation/joint_1")
+ j1.CreateBody1Rel().SetTargets(["/World/Articulation/link_b"])
+ apply_joint_drive_properties("/World/Articulation", [MujocoJointCfg(actuatorgravcomp=True)], stage)
+ # both the revolute joint's body and the prismatic joint's body get gravcomp enabled
+ assert stage.GetPrimAtPath("/World/Articulation/link_a").GetAttribute("mjc:gravcomp").Get() == pytest.approx(1.0)
+ assert stage.GetPrimAtPath("/World/Articulation/link_b").GetAttribute("mjc:gravcomp").Get() == pytest.approx(1.0)
+
+
+def test_mujoco_joint_actuatorgravcomp_preserves_authored_body_gravcomp():
+ # an explicitly authored body gravcomp must not be clobbered by the actuatorgravcomp auto-enable
+ from isaaclab_newton.sim.schemas import MujocoJointCfg
+
+ from isaaclab.sim.schemas import apply_joint_drive_properties
+ from isaaclab.sim.utils import safe_set_attribute_on_usd_prim
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ UsdPhysics.RevoluteJoint(prim).CreateBody1Rel().SetTargets(["/World/Articulation/body1"])
+ body = stage.GetPrimAtPath("/World/Articulation/body1")
+ safe_set_attribute_on_usd_prim(body, "mjc:gravcomp", 0.5, camel_case=False)
+ apply_joint_drive_properties("/World/Articulation", [MujocoJointCfg(actuatorgravcomp=True)], stage)
+ assert body.GetAttribute("mjc:gravcomp").Get() == pytest.approx(0.5)
+
+
+# -------------------------------------------------------------------------------------
+# apply_joint_drive_properties dispatch (presence-gated DriveAPI + multi-namespace)
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_joint_drive_properties_composes_namespaces():
+ from isaaclab_newton.sim.schemas import MujocoJointCfg
+ from isaaclab_physx.sim.schemas import PhysxJointCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ apply_joint_drive_properties(
+ "/World/Articulation",
+ [
+ UsdPhysicsDriveCfg(drive_type="acceleration", max_force=80.0, stiffness=10.0, damping=0.1),
+ PhysxJointCfg(max_joint_velocity=5.0),
+ MujocoJointCfg(actuatorgravcomp=True),
+ ],
+ stage,
+ )
+ assert bool(UsdPhysics.DriveAPI(prim, "angular")) # presence-gated anchor applied
+ assert prim.GetAttribute("drive:angular:physics:maxForce").Get() == pytest.approx(80.0, rel=1e-6)
+ assert prim.GetAttribute("drive:angular:physics:stiffness").Get() == pytest.approx(10.0 * math.pi / 180.0, rel=1e-6)
+ # revolute joint -> rad/s to deg/s conversion via apply_physx_joint
+ assert prim.GetAttribute("physxJoint:maxJointVelocity").Get() == pytest.approx(5.0 * 180.0 / math.pi, rel=1e-6)
+ assert prim.GetAttribute("mjc:actuatorgravcomp").Get() is True
+
+
+def test_apply_joint_drive_properties_without_drive_does_not_apply_drive_api():
+ from isaaclab_physx.sim.schemas import PhysxJointCfg
+
+ from isaaclab.sim.schemas import apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ apply_joint_drive_properties("/World/Articulation", [PhysxJointCfg(max_joint_velocity=5.0)], stage)
+ # DriveAPI is presence-gated: not applied when no UsdPhysicsDriveCfg fragment is present
+ assert not bool(UsdPhysics.DriveAPI(prim, "angular"))
+ # revolute joint -> rad/s to deg/s conversion via apply_physx_joint
+ assert prim.GetAttribute("physxJoint:maxJointVelocity").Get() == pytest.approx(5.0 * 180.0 / math.pi, rel=1e-6)
+
+
+def test_apply_joint_drive_properties_skips_tendon_child_joint():
+ """A tendon-child joint (``PhysxTendonAxisAPI`` without the root API) must be skipped wholesale
+ by the dispatch loop: no fragment -- drive, physxJoint, or mjc -- may author on it, matching the
+ legacy :func:`modify_joint_drive_properties` writer (which skipped the whole prim)."""
+ from isaaclab_physx.sim.schemas import PhysxJointCfg
+
+ from pxr import PhysxSchema
+
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ joint = _make_revolute_joint(stage)
+ PhysxSchema.PhysxTendonAxisAPI.Apply(joint, "axis0") # tendon child: axis API, no root API
+ applied = str(joint.GetAppliedSchemas())
+ assert "PhysxTendonAxisAPI" in applied and "PhysxTendonAxisRootAPI" not in applied
+
+ apply_joint_drive_properties(
+ "/World/Articulation",
+ [
+ UsdPhysicsDriveCfg(drive_type="acceleration", max_force=80.0, stiffness=10.0, damping=0.1),
+ PhysxJointCfg(max_joint_velocity=5.0),
+ ],
+ stage,
+ )
+ # neither the presence-gated DriveAPI nor the physxJoint fragment may author on a tendon child
+ assert not bool(UsdPhysics.DriveAPI(joint, "angular"))
+ assert not joint.GetAttribute("physxJoint:maxJointVelocity").HasAuthoredValue()
+
+
+def test_apply_joint_drive_properties_skips_joint_via_registered_predicate(monkeypatch):
+ """Core delegates joint exclusion to backend-registered predicates: one returning True skips the
+ joint, with no backend-specific schema knowledge in core.
+
+ monkeypatch clears the module-global predicate list (other tests register the PhysX detector
+ session-wide) and restores it afterwards, keeping this isolated.
+ """
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, _backend_hooks, apply_joint_drive_properties
+
+ monkeypatch.setattr(_backend_hooks, "_JOINT_DRIVE_SKIP_PREDICATES", [])
+ _backend_hooks.register_joint_drive_skip_predicate(lambda prim: True) # exclude every joint
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ joint = _make_revolute_joint(stage)
+ apply_joint_drive_properties("/World/Articulation", [UsdPhysicsDriveCfg(stiffness=10.0)], stage)
+ assert not bool(UsdPhysics.DriveAPI(joint, "angular"))
+
+
+def test_apply_joint_drive_properties_authors_when_no_skip_predicate(monkeypatch):
+ """Empty predicate registry (the default) skips nothing -- the writer authors on the joint."""
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, _backend_hooks, apply_joint_drive_properties
+
+ monkeypatch.setattr(_backend_hooks, "_JOINT_DRIVE_SKIP_PREDICATES", [])
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ joint = _make_revolute_joint(stage)
+ apply_joint_drive_properties("/World/Articulation", [UsdPhysicsDriveCfg(stiffness=10.0)], stage)
+ assert bool(UsdPhysics.DriveAPI(joint, "angular"))
+
+
+def test_apply_joint_drive_properties_ensure_drives_exist_seeds_stiffness():
+ from isaaclab.sim.schemas import UsdPhysicsDriveCfg, apply_joint_drive_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_revolute_joint(stage)
+ # neither stiffness nor damping authored -> ensure_drives_exist seeds a minimal stiffness
+ apply_joint_drive_properties(
+ "/World/Articulation", [UsdPhysicsDriveCfg(max_force=1.0)], stage, ensure_drives_exist=True
+ )
+ assert bool(UsdPhysics.DriveAPI(prim, "angular"))
+ assert prim.GetAttribute("drive:angular:physics:stiffness").Get() == pytest.approx(1e-3 * math.pi / 180.0, rel=1e-6)
+
+
+# -------------------------------------------------------------------------------------
+# public imports
+# -------------------------------------------------------------------------------------
+
+
+def test_public_imports():
+ from isaaclab_newton.sim.schemas import MujocoJointCfg # noqa: F401
+ from isaaclab_physx.sim.schemas import PhysxJointCfg # noqa: F401
+
+ from isaaclab.sim.schemas import ( # noqa: F401
+ JointDriveFragment,
+ SchemaFragment,
+ UsdPhysicsDriveCfg,
+ apply_drive,
+ apply_joint_drive_properties,
+ )
diff --git a/source/isaaclab/test/sim/test_mass_fragments.py b/source/isaaclab/test/sim/test_mass_fragments.py
new file mode 100644
index 000000000000..1e4a28a6121e
--- /dev/null
+++ b/source/isaaclab/test/sim/test_mass_fragments.py
@@ -0,0 +1,183 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch Isaac Sim Simulator first."""
+
+from isaaclab.app import AppLauncher
+
+# launch omniverse app
+simulation_app = AppLauncher(headless=True).app
+
+"""Rest everything follows."""
+
+import pytest
+
+from pxr import UsdGeom, UsdPhysics
+
+import isaaclab.sim as sim_utils
+from isaaclab.sim import SimulationCfg, SimulationContext
+
+
+def _make_xform(stage, path="/World/Body"):
+ UsdGeom.Xform.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+# -------------------------------------------------------------------------------------
+# Fragment metadata -- MassFragment marker, MassCfg
+# -------------------------------------------------------------------------------------
+
+
+def test_fragment_metadata_defaults():
+ from isaaclab.sim.schemas import MassCfg, MassFragment, SchemaFragment
+
+ cfg = MassCfg(mass=2.0)
+ assert isinstance(cfg, MassFragment) and isinstance(cfg, SchemaFragment)
+ assert type(cfg)._usd_namespace == "physics"
+ assert type(cfg)._usd_applied_schema is None # anchor applies MassAPI, not the fragment
+ assert cfg.func == "isaaclab.sim.schemas:apply_namespaced"
+ assert cfg.mass == 2.0 and cfg.density is None
+
+
+# -------------------------------------------------------------------------------------
+# apply_namespaced writes only the set fields under the physics namespace
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_namespaced_writes_only_set_fields():
+ from isaaclab.sim.schemas import MassCfg, apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage)
+ UsdPhysics.MassAPI.Apply(prim)
+ apply_namespaced(MassCfg(mass=3.0), "/World/Body", stage)
+ assert abs(prim.GetAttribute("physics:mass").Get() - 3.0) < 1e-6
+ # None field must not be authored (density exists as a MassAPI fallback attr)
+ assert not prim.GetAttribute("physics:density").HasAuthoredValue()
+
+
+# -------------------------------------------------------------------------------------
+# apply_mass_properties dispatch (implicit MassAPI anchor)
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_mass_properties_applies_anchor_and_writes_fields():
+ from isaaclab.sim.schemas import MassCfg, apply_mass_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/B2")
+ apply_mass_properties("/World/B2", [MassCfg(mass=5.0, density=100.0)], stage)
+ prim = stage.GetPrimAtPath("/World/B2")
+ assert bool(UsdPhysics.MassAPI(prim)) # implicit anchor applied
+ assert abs(prim.GetAttribute("physics:mass").Get() - 5.0) < 1e-6
+ assert abs(prim.GetAttribute("physics:density").Get() - 100.0) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# spawner slot accepts a fragment list + transition routing
+# -------------------------------------------------------------------------------------
+
+
+def test_spawn_shape_with_mass_fragment_list():
+ from isaaclab.sim.schemas import MassCfg, UsdPhysicsRigidBodyCfg
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ cfg = sim_utils.CuboidCfg(
+ size=(1, 1, 1),
+ rigid_props=[UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)],
+ mass_props=[MassCfg(mass=4.0)],
+ )
+ cfg.func("/World/Cube", cfg)
+ prim = sim_utils.get_current_stage().GetPrimAtPath("/World/Cube")
+ assert bool(UsdPhysics.MassAPI(prim))
+ assert abs(prim.GetAttribute("physics:mass").Get() - 4.0) < 1e-6
+
+
+def test_spawn_shape_with_single_mass_fragment():
+ # the ``mass_props`` slot advertises a single fragment (convenience form), not only a list;
+ # the spawn shim must route a bare fragment through ``apply_mass_properties`` (not the legacy writer)
+ from isaaclab.sim.schemas import MassCfg, UsdPhysicsRigidBodyCfg
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ cfg = sim_utils.CuboidCfg(
+ size=(1, 1, 1),
+ rigid_props=[UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)],
+ mass_props=MassCfg(mass=4.0),
+ )
+ cfg.func("/World/CubeSingle", cfg)
+ prim = sim_utils.get_current_stage().GetPrimAtPath("/World/CubeSingle")
+ assert bool(UsdPhysics.MassAPI(prim))
+ assert abs(prim.GetAttribute("physics:mass").Get() - 4.0) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# Review follow-ups -- prim-validity guard, aggregated return, empty-list no-op
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_mass_properties_raises_on_invalid_prim():
+ from isaaclab.sim.schemas import MassCfg, apply_mass_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ # no prim authored at this path -> GetPrimAtPath returns an invalid prim
+ with pytest.raises(ValueError):
+ apply_mass_properties("/World/DoesNotExist", [MassCfg(mass=1.0)], stage)
+
+
+def test_apply_mass_properties_aggregates_fragment_results():
+ from isaaclab.sim.schemas import MassCfg, apply_mass_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/Agg")
+
+ # a fragment whose applier reports failure must make the aggregate return False
+ failing = MassCfg(mass=1.0)
+ failing.func = lambda cfg, prim_path, stage=None: False
+ assert apply_mass_properties("/World/Agg", [failing], stage) is False
+
+ # all-succeeding fragments return True
+ ok = MassCfg(mass=1.0)
+ assert apply_mass_properties("/World/Agg", [ok], stage) is True
+
+
+def test_spawn_shape_with_empty_mass_list_is_noop():
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ cfg = sim_utils.CuboidCfg(
+ size=(1, 1, 1),
+ rigid_props=[UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)],
+ mass_props=[],
+ )
+ # an empty fragment list routes through the fragment path and applies nothing (no exception)
+ cfg.func("/World/Cube", cfg)
+ prim = sim_utils.get_current_stage().GetPrimAtPath("/World/Cube")
+ # mass anchor is not required when there are zero fragments to apply
+ assert not prim.GetAttribute("physics:mass").HasAuthoredValue()
+
+
+# -------------------------------------------------------------------------------------
+# public imports
+# -------------------------------------------------------------------------------------
+
+
+def test_public_imports():
+ from isaaclab.sim.schemas import ( # noqa: F401
+ MassCfg,
+ MassFragment,
+ SchemaFragment,
+ apply_mass_properties,
+ )
diff --git a/source/isaaclab/test/sim/test_mesh_collision_fragments.py b/source/isaaclab/test/sim/test_mesh_collision_fragments.py
new file mode 100644
index 000000000000..c592c6de75e3
--- /dev/null
+++ b/source/isaaclab/test/sim/test_mesh_collision_fragments.py
@@ -0,0 +1,353 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch Isaac Sim Simulator first."""
+
+from isaaclab.app import AppLauncher
+
+# launch omniverse app
+simulation_app = AppLauncher(headless=True).app
+
+"""Rest everything follows."""
+
+from pxr import UsdGeom, UsdPhysics
+
+import isaaclab.sim as sim_utils
+from isaaclab.sim import SimulationCfg, SimulationContext
+
+
+def _make_xform(stage, path="/World/Mesh"):
+ UsdGeom.Xform.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+def _has_authored_api_schema(prim, schema_name: str) -> bool:
+ """Return whether a schema name is applied or authored in ``apiSchemas`` metadata.
+
+ A schema that is authored via ``AddAppliedSchema`` but not registered in the current build
+ appears in the ``apiSchemas`` listOp yet not in the composed ``GetAppliedSchemas()``.
+ """
+ if schema_name in prim.GetAppliedSchemas():
+ return True
+ api_schemas = prim.GetMetadata("apiSchemas")
+ if api_schemas is None:
+ return False
+ return any(
+ schema_name in getattr(api_schemas, item_list)
+ for item_list in ("explicitItems", "prependedItems", "appendedItems", "addedItems")
+ )
+
+
+# -------------------------------------------------------------------------------------
+# Fragment metadata + marker hierarchy
+# -------------------------------------------------------------------------------------
+
+
+def test_mesh_collision_fragment_metadata_defaults():
+ from isaaclab.sim.schemas import MeshCollisionFragment, SchemaFragment, UsdPhysicsMeshCollisionCfg
+
+ cfg = UsdPhysicsMeshCollisionCfg(mesh_approximation_name="convexHull")
+ assert isinstance(cfg, MeshCollisionFragment) and isinstance(cfg, SchemaFragment)
+ assert type(cfg)._usd_namespace == "physics"
+ assert type(cfg)._usd_applied_schema is None # anchor applies MeshCollisionAPI, not the fragment
+ assert cfg.func == "isaaclab.sim.schemas:apply_mesh_collision"
+ assert cfg.mesh_approximation_name == "convexHull"
+
+
+# -------------------------------------------------------------------------------------
+# Core USD fragment: physics:approximation token via apply_mesh_collision_properties
+# -------------------------------------------------------------------------------------
+
+
+def test_usd_mesh_collision_fragment_writes_approximation_token():
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/M0")
+ apply_mesh_collision_properties(
+ "/World/M0", [UsdPhysicsMeshCollisionCfg(mesh_approximation_name="boundingCube")], stage
+ )
+ prim = stage.GetPrimAtPath("/World/M0")
+ assert bool(UsdPhysics.MeshCollisionAPI(prim))
+ assert prim.GetAttribute("physics:approximation").Get() == "boundingCube"
+
+
+# -------------------------------------------------------------------------------------
+# PhysX cooking fragments (isaaclab_physx): each writes its own physx*Collision namespace
+# -------------------------------------------------------------------------------------
+
+
+def test_physx_convex_hull_fragment_writes_namespace():
+ from isaaclab_physx.sim.schemas import PhysxConvexHullCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M1")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(PhysxConvexHullCfg(hull_vertex_limit=32, min_thickness=0.002), "/World/M1", stage)
+ assert prim.GetAttribute("physxConvexHullCollision:hullVertexLimit").Get() == 32
+ assert abs(prim.GetAttribute("physxConvexHullCollision:minThickness").Get() - 0.002) < 1e-6
+ # ``mesh_approximation_name`` must NOT be authored as a namespaced attr by the generic applier.
+ assert not prim.HasAttribute("physxConvexHullCollision:meshApproximationName")
+
+
+def test_physx_convex_decomposition_fragment_writes_namespace():
+ from isaaclab_physx.sim.schemas import PhysxConvexDecompositionCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M2")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(PhysxConvexDecompositionCfg(max_convex_hulls=8, shrink_wrap=True), "/World/M2", stage)
+ assert prim.GetAttribute("physxConvexDecompositionCollision:maxConvexHulls").Get() == 8
+ assert prim.GetAttribute("physxConvexDecompositionCollision:shrinkWrap").Get() is True
+
+
+def test_physx_triangle_mesh_fragment_writes_namespace():
+ from isaaclab_physx.sim.schemas import PhysxTriangleMeshCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M3")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(PhysxTriangleMeshCfg(weld_tolerance=0.01), "/World/M3", stage)
+ assert abs(prim.GetAttribute("physxTriangleMeshCollision:weldTolerance").Get() - 0.01) < 1e-6
+
+
+def test_physx_triangle_mesh_simplification_fragment_writes_namespace():
+ from isaaclab_physx.sim.schemas import PhysxTriangleMeshSimplificationCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M4")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(PhysxTriangleMeshSimplificationCfg(simplification_metric=0.7), "/World/M4", stage)
+ ns = "physxTriangleMeshSimplificationCollision"
+ assert abs(prim.GetAttribute(f"{ns}:simplificationMetric").Get() - 0.7) < 1e-6
+
+
+def test_physx_sdf_mesh_fragment_writes_namespace():
+ from isaaclab_physx.sim.schemas import PhysxSDFMeshCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M5")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(PhysxSDFMeshCfg(sdf_resolution=128, sdf_margin=0.02), "/World/M5", stage)
+ assert prim.GetAttribute("physxSDFMeshCollision:sdfResolution").Get() == 128
+ assert abs(prim.GetAttribute("physxSDFMeshCollision:sdfMargin").Get() - 0.02) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# Newton cooking fragments (isaaclab_newton): newton namespace + applied schema
+# -------------------------------------------------------------------------------------
+
+
+def test_newton_mesh_collision_fragment_writes_namespace():
+ from isaaclab_newton.sim.schemas import NewtonMeshCollisionCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M6")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(NewtonMeshCollisionCfg(max_hull_vertices=24), "/World/M6", stage)
+ assert prim.GetAttribute("newton:maxHullVertices").Get() == 24
+ assert "NewtonMeshCollisionAPI" in prim.GetAppliedSchemas()
+
+
+def test_newton_sdf_collision_fragment_writes_namespace():
+ from isaaclab_newton.sim.schemas import NewtonSDFCollisionCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/M7")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_namespaced(NewtonSDFCollisionCfg(sdf_max_resolution=64, hydroelastic_enabled=True), "/World/M7", stage)
+ assert prim.GetAttribute("newton:sdfMaxResolution").Get() == 64
+ assert prim.GetAttribute("newton:hydroelasticEnabled").Get() is True
+ # ``NewtonSDFCollisionAPI`` is authored into the ``apiSchemas`` listOp (like the legacy cfg) but
+ # is not a registered schema in this Newton build, so it is absent from the composed
+ # ``GetAppliedSchemas()``. Assert the authored token, matching the legacy Newton test.
+ assert _has_authored_api_schema(prim, "NewtonSDFCollisionAPI")
+
+
+# -------------------------------------------------------------------------------------
+# Composition through apply_mesh_collision_properties: token coupling + multi-namespace
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_mesh_collision_properties_composes_namespaces():
+ from isaaclab_newton.sim.schemas import NewtonMeshCollisionCfg
+ from isaaclab_physx.sim.schemas import PhysxConvexHullCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/M8")
+ apply_mesh_collision_properties(
+ "/World/M8",
+ [
+ UsdPhysicsMeshCollisionCfg(),
+ PhysxConvexHullCfg(hull_vertex_limit=48),
+ NewtonMeshCollisionCfg(max_hull_vertices=48),
+ ],
+ stage,
+ )
+ prim = stage.GetPrimAtPath("/World/M8")
+ assert bool(UsdPhysics.MeshCollisionAPI(prim)) # implicit anchor applied
+ # token coupling: the convex-hull cooking fragment sets ``physics:approximation``
+ assert prim.GetAttribute("physics:approximation").Get() == "convexHull"
+ assert prim.GetAttribute("physxConvexHullCollision:hullVertexLimit").Get() == 48
+ assert prim.GetAttribute("newton:maxHullVertices").Get() == 48
+
+
+def test_apply_mesh_collision_properties_rejects_invalid_token():
+ import pytest
+
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/M9")
+ with pytest.raises(ValueError):
+ apply_mesh_collision_properties(
+ "/World/M9", [UsdPhysicsMeshCollisionCfg(mesh_approximation_name="notAToken")], stage
+ )
+
+
+def test_apply_mesh_collision_properties_raises_on_invalid_prim():
+ import pytest
+
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ with pytest.raises(ValueError):
+ apply_mesh_collision_properties("/World/DoesNotExist", [UsdPhysicsMeshCollisionCfg()], stage)
+
+
+def test_apply_mesh_collision_properties_aggregates_fragment_results():
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/Magg")
+
+ # a fragment whose applier reports failure must make the aggregate return False
+ failing = UsdPhysicsMeshCollisionCfg()
+ failing.func = lambda cfg, prim_path, stage=None: False
+ assert apply_mesh_collision_properties("/World/Magg", [failing], stage) is False
+
+ # all-succeeding fragments return True
+ ok = UsdPhysicsMeshCollisionCfg()
+ ok.func = lambda cfg, prim_path, stage=None: True
+ assert apply_mesh_collision_properties("/World/Magg", [ok], stage) is True
+
+
+def test_apply_mesh_collision_properties_accepts_generator():
+ # the writer dispatches fragments from any iterable; a one-shot generator is consumed once and
+ # each fragment authors both its namespace and its implied approximation token
+ from isaaclab_physx.sim.schemas import PhysxConvexHullCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/Mgen")
+ frags = (f for f in [UsdPhysicsMeshCollisionCfg(), PhysxConvexHullCfg(hull_vertex_limit=48)])
+ apply_mesh_collision_properties("/World/Mgen", frags, stage)
+ prim = stage.GetPrimAtPath("/World/Mgen")
+ # both passes ran: approximation token resolved AND the per-fragment namespaced attr written
+ assert prim.GetAttribute("physics:approximation").Get() == "convexHull"
+ assert prim.GetAttribute("physxConvexHullCollision:hullVertexLimit").Get() == 48
+
+
+# -------------------------------------------------------------------------------------
+# apply_mesh_collision: the per-fragment func carrying the approximation-token coupling
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_mesh_collision_writes_namespace_and_implied_token():
+ # the per-fragment func (the default ``func`` of every MeshCollisionFragment) writes the
+ # fragment's namespaced cooking attrs AND the ``physics:approximation`` token it implies
+ from isaaclab_physx.sim.schemas import PhysxConvexHullCfg
+
+ from isaaclab.sim.schemas import apply_mesh_collision
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/Mfunc")
+ UsdPhysics.MeshCollisionAPI.Apply(prim)
+ apply_mesh_collision(PhysxConvexHullCfg(hull_vertex_limit=16), "/World/Mfunc", stage)
+ assert prim.GetAttribute("physxConvexHullCollision:hullVertexLimit").Get() == 16
+ assert prim.GetAttribute("physics:approximation").Get() == "convexHull"
+
+
+def test_apply_mesh_collision_rejects_invalid_token():
+ import pytest
+
+ from isaaclab.sim.schemas import UsdPhysicsMeshCollisionCfg, apply_mesh_collision
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/Mfunc2")
+ with pytest.raises(ValueError):
+ apply_mesh_collision(UsdPhysicsMeshCollisionCfg(mesh_approximation_name="notAToken"), "/World/Mfunc2", stage)
+
+
+# -------------------------------------------------------------------------------------
+# Public imports
+# -------------------------------------------------------------------------------------
+
+
+def test_public_imports():
+ from isaaclab_newton.sim.schemas import NewtonMeshCollisionCfg, NewtonSDFCollisionCfg # noqa: F401
+ from isaaclab_physx.sim.schemas import ( # noqa: F401
+ PhysxConvexDecompositionCfg,
+ PhysxConvexHullCfg,
+ PhysxSDFMeshCfg,
+ PhysxTriangleMeshCfg,
+ PhysxTriangleMeshSimplificationCfg,
+ )
+
+ from isaaclab.sim.schemas import ( # noqa: F401
+ MeshCollisionFragment,
+ SchemaFragment,
+ UsdPhysicsMeshCollisionCfg,
+ apply_mesh_collision,
+ apply_mesh_collision_properties,
+ apply_namespaced,
+ )
diff --git a/source/isaaclab/test/sim/test_schema_fragments.py b/source/isaaclab/test/sim/test_schema_fragments.py
new file mode 100644
index 000000000000..809f4f968b7c
--- /dev/null
+++ b/source/isaaclab/test/sim/test_schema_fragments.py
@@ -0,0 +1,253 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch Isaac Sim Simulator first."""
+
+from isaaclab.app import AppLauncher
+
+# launch omniverse app
+simulation_app = AppLauncher(headless=True).app
+
+"""Rest everything follows."""
+
+import pytest
+
+from pxr import UsdGeom, UsdPhysics
+
+import isaaclab.sim as sim_utils
+from isaaclab.sim import SimulationCfg, SimulationContext
+
+
+def _make_xform(stage, path="/World/Body"):
+ UsdGeom.Xform.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+# -------------------------------------------------------------------------------------
+# SchemaFragment base, RigidBodyFragment marker, UsdPhysicsRigidBodyCfg
+# -------------------------------------------------------------------------------------
+
+
+def test_fragment_metadata_defaults():
+ from isaaclab.sim.schemas import RigidBodyFragment, SchemaFragment, UsdPhysicsRigidBodyCfg
+
+ cfg = UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)
+ assert isinstance(cfg, RigidBodyFragment) and isinstance(cfg, SchemaFragment)
+ assert type(cfg)._usd_namespace == "physics"
+ assert type(cfg)._usd_applied_schema is None # anchor applies RigidBodyAPI, not the fragment
+ assert cfg.func == "isaaclab.sim.schemas:apply_namespaced"
+ assert cfg.rigid_body_enabled is True and cfg.kinematic_enabled is None
+
+
+# -------------------------------------------------------------------------------------
+# apply_namespaced generic applier
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_namespaced_writes_only_set_fields():
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg, apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage)
+ UsdPhysics.RigidBodyAPI.Apply(prim)
+ apply_namespaced(UsdPhysicsRigidBodyCfg(rigid_body_enabled=True), "/World/Body", stage)
+ assert prim.GetAttribute("physics:rigidBodyEnabled").Get() is True
+ # ``kinematicEnabled`` is a RigidBodyAPI fallback attr (so HasAttribute is True), but the
+ # None field must not be authored by apply_namespaced.
+ assert not prim.GetAttribute("physics:kinematicEnabled").HasAuthoredValue()
+
+
+# -------------------------------------------------------------------------------------
+# PhysxRigidBodyCfg (isaaclab_physx)
+# -------------------------------------------------------------------------------------
+
+
+def test_physx_rigid_body_fragment_writes_physx_namespace():
+ from isaaclab_physx.sim.schemas import PhysxRigidBodyCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/B2")
+ UsdPhysics.RigidBodyAPI.Apply(prim)
+ apply_namespaced(PhysxRigidBodyCfg(linear_damping=0.1, disable_gravity=True), "/World/B2", stage)
+ assert abs(prim.GetAttribute("physxRigidBody:linearDamping").Get() - 0.1) < 1e-6
+ assert prim.GetAttribute("physxRigidBody:disableGravity").Get() is True
+
+
+# -------------------------------------------------------------------------------------
+# MujocoRigidBodyCfg (isaaclab_newton)
+# -------------------------------------------------------------------------------------
+
+
+def test_mujoco_rigid_body_fragment_writes_mjc_namespace():
+ from isaaclab_newton.sim.schemas import MujocoRigidBodyCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/B3")
+ UsdPhysics.RigidBodyAPI.Apply(prim)
+ apply_namespaced(MujocoRigidBodyCfg(gravcomp=1.0), "/World/B3", stage)
+ assert abs(prim.GetAttribute("mjc:gravcomp").Get() - 1.0) < 1e-6
+
+
+def test_mujoco_rigid_body_fragment_does_not_write_gravcomp_when_none():
+ # fragment-path equivalent of the legacy test_mujoco_gravcomp_not_written_when_none:
+ # an unset gravcomp must not author mjc:gravcomp
+ from isaaclab_newton.sim.schemas import MujocoRigidBodyCfg
+
+ from isaaclab.sim.schemas import apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/B3b")
+ UsdPhysics.RigidBodyAPI.Apply(prim)
+ apply_namespaced(MujocoRigidBodyCfg(), "/World/B3b", stage)
+ assert prim.GetAttribute("mjc:gravcomp").Get() is None
+
+
+# -------------------------------------------------------------------------------------
+# apply_rigid_body_properties dispatch (implicit anchor + multi-namespace)
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_rigid_body_properties_composes_namespaces():
+ from isaaclab_newton.sim.schemas import MujocoRigidBodyCfg
+ from isaaclab_physx.sim.schemas import PhysxRigidBodyCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg, apply_rigid_body_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/B4")
+ apply_rigid_body_properties(
+ "/World/B4",
+ [
+ UsdPhysicsRigidBodyCfg(rigid_body_enabled=True),
+ PhysxRigidBodyCfg(linear_damping=0.2),
+ MujocoRigidBodyCfg(gravcomp=1.0),
+ ],
+ stage,
+ )
+ prim = stage.GetPrimAtPath("/World/B4")
+ assert bool(UsdPhysics.RigidBodyAPI(prim)) # implicit anchor applied
+ assert prim.GetAttribute("physics:rigidBodyEnabled").Get() is True
+ assert abs(prim.GetAttribute("physxRigidBody:linearDamping").Get() - 0.2) < 1e-6
+ assert abs(prim.GetAttribute("mjc:gravcomp").Get() - 1.0) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# spawner slot accepts a fragment list + transition routing
+# -------------------------------------------------------------------------------------
+
+
+def test_spawn_shape_with_rigid_fragment_list():
+ from isaaclab_physx.sim.schemas import PhysxRigidBodyCfg
+
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ cfg = sim_utils.CuboidCfg(
+ size=(1, 1, 1),
+ rigid_props=[UsdPhysicsRigidBodyCfg(rigid_body_enabled=True), PhysxRigidBodyCfg(linear_damping=0.3)],
+ )
+ cfg.func("/World/Cube", cfg)
+ prim = sim_utils.get_current_stage().GetPrimAtPath("/World/Cube")
+ assert bool(UsdPhysics.RigidBodyAPI(prim))
+ assert abs(prim.GetAttribute("physxRigidBody:linearDamping").Get() - 0.3) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# public imports
+# -------------------------------------------------------------------------------------
+
+
+def test_public_imports():
+ from isaaclab_newton.sim.schemas import MujocoRigidBodyCfg # noqa: F401
+ from isaaclab_physx.sim.schemas import PhysxRigidBodyCfg # noqa: F401
+
+ from isaaclab.sim.schemas import ( # noqa: F401
+ RigidBodyFragment,
+ SchemaFragment,
+ UsdPhysicsRigidBodyCfg,
+ apply_namespaced,
+ apply_rigid_body_properties,
+ )
+
+
+# -------------------------------------------------------------------------------------
+# Review follow-ups -- prim-validity guard, aggregated return, namespace invariant guard
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_namespaced_raises_on_invalid_prim():
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg, apply_namespaced
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ # no prim authored at this path -> GetPrimAtPath returns an invalid prim
+ with pytest.raises(ValueError):
+ apply_namespaced(UsdPhysicsRigidBodyCfg(rigid_body_enabled=True), "/World/DoesNotExist", stage)
+
+
+def test_apply_rigid_body_properties_raises_on_invalid_prim():
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg, apply_rigid_body_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ with pytest.raises(ValueError):
+ apply_rigid_body_properties("/World/DoesNotExist", [UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)], stage)
+
+
+def test_apply_rigid_body_properties_aggregates_fragment_results():
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg, apply_rigid_body_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ _make_xform(stage, "/World/Agg")
+
+ # a fragment whose applier reports failure must make the aggregate return False
+ failing = UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)
+ failing.func = lambda cfg, prim_path, stage=None: False
+ assert apply_rigid_body_properties("/World/Agg", [failing], stage) is False
+
+ # all-succeeding fragments return True
+ ok = UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)
+ assert apply_rigid_body_properties("/World/Agg", [ok], stage) is True
+
+
+def test_apply_namespaced_raises_without_namespace():
+ from typing import ClassVar
+
+ from isaaclab.sim.schemas import RigidBodyFragment, apply_namespaced
+ from isaaclab.utils import configclass
+
+ @configclass
+ class _NoNamespaceFragment(RigidBodyFragment):
+ # deliberately leaves ``_usd_namespace`` as None, violating the fragment invariant that
+ # every field is authored as a namespaced USD attribute
+ _usd_namespace: ClassVar[str | None] = None
+ rigid_body_enabled: bool | None = None
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_xform(stage, "/World/NoNs")
+ UsdPhysics.RigidBodyAPI.Apply(prim)
+ with pytest.raises(ValueError):
+ apply_namespaced(_NoNamespaceFragment(rigid_body_enabled=True), "/World/NoNs", stage)
diff --git a/source/isaaclab/test/sim/test_tendon_fragments.py b/source/isaaclab/test/sim/test_tendon_fragments.py
new file mode 100644
index 000000000000..d18b6c26f8d9
--- /dev/null
+++ b/source/isaaclab/test/sim/test_tendon_fragments.py
@@ -0,0 +1,425 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch Isaac Sim Simulator first."""
+
+from isaaclab.app import AppLauncher
+
+# launch omniverse app
+simulation_app = AppLauncher(headless=True).app
+
+"""Rest everything follows."""
+
+import pytest
+
+from pxr import PhysxSchema, Sdf, Usd, UsdGeom
+
+import isaaclab.sim as sim_utils
+from isaaclab.sim import SimulationCfg, SimulationContext
+
+
+def _new_sim():
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ return sim_utils.get_current_stage()
+
+
+def _make_prim_with_schemas(stage, path, schema_tokens):
+ """Define an Xform and stamp ``apiSchemas`` metadata with the given multi-instance tokens."""
+ UsdGeom.Xform.Define(stage, path)
+ prim = stage.GetPrimAtPath(path)
+ token_op = Sdf.TokenListOp()
+ token_op.explicitItems = schema_tokens
+ prim.SetMetadata("apiSchemas", token_op)
+ return prim
+
+
+def _make_xform(stage, path="/World/Tendon"):
+ UsdGeom.Xform.Define(stage, path)
+ return stage.GetPrimAtPath(path)
+
+
+def _make_fixed_tendon_prim(stage, path, instance="default"):
+ """Create a prim with a multi-instance PhysxTendonAxisRootAPI applied."""
+ prim = _make_xform(stage, path)
+ PhysxSchema.PhysxTendonAxisRootAPI.Apply(prim, instance)
+ return prim
+
+
+def _make_spatial_tendon_prim(stage, path, instance="default"):
+ """Create a prim with a multi-instance PhysxTendonAttachmentRootAPI applied."""
+ prim = _make_xform(stage, path)
+ PhysxSchema.PhysxTendonAttachmentRootAPI.Apply(prim, instance)
+ return prim
+
+
+def _tendon_attr_prefix(prim, schema_substr):
+ """Return the applied-schema name used by the writer as the authored-attribute prefix.
+
+ The legacy writer authors ``f"{schema_name}:{camelCase(field)}"`` where ``schema_name`` is
+ the entry returned by ``prim.GetAppliedSchemas()`` (e.g. ``PhysxTendonAxisRootAPI:t0``).
+ """
+ for schema_name in prim.GetAppliedSchemas():
+ if schema_substr in schema_name:
+ return schema_name
+ raise AssertionError(f"no applied schema containing {schema_substr!r} on {prim.GetPath()}")
+
+
+# -------------------------------------------------------------------------------------
+# Fixed-tendon marker + metadata defaults
+# -------------------------------------------------------------------------------------
+
+
+def test_fixed_tendon_fragment_metadata_defaults():
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg
+
+ from isaaclab.sim.schemas import FixedTendonFragment, SchemaFragment
+
+ cfg = PhysxFixedTendonCfg(stiffness=1.0)
+ assert isinstance(cfg, FixedTendonFragment) and isinstance(cfg, SchemaFragment)
+ assert cfg.func == "isaaclab_physx.sim.schemas:apply_fixed_tendon"
+ assert cfg.stiffness == 1.0 and cfg.damping is None
+
+
+def test_spatial_tendon_fragment_metadata_defaults():
+ from isaaclab_physx.sim.schemas import PhysxSpatialTendonCfg
+
+ from isaaclab.sim.schemas import SchemaFragment, SpatialTendonFragment
+
+ cfg = PhysxSpatialTendonCfg(stiffness=2.0)
+ assert isinstance(cfg, SpatialTendonFragment) and isinstance(cfg, SchemaFragment)
+ assert cfg.func == "isaaclab_physx.sim.schemas:apply_spatial_tendon"
+ assert cfg.stiffness == 2.0 and cfg.damping is None
+
+
+# -------------------------------------------------------------------------------------
+# PhysxFixedTendonCfg writes the multi-instance namespace
+# -------------------------------------------------------------------------------------
+
+
+def test_physx_fixed_tendon_fragment_writes_instanced_namespace():
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg, apply_fixed_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_fixed_tendon_prim(stage, "/World/FT", instance="t0")
+ apply_fixed_tendon(PhysxFixedTendonCfg(stiffness=3.0, damping=0.5), "/World/FT", stage)
+ prefix = _tendon_attr_prefix(prim, "PhysxTendonAxisRootAPI")
+ assert abs(prim.GetAttribute(f"{prefix}:stiffness").Get() - 3.0) < 1e-6
+ assert abs(prim.GetAttribute(f"{prefix}:damping").Get() - 0.5) < 1e-6
+ # the ``func`` plumbing field must not be authored as an attribute
+ assert not prim.HasAttribute(f"{prefix}:func")
+
+
+# -------------------------------------------------------------------------------------
+# PhysxSpatialTendonCfg writes the multi-instance namespace
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_fixed_tendon_writes_all_instances():
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg, apply_fixed_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_prim_with_schemas(stage, "/World/FTmulti", ["PhysxTendonAxisRootAPI:t0", "PhysxTendonAxisRootAPI:t1"])
+ assert apply_fixed_tendon(PhysxFixedTendonCfg(stiffness=9.0), "/World/FTmulti", stage) is True
+ for inst in ("t0", "t1"):
+ assert abs(prim.GetAttribute(f"PhysxTendonAxisRootAPI:{inst}:stiffness").Get() - 9.0) < 1e-6
+
+
+def test_apply_fixed_tendon_descends_to_child_prims():
+ # tendon schemas are authored on child joint prims, not the articulation root the spawner
+ # targets; applying at the root must descend to every descendant carrying the schema.
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg, apply_fixed_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ UsdGeom.Xform.Define(stage, "/World/Robot") # root: no tendon schema
+ child = _make_fixed_tendon_prim(stage, "/World/Robot/joint", instance="t0") # child joint carries it
+ # apply at the ROOT, not the joint
+ assert apply_fixed_tendon(PhysxFixedTendonCfg(stiffness=8.0), "/World/Robot", stage) is True
+ prefix = _tendon_attr_prefix(child, "PhysxTendonAxisRootAPI")
+ assert abs(child.GetAttribute(f"{prefix}:stiffness").Get() - 8.0) < 1e-6
+
+
+def test_apply_spatial_tendon_descends_to_child_prims():
+ from isaaclab_physx.sim.schemas import PhysxSpatialTendonCfg, apply_spatial_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ UsdGeom.Xform.Define(stage, "/World/Robot2") # root: no tendon schema
+ child = _make_prim_with_schemas(stage, "/World/Robot2/joint", ["PhysxTendonAttachmentRootAPI:s0"])
+ assert apply_spatial_tendon(PhysxSpatialTendonCfg(stiffness=5.0), "/World/Robot2", stage) is True
+ assert abs(child.GetAttribute("PhysxTendonAttachmentRootAPI:s0:stiffness").Get() - 5.0) < 1e-6
+
+
+def test_physx_spatial_tendon_fragment_writes_instanced_namespace():
+ from isaaclab_physx.sim.schemas import PhysxSpatialTendonCfg, apply_spatial_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_spatial_tendon_prim(stage, "/World/ST", instance="s0")
+ apply_spatial_tendon(PhysxSpatialTendonCfg(stiffness=4.0, limit_stiffness=0.25), "/World/ST", stage)
+ prefix = _tendon_attr_prefix(prim, "PhysxTendonAttachmentRootAPI")
+ assert abs(prim.GetAttribute(f"{prefix}:stiffness").Get() - 4.0) < 1e-6
+ assert abs(prim.GetAttribute(f"{prefix}:limitStiffness").Get() - 0.25) < 1e-6
+ assert not prim.HasAttribute(f"{prefix}:func")
+
+
+def test_apply_spatial_tendon_writes_all_instances():
+ from isaaclab_physx.sim.schemas import PhysxSpatialTendonCfg, apply_spatial_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_prim_with_schemas(
+ stage,
+ "/World/STmulti",
+ ["PhysxTendonAttachmentRootAPI:r0", "PhysxTendonAttachmentLeafAPI:l0"],
+ )
+ assert apply_spatial_tendon(PhysxSpatialTendonCfg(stiffness=4.0), "/World/STmulti", stage) is True
+ assert abs(prim.GetAttribute("PhysxTendonAttachmentRootAPI:r0:stiffness").Get() - 4.0) < 1e-6
+ assert abs(prim.GetAttribute("PhysxTendonAttachmentLeafAPI:l0:stiffness").Get() - 4.0) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# apply_fixed_tendon_properties dispatch (tune-not-apply, multi-fragment)
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_fixed_tendon_properties_dispatches_fragments():
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg
+
+ from isaaclab.sim.schemas import apply_fixed_tendon_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_fixed_tendon_prim(stage, "/World/FT2", instance="t0")
+ apply_fixed_tendon_properties(
+ "/World/FT2",
+ [PhysxFixedTendonCfg(stiffness=5.0), PhysxFixedTendonCfg(damping=0.75)],
+ stage,
+ )
+ prefix = _tendon_attr_prefix(prim, "PhysxTendonAxisRootAPI")
+ assert abs(prim.GetAttribute(f"{prefix}:stiffness").Get() - 5.0) < 1e-6
+ assert abs(prim.GetAttribute(f"{prefix}:damping").Get() - 0.75) < 1e-6
+
+
+def test_apply_spatial_tendon_properties_dispatches_fragments():
+ from isaaclab_physx.sim.schemas import PhysxSpatialTendonCfg
+
+ from isaaclab.sim.schemas import apply_spatial_tendon_properties
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ prim = _make_spatial_tendon_prim(stage, "/World/ST2", instance="s0")
+ apply_spatial_tendon_properties(
+ "/World/ST2",
+ [PhysxSpatialTendonCfg(stiffness=6.0), PhysxSpatialTendonCfg(offset=0.1)],
+ stage,
+ )
+ prefix = _tendon_attr_prefix(prim, "PhysxTendonAttachmentRootAPI")
+ assert abs(prim.GetAttribute(f"{prefix}:stiffness").Get() - 6.0) < 1e-6
+ assert abs(prim.GetAttribute(f"{prefix}:offset").Get() - 0.1) < 1e-6
+
+
+# -------------------------------------------------------------------------------------
+# Public imports
+# -------------------------------------------------------------------------------------
+
+
+def test_public_imports():
+ from isaaclab_physx.sim.schemas import ( # noqa: F401
+ PhysxFixedTendonCfg,
+ PhysxSpatialTendonCfg,
+ apply_fixed_tendon,
+ apply_spatial_tendon,
+ )
+
+ from isaaclab.sim.schemas import ( # noqa: F401
+ FixedTendonFragment,
+ SpatialTendonFragment,
+ apply_fixed_tendon_properties,
+ apply_spatial_tendon_properties,
+ )
+
+
+# -------------------------------------------------------------------------------------
+# core writer parity: invalid-prim guard + aggregated return
+# -------------------------------------------------------------------------------------
+
+
+def test_apply_fixed_tendon_raises_on_invalid_prim():
+ from isaaclab.sim.schemas import apply_fixed_tendon_properties
+
+ _new_sim()
+ stage = sim_utils.get_current_stage()
+ with pytest.raises(ValueError):
+ apply_fixed_tendon_properties("/World/DoesNotExist", [], stage)
+
+
+def test_apply_spatial_tendon_raises_on_invalid_prim():
+ from isaaclab.sim.schemas import apply_spatial_tendon_properties
+
+ _new_sim()
+ stage = sim_utils.get_current_stage()
+ with pytest.raises(ValueError):
+ apply_spatial_tendon_properties("/World/DoesNotExist", [], stage)
+
+
+def test_apply_fixed_tendon_aggregates_fragment_results():
+ from isaaclab.sim.schemas import UsdPhysicsRigidBodyCfg, apply_fixed_tendon_properties
+
+ stage = _new_sim()
+ _make_prim_with_schemas(stage, "/World/Agg", ["PhysxTendonAxisRootAPI:inst0"])
+
+ # a fragment whose applier reports failure makes the aggregate False
+ failing = UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)
+ failing.func = lambda cfg, prim_path, stage=None: False
+ assert apply_fixed_tendon_properties("/World/Agg", [failing], stage) is False
+
+ ok = UsdPhysicsRigidBodyCfg(rigid_body_enabled=True)
+ ok.func = lambda cfg, prim_path, stage=None: True
+ assert apply_fixed_tendon_properties("/World/Agg", [ok], stage) is True
+
+
+def test_apply_fixed_tendon_raises_on_invalid_prim_backend():
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg, apply_fixed_tendon
+
+ _new_sim()
+ stage = sim_utils.get_current_stage()
+ with pytest.raises(ValueError):
+ apply_fixed_tendon(PhysxFixedTendonCfg(stiffness=1.0), "/World/DoesNotExist", stage)
+
+
+def test_apply_mujoco_fixed_tendon_raises_on_invalid_prim():
+ from isaaclab_newton.sim.schemas import MujocoFixedTendonCfg, apply_mujoco_fixed_tendon
+
+ _new_sim()
+ stage = sim_utils.get_current_stage()
+ with pytest.raises(ValueError):
+ apply_mujoco_fixed_tendon(MujocoFixedTendonCfg(stiffness=1.0), "/World/DoesNotExist", stage)
+
+
+# -------------------------------------------------------------------------------------
+# MujocoFixedTendonCfg — Newton fragment for the mjc: namespace
+# -------------------------------------------------------------------------------------
+
+
+def test_mujoco_fixed_tendon_metadata():
+ from isaaclab_newton.sim.schemas import MujocoFixedTendonCfg
+
+ from isaaclab.sim.schemas import FixedTendonFragment
+
+ cfg = MujocoFixedTendonCfg(stiffness=2.0)
+ assert isinstance(cfg, FixedTendonFragment)
+ # not namespace-driven: the custom applier writes mjc:* itself, so _usd_namespace stays None
+ assert type(cfg)._usd_namespace is None
+ assert cfg.func == "isaaclab_newton.sim.schemas:apply_mujoco_fixed_tendon"
+ assert not hasattr(cfg, "rest_length") and not hasattr(cfg, "limit_stiffness")
+
+
+def test_apply_mujoco_fixed_tendon_writes_mjc_namespace():
+ from isaaclab_newton.sim.schemas import MujocoFixedTendonCfg, apply_mujoco_fixed_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ stage.DefinePrim("/World/MjcT", "MjcTendon")
+ assert apply_mujoco_fixed_tendon(MujocoFixedTendonCfg(stiffness=2.0, damping=0.25), "/World/MjcT", stage) is True
+ prim = stage.GetPrimAtPath("/World/MjcT")
+ assert abs(prim.GetAttribute("mjc:stiffness").Get() - 2.0) < 1e-6
+ assert abs(prim.GetAttribute("mjc:damping").Get() - 0.25) < 1e-6
+ assert not prim.HasAttribute("mjc:func")
+
+
+def test_apply_mujoco_fixed_tendon_returns_false_on_non_mjc_prim():
+ from isaaclab_newton.sim.schemas import MujocoFixedTendonCfg, apply_mujoco_fixed_tendon
+
+ sim_utils.create_new_stage()
+ SimulationContext(SimulationCfg(dt=0.01))
+ stage = sim_utils.get_current_stage()
+ UsdGeom.Xform.Define(stage, "/World/NotMjc")
+ assert apply_mujoco_fixed_tendon(MujocoFixedTendonCfg(stiffness=2.0), "/World/NotMjc", stage) is False
+ prim = stage.GetPrimAtPath("/World/NotMjc")
+ assert not prim.HasAttribute("mjc:stiffness")
+
+
+# -------------------------------------------------------------------------------------
+# legacy-vs-fragment equivalence (the fragment API must be a behavioral no-op swap)
+# -------------------------------------------------------------------------------------
+
+
+def test_legacy_and_fragment_fixed_tendon_produce_identical_attrs():
+ """The fragment API must author the same tendon attributes as the legacy writer.
+
+ Verified end-to-end on the Shadow Hand (the real tendon user,
+ ``FixedTendonPropertiesCfg(limit_stiffness=30.0, damping=0.1)``); replicated here on a synthetic
+ root + descendant-joint structure so it runs deterministically without asset-server access. Also
+ exercises the descend-to-child-prims behavior, since the schemas live on descendants of the
+ applied prim path (as they do on a real articulation).
+ """
+ from isaaclab_physx.sim.schemas import PhysxFixedTendonCfg, PhysxFixedTendonPropertiesCfg
+
+ from isaaclab.sim.schemas import apply_fixed_tendon_properties, modify_fixed_tendon_properties
+
+ stage = _new_sim()
+
+ def _build(root):
+ # tendon schemas on descendant joints (multi-instance), mirroring the Shadow Hand layout
+ UsdGeom.Xform.Define(stage, root)
+ _make_prim_with_schemas(stage, f"{root}/J0", ["PhysxTendonAxisRootAPI:t0", "PhysxTendonAxisRootAPI:t1"])
+ _make_prim_with_schemas(stage, f"{root}/nested/J1", ["PhysxTendonAxisRootAPI:t0"])
+
+ _build("/World/legacy")
+ _build("/World/fragment")
+
+ # apply each path at the ROOT; both must descend to the child joints
+ modify_fixed_tendon_properties("/World/legacy", PhysxFixedTendonPropertiesCfg(limit_stiffness=30.0, damping=0.1))
+ apply_fixed_tendon_properties("/World/fragment", [PhysxFixedTendonCfg(limit_stiffness=30.0, damping=0.1)])
+
+ def _collect(root):
+ attrs = {}
+ for prim in Usd.PrimRange(stage.GetPrimAtPath(root)):
+ for schema_name in prim.GetAppliedSchemas():
+ if "PhysxTendonAxisRootAPI" not in schema_name:
+ continue
+ for suffix in ("limitStiffness", "damping"):
+ attr = prim.GetAttribute(f"{schema_name}:{suffix}")
+ if attr and attr.HasAuthoredValue():
+ rel = prim.GetPath().pathString[len(root) :] # key relative to root so paths compare
+ attrs[f"{rel}|{schema_name}:{suffix}"] = attr.Get()
+ return attrs
+
+ legacy = _collect("/World/legacy")
+ fragment = _collect("/World/fragment")
+
+ assert legacy, "legacy writer authored no tendon attributes (test would be vacuous)"
+ assert legacy.keys() == fragment.keys()
+ for key, value in legacy.items():
+ assert abs(fragment[key] - value) < 1e-6
+
+
+def test_spawn_from_file_with_empty_tendon_lists_is_noop(tmp_path):
+ # an empty tendon list is type-valid for the slot; the spawner shim must route it through the
+ # fragment path (a no-op) rather than handing [] to the legacy modify_*_tendon_properties writer.
+ asset = tmp_path / "mini.usda"
+ src = Usd.Stage.CreateNew(str(asset))
+ UsdGeom.Xform.Define(src, "/Root")
+ src.SetDefaultPrim(src.GetPrimAtPath("/Root"))
+ src.GetRootLayer().Save()
+ del src
+
+ _new_sim()
+ cfg = sim_utils.UsdFileCfg(usd_path=str(asset), fixed_tendons_props=[], spatial_tendons_props=[])
+ cfg.func("/World/Asset", cfg) # must not raise
+ assert sim_utils.get_current_stage().GetPrimAtPath("/World/Asset").IsValid()
diff --git a/source/isaaclab/test/sim/test_utils_stage.py b/source/isaaclab/test/sim/test_utils_stage.py
index f6d73d518662..6126720ff34e 100644
--- a/source/isaaclab/test/sim/test_utils_stage.py
+++ b/source/isaaclab/test/sim/test_utils_stage.py
@@ -203,6 +203,35 @@ def test_save_stage_invalid_path():
sim_utils.save_stage("/tmp/test.invalid")
+@pytest.mark.parametrize(
+ "scheme, scheme_end",
+ [
+ ("http://", "example.com/file.usd"),
+ ("https://", "example.com/assets/textures/sky.hdr"),
+ ("omniverse://", "path/to/file.usd"),
+ ("s3://", "bucket-name/path/to/asset.usd"),
+ ],
+)
+def test_save_stage_preserves_uri_asset_paths(scheme, scheme_end):
+ """Test saving stage preserves URI asset paths."""
+ from pxr import UsdLux
+
+ with tempfile.TemporaryDirectory() as temp_dir:
+ stage = sim_utils.create_new_stage()
+ dome_light = UsdLux.DomeLight.Define(stage, "/World/skyLight")
+ ref = scheme + scheme_end
+ dome_light.CreateTextureFileAttr().Set(ref)
+
+ save_path = Path(temp_dir) / "test_stage.usda"
+ result = sim_utils.save_stage(str(save_path), save_and_reload_in_place=False)
+
+ assert result is True
+ saved_stage = save_path.read_text(encoding="utf-8")
+ assert f"@{ref}@" in saved_stage
+ assert f"../{scheme}" not in saved_stage
+ assert rf"..\{scheme}" not in saved_stage
+
+
def test_close_stage():
"""Test closing the current stage."""
# Create a stage
diff --git a/source/isaaclab_assets/config/extension.toml b/source/isaaclab_assets/config/extension.toml
index 055e3a5ff2f2..38e4707a8098 100644
--- a/source/isaaclab_assets/config/extension.toml
+++ b/source/isaaclab_assets/config/extension.toml
@@ -1,6 +1,6 @@
[package]
# Semantic Versioning is used: https://semver.org/
-version = "0.3.4"
+version = "0.4.0"
# Description
title = "Isaac Lab Assets"
diff --git a/source/isaaclab_assets/docs/CHANGELOG.rst b/source/isaaclab_assets/docs/CHANGELOG.rst
index e9eda5822210..a11a177c97f2 100644
--- a/source/isaaclab_assets/docs/CHANGELOG.rst
+++ b/source/isaaclab_assets/docs/CHANGELOG.rst
@@ -1,6 +1,17 @@
Changelog
---------
+0.4.0 (2026-06-27)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :obj:`~isaaclab_assets.robots.so101.SO101_CFG` and
+ :obj:`~isaaclab_assets.robots.so101.SO101_HIGH_PD_CFG` configurations for the
+ TheRobotStudio SO-101 5-DOF follower arm.
+
+
0.3.4 (2026-05-12)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_assets/isaaclab_assets/robots/__init__.pyi b/source/isaaclab_assets/isaaclab_assets/robots/__init__.pyi
index 1a91afa213a7..2440b5d8a795 100644
--- a/source/isaaclab_assets/isaaclab_assets/robots/__init__.pyi
+++ b/source/isaaclab_assets/isaaclab_assets/robots/__init__.pyi
@@ -36,6 +36,8 @@ __all__ = [
"RIDGEBACK_FRANKA_PANDA_CFG",
"SAWYER_CFG",
"SHADOW_HAND_CFG",
+ "SO101_CFG",
+ "SO101_HIGH_PD_CFG",
"joint_parameter_lookup",
"SPOT_CFG",
"GO1_ACTUATOR_CFG",
@@ -85,6 +87,7 @@ from .quadcopter import CRAZYFLIE_CFG
from .ridgeback_franka import RIDGEBACK_FRANKA_PANDA_CFG
from .sawyer import SAWYER_CFG
from .shadow_hand import SHADOW_HAND_CFG
+from .so101 import SO101_CFG, SO101_HIGH_PD_CFG
from .spot import joint_parameter_lookup, SPOT_CFG
from .unitree import (
GO1_ACTUATOR_CFG,
diff --git a/source/isaaclab_assets/isaaclab_assets/robots/so101.py b/source/isaaclab_assets/isaaclab_assets/robots/so101.py
new file mode 100644
index 000000000000..aba5a180a33a
--- /dev/null
+++ b/source/isaaclab_assets/isaaclab_assets/robots/so101.py
@@ -0,0 +1,86 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Configuration for the TheRobotStudio SO-101 follower arm.
+
+The following configurations are available:
+
+* :obj:`SO101_CFG`: SO-101 5-DOF arm with a single-jaw gripper.
+* :obj:`SO101_HIGH_PD_CFG`: SO-101 with a stiffer PD controller for task-space (IK) tracking.
+
+The SO-101 is a low-cost 5-DOF arm (``shoulder_pan``, ``shoulder_lift``, ``elbow_flex``,
+``wrist_flex``, ``wrist_roll``) plus a single revolute ``gripper`` jaw. Because the arm has
+only 5 actuated DOF, it cannot achieve an arbitrary 6-DOF end-effector pose; task-space
+controllers should command the full pose but soft-weight the orientation rows so position is
+tracked exactly and orientation is best-effort (see the cube-stack IK-Abs task).
+
+Reference: https://github.com/TheRobotStudio/SO-ARM100
+Actuator gains follow the values tuned for simulation in LeIsaac.
+"""
+
+import isaaclab.sim as sim_utils
+from isaaclab.actuators import ImplicitActuatorCfg
+from isaaclab.assets.articulation import ArticulationCfg
+from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
+
+##
+# Configuration
+##
+
+SO101_CFG = ArticulationCfg(
+ spawn=sim_utils.UsdFileCfg(
+ usd_path=f"{ISAAC_NUCLEUS_DIR}/Robots/RobotStudio/so101_new_calib/so101_new_calib.usd",
+ activate_contact_sensors=False,
+ rigid_props=sim_utils.RigidBodyPropertiesCfg(
+ disable_gravity=False,
+ max_depenetration_velocity=5.0,
+ ),
+ articulation_props=sim_utils.ArticulationRootPropertiesCfg(
+ enabled_self_collisions=True,
+ solver_position_iteration_count=8,
+ solver_velocity_iteration_count=0,
+ fix_root_link=True,
+ ),
+ ),
+ init_state=ArticulationCfg.InitialStateCfg(
+ joint_pos={
+ "shoulder_pan": 0.0,
+ "shoulder_lift": 0.0,
+ "elbow_flex": 0.0,
+ "wrist_flex": 0.0,
+ "wrist_roll": 0.0,
+ "gripper": 0.0,
+ },
+ ),
+ actuators={
+ "arm": ImplicitActuatorCfg(
+ joint_names_expr=["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll"],
+ effort_limit_sim=10.0,
+ velocity_limit_sim=10.0,
+ stiffness=17.8,
+ damping=0.60,
+ ),
+ "gripper": ImplicitActuatorCfg(
+ joint_names_expr=["gripper"],
+ effort_limit_sim=10.0,
+ velocity_limit_sim=10.0,
+ stiffness=17.8,
+ damping=0.60,
+ ),
+ },
+ soft_joint_pos_limit_factor=1.0,
+)
+"""Configuration of the SO-101 follower arm with implicit actuators."""
+
+
+SO101_HIGH_PD_CFG = SO101_CFG.copy()
+SO101_HIGH_PD_CFG.spawn.rigid_props.disable_gravity = True
+SO101_HIGH_PD_CFG.actuators["arm"].stiffness = 400.0
+SO101_HIGH_PD_CFG.actuators["arm"].damping = 80.0
+"""Configuration of the SO-101 follower arm with stiffer PD control.
+
+This configuration is useful for task-space control using differential IK, where the
+default low-stiffness gains track end-effector targets poorly.
+"""
diff --git a/source/isaaclab_assets/pyproject.toml b/source/isaaclab_assets/pyproject.toml
index cce714d643d6..cbd4b3a156e2 100644
--- a/source/isaaclab_assets/pyproject.toml
+++ b/source/isaaclab_assets/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab_assets"
-version = "0.3.4"
+version = "0.4.0"
description = "Extension containing configuration instances of different assets and sensors."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
diff --git a/source/isaaclab_newton/changelog.d/jmart-cartpole-rtx.minor.rst b/source/isaaclab_newton/changelog.d/jmart-cartpole-rtx.minor.rst
deleted file mode 100644
index fc7a261e769f..000000000000
--- a/source/isaaclab_newton/changelog.d/jmart-cartpole-rtx.minor.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-Added
-^^^^^
-
-* Overrode :meth:`provides_implicit_damping` on :class:`NewtonManager` to return ``False`` (its
- symplectic integrator has no implicit damping) and :meth:`provides_temporal_camera_data` on
- :class:`NewtonWarpRenderer` to return ``False`` (the rasterizer accumulates no temporal data),
- so camera tasks can auto-enable frame stacking for the Newton combos that need it.
diff --git a/source/isaaclab_newton/changelog.d/vidurv-schema-frag-jointdrive.minor.rst b/source/isaaclab_newton/changelog.d/vidurv-schema-frag-jointdrive.minor.rst
new file mode 100644
index 000000000000..52ff628dcbdf
--- /dev/null
+++ b/source/isaaclab_newton/changelog.d/vidurv-schema-frag-jointdrive.minor.rst
@@ -0,0 +1,8 @@
+Added
+^^^^^
+
+* Added the :class:`~isaaclab_newton.sim.schemas.MujocoJointCfg` joint-drive fragment
+ (``mjc:*`` / ``MjcJointAPI``), carrying joint-level ``actuatorgravcomp``. Applied alongside
+ :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` via
+ :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`. The from-files spawn site continues
+ to auto-enable body-level gravcomp for the fragment path.
diff --git a/source/isaaclab_newton/changelog.d/vidurv-schema-frag-meshcollision.minor.rst b/source/isaaclab_newton/changelog.d/vidurv-schema-frag-meshcollision.minor.rst
new file mode 100644
index 000000000000..4246cfd9a1f5
--- /dev/null
+++ b/source/isaaclab_newton/changelog.d/vidurv-schema-frag-meshcollision.minor.rst
@@ -0,0 +1,9 @@
+Added
+^^^^^
+
+* Added the Newton mesh-collision cooking fragments:
+ :class:`~isaaclab_newton.sim.schemas.NewtonMeshCollisionCfg` (``newton:maxHullVertices`` via
+ ``NewtonMeshCollisionAPI``) and :class:`~isaaclab_newton.sim.schemas.NewtonSDFCollisionCfg`
+ (Newton SDF generation and hydroelastic-contact attributes via ``NewtonSDFCollisionAPI``). Each is
+ a single-namespace :class:`~isaaclab.sim.schemas.MeshCollisionFragment` dispatched via
+ :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
diff --git a/source/isaaclab_newton/config/extension.toml b/source/isaaclab_newton/config/extension.toml
index e634a251cfc0..9c7f58d42c93 100644
--- a/source/isaaclab_newton/config/extension.toml
+++ b/source/isaaclab_newton/config/extension.toml
@@ -1,7 +1,7 @@
[package]
# Note: Semantic Versioning is used: https://semver.org/
-version = "1.0.4"
+version = "1.4.0"
# Description
title = "Newton simulation interfaces for IsaacLab core package"
diff --git a/source/isaaclab_newton/docs/CHANGELOG.rst b/source/isaaclab_newton/docs/CHANGELOG.rst
index 1e92f80043e8..1a752a3a217f 100644
--- a/source/isaaclab_newton/docs/CHANGELOG.rst
+++ b/source/isaaclab_newton/docs/CHANGELOG.rst
@@ -1,6 +1,63 @@
Changelog
---------
+1.4.0 (2026-06-27)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_newton.sim.schemas.MujocoFixedTendonCfg` and its applier
+ :func:`~isaaclab_newton.sim.schemas.apply_mujoco_fixed_tendon` for tuning ``mjc:*``
+ fixed-tendon attributes on ``MjcTendon`` prims,
+ splitting the Mujoco tune path out of the PhysX fixed-tendon applier.
+
+
+1.3.0 (2026-06-26)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_newton.sim.schemas.NewtonCollisionCfg`, the ``newton:*``
+ single-namespace collision fragment (``newton:contactMargin``, ``newton:contactGap`` via
+ ``NewtonCollisionAPI``). It composes with
+ :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` and
+ :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg` in a ``collision_props`` fragment list.
+
+
+1.2.0 (2026-06-25)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_newton.sim.schemas.MujocoRigidBodyCfg`, the ``mjc:*`` single-namespace
+ rigid-body fragment (``mjc:gravcomp``) for Newton's MuJoCo solver. It composes with
+ :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` and
+ :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg` in a ``rigid_props`` fragment list.
+
+
+1.1.0 (2026-06-24)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Overrode :meth:`provides_implicit_damping` on :class:`NewtonManager` to return ``False`` (its
+ symplectic integrator has no implicit damping) and :meth:`provides_temporal_camera_data` on
+ :class:`NewtonWarpRenderer` to return ``False`` (the rasterizer accumulates no temporal data),
+ so camera tasks can auto-enable frame stacking for the Newton combos that need it.
+
+Fixed
+^^^^^
+
+* Fixed the ``newton[sim]`` dependency pin to use Newton commit
+ ``79e95bf5571d70a0a46c8eaedc80644531d27368``, including the
+ RenderContext triangle-mesh construction fix from `newton-physics/newton#3199
+ `_.
+
+
1.0.4 (2026-06-23)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_newton/isaaclab_newton/sim/schemas/__init__.pyi b/source/isaaclab_newton/isaaclab_newton/sim/schemas/__init__.pyi
index e546498ee4aa..a40c3fa1df50 100644
--- a/source/isaaclab_newton/isaaclab_newton/sim/schemas/__init__.pyi
+++ b/source/isaaclab_newton/isaaclab_newton/sim/schemas/__init__.pyi
@@ -4,27 +4,45 @@
# SPDX-License-Identifier: BSD-3-Clause
__all__ = [
+ "MujocoJointCfg",
+ "apply_mujoco_fixed_tendon",
+ "MujocoFixedTendonCfg",
"MujocoJointDrivePropertiesCfg",
+ "MujocoRigidBodyCfg",
"MujocoRigidBodyPropertiesCfg",
"NewtonArticulationRootPropertiesCfg",
+ "NewtonCollisionCfg",
"NewtonCollisionPropertiesCfg",
"NewtonDeformableBodyPropertiesCfg",
"NewtonJointDrivePropertiesCfg",
"NewtonMaterialPropertiesCfg",
+ "NewtonMeshCollisionCfg",
"NewtonMeshCollisionPropertiesCfg",
"NewtonRigidBodyPropertiesCfg",
+ "NewtonSDFCollisionCfg",
"NewtonSDFCollisionPropertiesCfg",
+ "apply_mujoco_joint",
]
+from .schemas import (
+ apply_mujoco_fixed_tendon,
+ apply_mujoco_joint,
+)
from .schemas_cfg import (
+ MujocoFixedTendonCfg,
+ MujocoJointCfg,
MujocoJointDrivePropertiesCfg,
+ MujocoRigidBodyCfg,
MujocoRigidBodyPropertiesCfg,
NewtonArticulationRootPropertiesCfg,
+ NewtonCollisionCfg,
NewtonCollisionPropertiesCfg,
NewtonDeformableBodyPropertiesCfg,
NewtonJointDrivePropertiesCfg,
NewtonMaterialPropertiesCfg,
+ NewtonMeshCollisionCfg,
NewtonMeshCollisionPropertiesCfg,
NewtonRigidBodyPropertiesCfg,
+ NewtonSDFCollisionCfg,
NewtonSDFCollisionPropertiesCfg,
)
diff --git a/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas.py b/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas.py
new file mode 100644
index 000000000000..a4e46b2e6973
--- /dev/null
+++ b/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas.py
@@ -0,0 +1,105 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Newton-specific schema-fragment appliers.
+
+Hosts the custom ``func`` overrides for Newton/MuJoCo fragments whose application needs backend
+logic beyond the generic :func:`~isaaclab.sim.schemas.apply_namespaced` writer. Keeping these here
+(rather than in the core spawner) means ``isaaclab`` never imports a backend.
+"""
+
+from __future__ import annotations
+
+import dataclasses
+
+from pxr import Usd, UsdPhysics
+
+from isaaclab.sim.schemas.schemas import apply_namespaced
+from isaaclab.sim.utils import safe_set_attribute_on_usd_prim
+from isaaclab.sim.utils.stage import get_current_stage
+from isaaclab.utils.string import to_camel_case
+
+from .schemas_cfg import MujocoFixedTendonCfg, MujocoJointCfg
+
+__all__ = ["apply_mujoco_fixed_tendon", "apply_mujoco_joint"]
+
+
+def apply_mujoco_fixed_tendon(cfg: MujocoFixedTendonCfg, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Write ``mjc:*`` fixed-tendon attributes on a ``MjcTendon`` prim.
+
+ Custom ``func`` override for :class:`~isaaclab_newton.sim.schemas.MujocoFixedTendonCfg`.
+ No-op (returns False) on any prim whose type is not ``MjcTendon``.
+
+ Args:
+ cfg: The :class:`MujocoFixedTendonCfg` fragment to apply.
+ prim_path: The prim path of the ``MjcTendon`` prim.
+ stage: The stage where to find the prim. Defaults to the current stage.
+
+ Returns:
+ True if the prim is a ``MjcTendon`` and was tuned, False otherwise.
+
+ Raises:
+ ValueError: If the prim at ``prim_path`` does not exist in the stage.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ root = stage.GetPrimAtPath(prim_path)
+ if not root.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ values = {
+ f.name: getattr(cfg, f.name)
+ for f in dataclasses.fields(cfg)
+ if f.name != "func" and getattr(cfg, f.name) is not None
+ }
+ # Descend the whole subtree (matching legacy apply_nested): ``MjcTendon`` prims may sit below
+ # the prim_path the spawner targets. Write ``mjc:*`` on every ``MjcTendon`` descendant.
+ found = False
+ for prim in Usd.PrimRange(root):
+ if prim.GetTypeName() != "MjcTendon":
+ continue
+ found = True
+ for attr_name, value in values.items():
+ safe_set_attribute_on_usd_prim(prim, f"mjc:{to_camel_case(attr_name, 'cC')}", value, camel_case=False)
+ return found
+
+
+def apply_mujoco_joint(cfg: MujocoJointCfg, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Apply a :class:`MujocoJointCfg` fragment, including its body-level gravcomp coupling.
+
+ Custom ``func`` override for :class:`MujocoJointCfg`. Writes the joint's ``mjc:*`` attributes via
+ :func:`~isaaclab.sim.schemas.apply_namespaced`, then enforces the MuJoCo coupling that joint-level
+ ``actuatorgravcomp`` requires body-level ``gravcomp``: in MuJoCo ``actuatorgravcomp`` is a per-joint
+ flag (``jnt_actgravcomp``) that routes the gravity-compensation force of the joint's actuated body
+ through the actuator, and it is inert unless that body's ``mjc:gravcomp`` is non-zero. So when
+ :attr:`~MujocoJointCfg.actuatorgravcomp` is requested, this enables ``mjc:gravcomp = 1.0`` on the
+ joint's child body (its ``physics:body1`` target) when the body has not authored it. An explicitly
+ authored body gravcomp is preserved. Keeping this coupling in the Newton applier (not the core
+ spawner) keeps the core package free of any backend dependency.
+
+ Args:
+ cfg: The :class:`MujocoJointCfg` fragment to apply.
+ prim_path: The joint prim path to author on.
+ stage: The stage where to find the prim. Defaults to the current stage.
+
+ Returns:
+ True if the joint fragment was applied successfully.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ success = apply_namespaced(cfg, prim_path, stage)
+ # actuatorgravcomp is inert unless the actuated body has non-zero gravcomp; flip it on the joint's
+ # child body when requested and unset (per-joint dispatch covers every actuated body in the
+ # articulation; the non-actuated base has no parent joint and needs no compensation).
+ if cfg.actuatorgravcomp:
+ joint = UsdPhysics.Joint(stage.GetPrimAtPath(prim_path))
+ targets = joint.GetBody1Rel().GetTargets() if joint else []
+ for body_path in targets:
+ body = stage.GetPrimAtPath(body_path)
+ if not body.IsValid():
+ continue
+ current = body.GetAttribute("mjc:gravcomp").Get()
+ if current is None or current == 0.0:
+ safe_set_attribute_on_usd_prim(body, "mjc:gravcomp", 1.0, camel_case=False)
+ return success
diff --git a/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py b/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py
index a7b0d0082577..05d63921efde 100644
--- a/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py
+++ b/source/isaaclab_newton/isaaclab_newton/sim/schemas/schemas_cfg.py
@@ -5,15 +5,21 @@
from __future__ import annotations
+from collections.abc import Callable
from typing import ClassVar, Literal
from isaaclab.sim.schemas.schemas_cfg import (
ArticulationRootBaseCfg,
CollisionBaseCfg,
+ CollisionFragment,
DeformableBodyPropertiesBaseCfg,
+ FixedTendonFragment,
JointDriveBaseCfg,
+ JointDriveFragment,
MeshCollisionBaseCfg,
+ MeshCollisionFragment,
RigidBodyBaseCfg,
+ RigidBodyFragment,
)
from isaaclab.sim.spawners.materials.physics_materials_cfg import RigidBodyMaterialBaseCfg
from isaaclab.utils.configclass import configclass
@@ -84,6 +90,60 @@ class MujocoRigidBodyPropertiesCfg(NewtonRigidBodyPropertiesCfg):
"""
+@configclass
+class MujocoRigidBodyCfg(RigidBodyFragment):
+ """``mjc:*`` rigid-body attributes for Newton's MuJoCo solver.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) carrying
+ body-level gravity compensation. The ``mjc`` namespace has no applied schema; the
+ ``UsdPhysics.RigidBodyAPI`` anchor is applied by
+ :func:`~isaaclab.sim.schemas.apply_rigid_body_properties`.
+
+ .. note::
+ A ``newton:*`` rigid-body fragment is reserved but currently empty (Newton has no native
+ ``newton:`` rigid-body attributes today).
+ """
+
+ _usd_namespace: ClassVar[str | None] = "mjc"
+ _usd_applied_schema: ClassVar[str | None] = None
+
+ gravcomp: float | None = None
+ """Gravity compensation scale for the body [dimensionless].
+
+ ``0.0`` = no compensation; ``1.0`` = full compensation. Written to ``mjc:gravcomp``. Body-level
+ gravcomp must be set for joint-level ``actuatorgravcomp`` to have any effect.
+ """
+
+
+@configclass
+class MujocoJointCfg(JointDriveFragment):
+ """``mjc:*`` joint attributes for Newton's MuJoCo solver from ``MjcJointAPI``.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) carrying
+ joint-level gravity compensation. Applied alongside
+ :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` via
+ :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`. It overrides :attr:`func` with
+ :func:`~isaaclab_newton.sim.schemas.apply_mujoco_joint`, which writes the ``mjc:*`` attributes
+ and enforces the body-level gravcomp coupling that joint-level ``actuatorgravcomp`` requires.
+ """
+
+ _usd_namespace: ClassVar[str | None] = "mjc"
+ _usd_applied_schema: ClassVar[str | None] = "MjcJointAPI"
+
+ # Custom applier: writes the mjc:* joint attrs and, when ``actuatorgravcomp`` is requested, flips
+ # body-level ``mjc:gravcomp`` on the joint's child body (the coupling lives in the backend applier
+ # so the core spawner stays backend-free). See :func:`~isaaclab_newton.sim.schemas.apply_mujoco_joint`.
+ func: Callable | str = "isaaclab_newton.sim.schemas:apply_mujoco_joint"
+
+ actuatorgravcomp: bool | None = None
+ """Route gravity compensation forces through the actuator channel.
+
+ When ``True``, compensation forces go to ``qfrc_actuator`` (subject to force limits).
+ Requires body-level :attr:`MujocoRigidBodyCfg.gravcomp`. Written to ``mjc:actuatorgravcomp``
+ via ``MjcJointAPI``.
+ """
+
+
@configclass
class NewtonJointDrivePropertiesCfg(JointDriveBaseCfg):
"""Newton-targeted joint drive properties.
@@ -131,6 +191,41 @@ class MujocoJointDrivePropertiesCfg(NewtonJointDrivePropertiesCfg):
"""
+@configclass
+class NewtonCollisionCfg(CollisionFragment):
+ """``newton:*`` collision attributes for Newton's contact pipeline.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) carrying
+ Newton-native contact-geometry attributes (``NewtonCollisionAPI``). Applied alongside
+ :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` via
+ :func:`~isaaclab.sim.schemas.apply_collision_properties`.
+
+ .. note::
+ The contact / rest offsets live on :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg`
+ as ``physxCollision:*`` fields; Newton reads them via its PhysX-bridge resolver, so they
+ are not duplicated here.
+ """
+
+ _usd_namespace: ClassVar[str | None] = "newton"
+ _usd_applied_schema: ClassVar[str | None] = "NewtonCollisionAPI"
+
+ contact_margin: float | None = None
+ """Outward inflation of the collision surface [m].
+
+ Extends the effective collision surface outward. Sum of both bodies' margins is used for
+ collision detection. Essential for thin shells and cloth. Written to ``newton:contactMargin``
+ via ``NewtonCollisionAPI``. Range: [0, inf).
+ """
+
+ contact_gap: float | None = None
+ """Additional contact detection gap [m].
+
+ AABBs are expanded by this value; contacts are detected earlier to avoid tunneling. Written to
+ ``newton:contactGap`` via ``NewtonCollisionAPI``. Set to ``-inf`` to use Newton's builder
+ default. Range: [0, inf).
+ """
+
+
@configclass
class NewtonCollisionPropertiesCfg(CollisionBaseCfg):
"""Newton-specific collision properties.
@@ -263,6 +358,118 @@ class NewtonSDFCollisionPropertiesCfg(NewtonCollisionPropertiesCfg):
"""
+# -------------------------------------------------------------------------------------
+# Mesh-collision cooking fragments (single-namespace; Newton cooking add-on schemas).
+#
+# Each fragment owns the ``newton`` namespace + its applied schema, dispatched via ``apply_namespaced``.
+# They author no ``mesh_approximation_name`` (the token is set by the PhysX/USD fragment in the same
+# list), so they only tune Newton-native cooking attributes.
+# -------------------------------------------------------------------------------------
+
+
+@configclass
+class NewtonMeshCollisionCfg(MeshCollisionFragment):
+ """``newton:maxHullVertices`` mesh-cooking attribute from ``NewtonMeshCollisionAPI``.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) carrying
+ Newton's convex-hull vertex limit. Dispatched alongside the USD/PhysX mesh-collision fragments
+ via :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+
+ .. note::
+ If the values are None, they are not modified.
+ """
+
+ _usd_namespace: ClassVar[str | None] = "newton"
+ _usd_applied_schema: ClassVar[str | None] = "NewtonMeshCollisionAPI"
+
+ max_hull_vertices: int | None = None
+ """Maximum vertices in the convex hull approximation [dimensionless].
+
+ Only relevant when ``physics:approximation = "convexHull"``.
+ Written to ``newton:maxHullVertices`` via ``NewtonMeshCollisionAPI``.
+ Set to ``-1`` to use as many vertices as needed for a perfect hull.
+ """
+
+
+@configclass
+class NewtonSDFCollisionCfg(MeshCollisionFragment):
+ """``newton:*`` SDF and hydroelastic mesh-cooking attributes from ``NewtonSDFCollisionAPI``.
+
+ A single-namespace fragment carrying Newton SDF generation and hydroelastic-contact attributes
+ consumed by Newton's USD importer. Mirrors the legacy
+ :class:`NewtonSDFCollisionPropertiesCfg`. Dispatched alongside the USD/PhysX mesh-collision
+ fragments via :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+
+ .. note::
+ These ``newton:sdf*`` / ``newton:hydroelastic*`` attributes are read by Newton's USD
+ importer starting in Newton 1.3.0 (which also detects the unregistered
+ ``NewtonSDFCollisionAPI`` token via the raw ``apiSchemas`` list-op). On older Newton builds
+ they are authored but inert.
+
+ .. note::
+ If the values are None, they are not modified.
+ """
+
+ _usd_namespace: ClassVar[str | None] = "newton"
+ # ``NewtonSDFCollisionAPI`` is authored into the prim's ``apiSchemas`` listOp (matching the
+ # legacy ``NewtonSDFCollisionPropertiesCfg``). It is not a *registered* applied API schema in
+ # the current Newton build, so it does not appear in the composed ``GetAppliedSchemas()`` until
+ # the schema ships -- but it is authored, and Newton's importer reads the ``newton:*`` attrs.
+ _usd_applied_schema: ClassVar[str | None] = "NewtonSDFCollisionAPI"
+
+ sdf_max_resolution: int | None = None
+ """Maximum SDF grid dimension [dimensionless].
+
+ Newton requires this value to be divisible by 8. If :attr:`sdf_target_voxel_size` is also
+ authored, Newton uses the target voxel size and ignores this resolution.
+ Written to ``newton:sdfMaxResolution`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ sdf_narrow_band_inner: float | None = None
+ """Inner narrow-band distance for SDF generation [m].
+
+ Written to ``newton:sdfNarrowBandInner`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ sdf_narrow_band_outer: float | None = None
+ """Outer narrow-band distance for SDF generation [m].
+
+ Written to ``newton:sdfNarrowBandOuter`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ sdf_target_voxel_size: float | None = None
+ """Target SDF voxel size [m].
+
+ Takes precedence over :attr:`sdf_max_resolution` in Newton's USD importer.
+ Written to ``newton:sdfTargetVoxelSize`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ sdf_texture_format: Literal["uint8", "uint16", "float32"] | None = None
+ """Subgrid texture storage format for generated SDFs.
+
+ Written to ``newton:sdfTextureFormat`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ sdf_padding: float | None = None
+ """SDF AABB padding [m].
+
+ Written to ``newton:sdfPadding`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ hydroelastic_enabled: bool | None = None
+ """Whether Newton should use SDF-based hydroelastic contacts for this shape.
+
+ Both participating collision shapes must enable hydroelastic contacts for Newton to use this
+ path. Written to ``newton:hydroelasticEnabled`` via ``NewtonSDFCollisionAPI``.
+ """
+
+ hydroelastic_stiffness: float | None = None
+ """Hydroelastic contact stiffness.
+
+ Written to ``newton:hydroelasticStiffness`` via ``NewtonSDFCollisionAPI``.
+ """
+
+
@configclass
class NewtonMaterialPropertiesCfg(RigidBodyMaterialBaseCfg):
"""Newton-specific rigid body material properties.
@@ -295,6 +502,34 @@ class NewtonMaterialPropertiesCfg(RigidBodyMaterialBaseCfg):
"""
+@configclass
+class MujocoFixedTendonCfg(FixedTendonFragment):
+ """``mjc:*`` fixed-tendon attributes for a ``MjcTendon`` prim.
+
+ The Mujoco fixed-tendon fragment. Newton has no tendon solver; this models only the ``mjc:*``
+ tune path the Newton/Mujoco importer reads from a ``MjcTendon`` prim, carrying only the fields
+ that path maps. Overrides :attr:`func` with a custom applier
+ (:func:`~isaaclab_newton.sim.schemas.apply_mujoco_fixed_tendon`) that gates on the ``MjcTendon``
+ prim type. Can be combined with :class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonCfg` in the same
+ fragment list passed to :func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties`, which
+ dispatches each fragment to its own applier independently.
+ """
+
+ # Not namespace-driven: the custom applier gates on the ``MjcTendon`` prim type and writes the
+ # ``mjc:*`` attributes itself, so ``_usd_namespace`` stays ``None`` -- this also guards against
+ # accidentally routing the fragment through the generic ``apply_namespaced``.
+ _usd_namespace: ClassVar[str | None] = None
+ _usd_applied_schema: ClassVar[str | None] = None
+
+ func: Callable | str = "isaaclab_newton.sim.schemas:apply_mujoco_fixed_tendon"
+
+ stiffness: float | None = None
+ """Spring stiffness term acting on the tendon's length [N/m]."""
+
+ damping: float | None = None
+ """Damping term acting on the tendon length [N·s/m]."""
+
+
@configclass
class NewtonArticulationRootPropertiesCfg(ArticulationRootBaseCfg):
"""Newton-specific articulation root properties.
diff --git a/source/isaaclab_newton/pyproject.toml b/source/isaaclab_newton/pyproject.toml
index 880c175855d5..579b86480c4b 100644
--- a/source/isaaclab_newton/pyproject.toml
+++ b/source/isaaclab_newton/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab_newton"
-version = "1.0.4"
+version = "1.4.0"
description = "Extension providing IsaacLab with Newton specific abstractions."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
@@ -27,7 +27,7 @@ all = [
"prettytable>=3.3.0",
"PyOpenGL-accelerate>=3.1.0",
"pyglet>=2.1.6,<3",
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
]
[tool.setuptools]
diff --git a/source/isaaclab_ov/changelog.d/jmart-cartpole-rtx.minor.rst b/source/isaaclab_ov/changelog.d/jmart-cartpole-rtx.minor.rst
deleted file mode 100644
index 86cfb672bf0b..000000000000
--- a/source/isaaclab_ov/changelog.d/jmart-cartpole-rtx.minor.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Added
-^^^^^
-
-* Overrode :meth:`provides_temporal_camera_data` on :class:`OVRTXRenderer` to return ``True``
- only for the ``rgb``/``rgba`` beauty buffer (temporally accumulated by DLSS), matching Isaac RTX;
- other AOVs return ``False``.
diff --git a/source/isaaclab_ov/config/extension.toml b/source/isaaclab_ov/config/extension.toml
index e4ec845231d9..e51701595185 100644
--- a/source/isaaclab_ov/config/extension.toml
+++ b/source/isaaclab_ov/config/extension.toml
@@ -1,5 +1,5 @@
[package]
-version = "0.4.6"
+version = "0.5.2"
title = "Omniverse renderers for IsaacLab"
description = "Extension providing Omniverse renderers (OVRTX, ovphysx, etc.) for tiled camera rendering."
readme = "docs/README.md"
diff --git a/source/isaaclab_ov/docs/CHANGELOG.rst b/source/isaaclab_ov/docs/CHANGELOG.rst
index 4307aa7707a4..aa17465a7ae9 100644
--- a/source/isaaclab_ov/docs/CHANGELOG.rst
+++ b/source/isaaclab_ov/docs/CHANGELOG.rst
@@ -1,6 +1,40 @@
Changelog
---------
+0.5.2 (2026-06-26)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added ``"normals"`` support to :class:`~isaaclab_ov.renderers.OVRTXRenderer`. The renderer now
+ declares :attr:`~isaaclab.renderers.RenderBufferKind.NORMALS` in
+ :meth:`~isaaclab_ov.renderers.OVRTXRenderer.supported_output_types` (3-channel ``float32``) and
+ extracts the ``NormalSD`` AOV from each rendered frame into the output buffer.
+
+
+0.5.1 (2026-06-25)
+~~~~~~~~~~~~~~~~~~
+
+Fixed
+^^^^^
+
+* Fixed ``distance_to_camera`` incorrectly mapping to ``DistanceToImagePlaneSD`` in the OVRTX
+ renderer backend. It now correctly uses ``DistanceToCameraSD``, matching the intended semantics
+ of eye-space ray length versus perpendicular image-plane distance.
+
+
+0.5.0 (2026-06-24)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Overrode :meth:`provides_temporal_camera_data` on :class:`OVRTXRenderer` to return ``True``
+ only for the ``rgb``/``rgba`` beauty buffer (temporally accumulated by DLSS), matching Isaac RTX;
+ other AOVs return ``False``.
+
+
0.4.6 (2026-06-16)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
index 08d5855f33cf..1a515075f52b 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
@@ -246,6 +246,7 @@ def supported_output_types(self) -> dict[RenderBufferKind, RenderBufferSpec]:
RenderBufferKind.DEPTH: RenderBufferSpec(1, wp.float32),
RenderBufferKind.DISTANCE_TO_IMAGE_PLANE: RenderBufferSpec(1, wp.float32),
RenderBufferKind.DISTANCE_TO_CAMERA: RenderBufferSpec(1, wp.float32),
+ RenderBufferKind.NORMALS: RenderBufferSpec(3, wp.float32),
}
@property
@@ -757,7 +758,7 @@ def _process_render_frame(self, render_data: OVRTXRenderData, frame, output_buff
tiled_data = wp.from_dlpack(mapping.tensor)
self._extract_rgba_tiles(render_data, tiled_data, output_buffers, buffer_key)
- for depth_var in ["DistanceToImagePlaneSD", "DepthSD"]:
+ for depth_var in ["DistanceToCameraSD", "DistanceToImagePlaneSD", "DepthSD"]:
if depth_var not in frame.render_vars:
continue
with frame.render_vars[depth_var].map(device=Device.CUDA) as mapping:
@@ -804,6 +805,22 @@ def _process_render_frame(self, render_data: OVRTXRenderData, frame, output_buff
suffix="semantic",
)
+ if "NormalSD" in frame.render_vars and "normals" in output_buffers:
+ with frame.render_vars["NormalSD"].map(device=Device.CUDA) as mapping:
+ tiled_normals_data = wp.from_dlpack(mapping.tensor)
+ wp.launch(
+ kernel=extract_all_rgb_float_tiles_kernel,
+ dim=(render_data.num_envs, render_data.height, render_data.width),
+ inputs=[
+ tiled_normals_data,
+ output_buffers["normals"],
+ render_data.num_cols,
+ render_data.width,
+ render_data.height,
+ ],
+ device=self._device,
+ )
+
def render(self, render_data: OVRTXRenderData) -> None:
"""Render the scene into the provided RenderData."""
if not self._initialized_scene:
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py
index e774703dc68f..be89987d64d0 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py
@@ -18,17 +18,24 @@
def get_render_var_config(data_types: list[str]) -> tuple[str, str, str]:
"""Return (render_var_path, render_var_name, source_name) from data_types."""
use_depth = any(dt in ["depth", "distance_to_image_plane", "distance_to_camera"] for dt in data_types)
+ use_distance_to_camera = "distance_to_camera" in data_types and not any(
+ dt in ["depth", "distance_to_image_plane"] for dt in data_types
+ )
use_albedo = "albedo" in data_types
use_semantic = "semantic_segmentation" in data_types
+ use_normals = "normals" in data_types
use_rgb = any(dt in ["rgb", "rgba"] for dt in data_types)
use_hdr = "rgb_hdr" in data_types
- if use_depth and not (use_rgb or use_albedo or use_semantic):
- return "/Render/Vars/depth", "depth", "DistanceToImagePlaneSD"
- if use_albedo and not (use_rgb or use_semantic):
+ if use_depth and not (use_rgb or use_albedo or use_semantic or use_normals):
+ source = "DistanceToCameraSD" if use_distance_to_camera else "DistanceToImagePlaneSD"
+ return "/Render/Vars/depth", "depth", source
+ if use_albedo and not (use_rgb or use_semantic or use_normals):
return "/Render/Vars/albedo", "albedo", "DiffuseAlbedoSD"
- if use_semantic and not (use_rgb or use_albedo):
+ if use_semantic and not (use_rgb or use_albedo or use_normals):
return "/Render/Vars/semantic", "semantic", "SemanticSegmentation"
+ if use_normals and not (use_rgb or use_albedo or use_semantic or use_depth):
+ return "/Render/Vars/NormalSD", "NormalSD", "NormalSD"
if use_hdr and not use_rgb:
return "/Render/Vars/HdrColor", "HdrColor", "HdrColor"
return "/Render/Vars/LdrColor", "LdrColor", "LdrColor"
diff --git a/source/isaaclab_ov/pyproject.toml b/source/isaaclab_ov/pyproject.toml
index e24cd26ee96f..3831b4bdf911 100644
--- a/source/isaaclab_ov/pyproject.toml
+++ b/source/isaaclab_ov/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab_ov"
-version = "0.4.6"
+version = "0.5.2"
description = "Extension providing Omniverse renderers (OVRTX, ovphysx, etc.) for tiled camera rendering."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
diff --git a/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py b/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py
index bb54653669b4..b1be655a42d7 100644
--- a/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py
+++ b/source/isaaclab_ov/test/test_ovrtx_renderer_contract.py
@@ -85,6 +85,7 @@ def test_ovrtx_supported_output_types_key_set():
RenderBufferKind.DEPTH,
RenderBufferKind.DISTANCE_TO_IMAGE_PLANE,
RenderBufferKind.DISTANCE_TO_CAMERA,
+ RenderBufferKind.NORMALS,
}
assert specs[RenderBufferKind.RGBA] == RenderBufferSpec(4, wp.uint8)
assert specs[RenderBufferKind.RGB_HDR] == RenderBufferSpec(3, wp.float32)
diff --git a/source/isaaclab_ovphysx/config/extension.toml b/source/isaaclab_ovphysx/config/extension.toml
index 5b9de2443339..b820371d3883 100644
--- a/source/isaaclab_ovphysx/config/extension.toml
+++ b/source/isaaclab_ovphysx/config/extension.toml
@@ -1,7 +1,7 @@
[package]
# Note: Semantic Versioning is used: https://semver.org/
-version = "3.2.0"
+version = "5.0.0"
# Description
title = "OvPhysX simulation interfaces for IsaacLab core package"
diff --git a/source/isaaclab_ovphysx/docs/CHANGELOG.rst b/source/isaaclab_ovphysx/docs/CHANGELOG.rst
index 50dfbf190400..a2e2148ebd22 100644
--- a/source/isaaclab_ovphysx/docs/CHANGELOG.rst
+++ b/source/isaaclab_ovphysx/docs/CHANGELOG.rst
@@ -1,6 +1,56 @@
Changelog
---------
+5.0.0 (2026-06-27)
+~~~~~~~~~~~~~~~~~~
+
+Changed
+^^^^^^^
+
+* **Breaking:** :attr:`~isaaclab_ovphysx.assets.Articulation.root_view` now returns an
+ :class:`~isaaclab_ovphysx.sim.views.OvPhysxView` binding manager instead of a raw
+ ``dict`` mapping ``TensorType`` to ``TensorBinding``. The view owns all tensor-binding
+ creation, caching, reads, and writes for the articulation. Address bindings by attribute
+ name or ``TensorType`` member through
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.try_binding_for` /
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.get_attribute` rather than indexing the
+ dict, e.g. replace ``root_view[tensor_type]`` with
+ ``root_view.try_binding_for(tensor_type)`` and ``tensor_type in root_view`` with
+ ``root_view.try_binding_for(tensor_type) is not None``.
+* **Breaking:** :attr:`~isaaclab_ovphysx.assets.RigidObject.root_view` now returns an
+ :class:`~isaaclab_ovphysx.sim.views.OvPhysxView` binding manager instead of a raw
+ ``dict`` mapping ``TensorType`` to ``TensorBinding``. The view owns all tensor-binding
+ creation, caching, reads, and writes for the rigid object. Replace ``root_view[tensor_type]``
+ with ``root_view.try_binding_for(tensor_type)`` /
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.get_attribute`.
+
+Fixed
+^^^^^
+
+* Fixed repeated OVPhysX articulation body-frame center-of-mass pose reads by caching them as model
+ properties and invalidating dependent buffers when center-of-mass offsets are updated.
+
+
+4.0.0 (2026-06-26)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_ovphysx.sim.views.OvPhysxView`, a string-keyed binding manager
+ over the OVPhysX tensor bindings. Attributes are addressed by the lowercased
+ ``TensorType`` name (e.g. ``view.get_attribute("articulation_dof_stiffness")``,
+ ``view.read_into("articulation_root_pose", buf)``,
+ ``view.set_attribute("rigid_body_pose", values, mask=...)``), bringing the OVPhysX
+ binding surface closer to the Newton selection API. The view reads/writes each binding
+ on its native device and raises on a device mismatch rather than staging between CPU
+ and GPU. :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.get_attribute` returns a typed
+ array for attributes with a structured layout (e.g. ``wp.transformf`` for poses,
+ ``wp.spatial_vectorf`` for velocities) and flat ``float32`` otherwise, and
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.read_into` reuses the ``float32``
+ reinterpret of a destination buffer across calls so the wheel's read cache stays warm.
+
+
3.2.0 (2026-06-23)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py
index e61bec9b7381..1c7566a55aeb 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py
@@ -32,6 +32,7 @@
from isaaclab_ovphysx.assets.kernels import _body_wrench_to_world
from isaaclab_ovphysx.cloner import queue_ovphysx_replication
from isaaclab_ovphysx.physics import OvPhysxManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .articulation_data import ArticulationData
from .kernels import (
@@ -86,9 +87,9 @@ def __init__(self, cfg: ArticulationCfg):
"""
super().__init__(cfg)
queue_ovphysx_replication(cfg)
- # bindings are populated eagerly in ``_initialize_impl``; the dict
- # also caches any tensor type the user explicitly queries later
- self._bindings: dict[int, Any] = {}
+ # the binding manager is created in ``_initialize_impl``; it owns all
+ # TensorBinding creation, caching, and the CPU/GPU device policy.
+ self._root_view: OvPhysxView | None = None
"""
Properties
@@ -148,20 +149,23 @@ def body_names(self) -> list[str]:
return self._body_names
@property
- def root_view(self) -> dict[int, Any]:
+ def root_view(self) -> OvPhysxView:
"""Root view for the asset.
- OVPhysX exposes per-tensor-type bindings rather than a single opaque view object
- as used by the PhysX and Newton backends. Callers that need low-level binding
- access should call :meth:`_get_binding` rather than iterating this dict directly.
- For high-level state access (instance counts, prim paths, transforms), use the
- :attr:`num_instances`, :attr:`body_names`, and :attr:`~ArticulationData.root_link_pose_w`
- accessors instead.
+ On OVPhysX this is an :class:`~isaaclab_ovphysx.sim.views.OvPhysxView`: a
+ string-keyed binding manager over the per-tensor-type ``TensorBinding`` handles,
+ rather than the single opaque view object used by the PhysX and Newton backends.
+ Address attributes by their lowercased ``TensorType`` name (e.g.
+ ``root_view.get_attribute("articulation_dof_stiffness")``) or by the
+ :class:`~isaaclab_ovphysx.tensor_types.TensorType` member itself. For high-level
+ state access (instance counts, prim paths, transforms), prefer the
+ :attr:`num_instances`, :attr:`body_names`, and
+ :attr:`~ArticulationData.root_link_pose_w` accessors instead.
.. note::
Use this view with caution. It requires handling of tensors in a specific way.
"""
- return self._bindings
+ return self._root_view
@property
def instantaneous_wrench_composer(self) -> WrenchComposer:
@@ -238,22 +242,21 @@ def write_data_to_sim(self) -> None:
outputs=[self._wrench_buf],
device=self._device,
)
- binding = self._get_binding(TT.LINK_WRENCH)
- if binding is not None:
- binding.write(self._wrench_buf)
+ if self._get_binding(TT.LINK_WRENCH) is not None:
+ self._root_view.set_attribute(TT.LINK_WRENCH, self._wrench_buf)
inst.reset()
# apply actuator models
self._apply_actuator_model()
# write actions into simulation (zeros are safe when no actuators are active)
- if self._effort_binding is not None:
- self._effort_binding.write(self._effort_write_view)
+ if self._effort_write_view is not None:
+ self._root_view.set_attribute(TT.DOF_ACTUATION_FORCE, self._effort_write_view)
# position and velocity targets only for implicit actuators
if self._has_implicit_actuators:
- if self._pos_target_binding is not None:
- self._pos_target_binding.write(self._pos_target_write_view)
- if self._vel_target_binding is not None:
- self._vel_target_binding.write(self._vel_target_write_view)
+ if self._pos_target_write_view is not None:
+ self._root_view.set_attribute(TT.DOF_POSITION_TARGET, self._pos_target_write_view)
+ if self._vel_target_write_view is not None:
+ self._root_view.set_attribute(TT.DOF_VELOCITY_TARGET, self._vel_target_write_view)
def update(self, dt: float) -> None:
"""Updates the simulation data.
@@ -452,8 +455,7 @@ def write_root_link_pose_to_sim_index(
# Let the data class handle the invalidation of pose-dependent properties.
if not skip_forward:
self.data._reset_pose()
- binding = self._get_binding(TT.ROOT_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(TT.ROOT_POSE, self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids)
def write_root_link_pose_to_sim_mask(
self,
@@ -492,8 +494,7 @@ def write_root_link_pose_to_sim_mask(
# Let the data class handle the invalidation of pose-dependent properties.
if not skip_forward:
self.data._reset_pose()
- binding = self._get_binding(TT.ROOT_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(TT.ROOT_POSE, self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp)
def write_root_com_pose_to_sim_index(
self,
@@ -533,8 +534,7 @@ def write_root_com_pose_to_sim_index(
# Let the data class handle the invalidation of pose-dependent properties.
if not skip_forward:
self.data._reset_pose(from_link=False)
- binding = self._get_binding(TT.ROOT_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(TT.ROOT_POSE, self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids)
def write_root_com_pose_to_sim_mask(
self,
@@ -574,8 +574,7 @@ def write_root_com_pose_to_sim_mask(
# Let the data class handle the invalidation of pose-dependent properties.
if not skip_forward:
self.data._reset_pose(from_link=False)
- binding = self._get_binding(TT.ROOT_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(TT.ROOT_POSE, self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp)
def write_root_velocity_to_sim_index(
self,
@@ -676,8 +675,9 @@ def write_root_com_velocity_to_sim_index(
# Let the data class handle the invalidation of velocity-dependent properties.
if not skip_forward:
self.data._reset_velocity()
- binding = self._get_binding(TT.ROOT_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(
+ TT.ROOT_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids
+ )
def write_root_com_velocity_to_sim_mask(
self,
@@ -719,8 +719,9 @@ def write_root_com_velocity_to_sim_mask(
# Let the data class handle the invalidation of velocity-dependent properties.
if not skip_forward:
self.data._reset_velocity()
- binding = self._get_binding(TT.ROOT_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.ROOT_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp
+ )
def write_root_link_velocity_to_sim_index(
self,
@@ -768,8 +769,9 @@ def write_root_link_velocity_to_sim_index(
# Let the data class handle the invalidation of velocity-dependent properties.
if not skip_forward:
self.data._reset_velocity(from_com=False)
- binding = self._get_binding(TT.ROOT_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(
+ TT.ROOT_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids
+ )
def write_root_link_velocity_to_sim_mask(
self,
@@ -817,8 +819,9 @@ def write_root_link_velocity_to_sim_mask(
# Let the data class handle the invalidation of velocity-dependent properties.
if not skip_forward:
self.data._reset_velocity(from_com=False)
- binding = self._get_binding(TT.ROOT_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.ROOT_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp
+ )
def write_joint_position_to_sim_index(
self,
@@ -861,8 +864,7 @@ def write_joint_position_to_sim_index(
if not skip_forward:
self._data._reset_pose()
self._data._reset_velocity()
- binding = self._get_binding(TT.DOF_POSITION)
- binding.write(self._data._joint_pos_buf.data, indices=env_ids)
+ self._root_view.set_attribute(TT.DOF_POSITION, self._data._joint_pos_buf.data, indices=env_ids)
def write_joint_position_to_sim_mask(
self,
@@ -907,8 +909,7 @@ def write_joint_position_to_sim_mask(
if not skip_forward:
self._data._reset_pose()
self._data._reset_velocity()
- binding = self._get_binding(TT.DOF_POSITION)
- binding.write(self._data._joint_pos_buf.data, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.DOF_POSITION, self._data._joint_pos_buf.data, mask=env_mask_wp)
def write_joint_velocity_to_sim_index(
self,
@@ -967,8 +968,7 @@ def write_joint_velocity_to_sim_index(
self._data._joint_acc.timestamp = self._data._sim_timestamp
if not skip_forward:
self._data._reset_velocity()
- binding = self._get_binding(TT.DOF_VELOCITY)
- binding.write(self._data._joint_vel_buf.data, indices=env_ids)
+ self._root_view.set_attribute(TT.DOF_VELOCITY, self._data._joint_vel_buf.data, indices=env_ids)
def write_joint_velocity_to_sim_mask(
self,
@@ -1029,8 +1029,7 @@ def write_joint_velocity_to_sim_mask(
self._data._joint_acc.timestamp = self._data._sim_timestamp
if not skip_forward:
self._data._reset_velocity()
- binding = self._get_binding(TT.DOF_VELOCITY)
- binding.write(self._data._joint_vel_buf.data, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.DOF_VELOCITY, self._data._joint_vel_buf.data, mask=env_mask_wp)
def write_joint_state_to_sim_mask(
self,
@@ -1120,8 +1119,7 @@ def write_joint_stiffness_to_sim_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_joint_stiffness, self._data._joint_stiffness.data)
- binding = self._get_binding(TT.DOF_STIFFNESS)
- binding.write(self.data._cpu_joint_stiffness, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_STIFFNESS, self.data._cpu_joint_stiffness, indices=cpu_env_ids)
def write_joint_stiffness_to_sim_mask(
self,
@@ -1164,8 +1162,9 @@ def write_joint_stiffness_to_sim_mask(
device=self._device,
)
wp.copy(self.data._cpu_joint_stiffness, self._data._joint_stiffness.data)
- binding = self._get_binding(TT.DOF_STIFFNESS)
- binding.write(self.data._cpu_joint_stiffness, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_STIFFNESS, self.data._cpu_joint_stiffness, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_damping_to_sim_index(
self,
@@ -1208,8 +1207,7 @@ def write_joint_damping_to_sim_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_joint_damping, self._data._joint_damping.data)
- binding = self._get_binding(TT.DOF_DAMPING)
- binding.write(self.data._cpu_joint_damping, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_DAMPING, self.data._cpu_joint_damping, indices=cpu_env_ids)
def write_joint_damping_to_sim_mask(
self,
@@ -1252,8 +1250,9 @@ def write_joint_damping_to_sim_mask(
device=self._device,
)
wp.copy(self.data._cpu_joint_damping, self._data._joint_damping.data)
- binding = self._get_binding(TT.DOF_DAMPING)
- binding.write(self.data._cpu_joint_damping, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_DAMPING, self.data._cpu_joint_damping, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_position_limit_to_sim_index(
self,
@@ -1352,8 +1351,7 @@ def write_joint_position_limit_to_sim_index(
copy=False,
)
wp.copy(self.data._cpu_joint_position_limit, flat_src)
- binding = self._get_binding(TT.DOF_LIMIT)
- binding.write(self.data._cpu_joint_position_limit, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_LIMIT, self.data._cpu_joint_position_limit, indices=cpu_env_ids)
def write_joint_position_limit_to_sim_mask(
self,
@@ -1449,8 +1447,9 @@ def write_joint_position_limit_to_sim_mask(
copy=False,
)
wp.copy(self.data._cpu_joint_position_limit, flat_src)
- binding = self._get_binding(TT.DOF_LIMIT)
- binding.write(self.data._cpu_joint_position_limit, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_LIMIT, self.data._cpu_joint_position_limit, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_velocity_limit_to_sim_index(
self,
@@ -1493,8 +1492,7 @@ def write_joint_velocity_limit_to_sim_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_joint_velocity_limit, self._data._joint_vel_limits.data)
- binding = self._get_binding(TT.DOF_MAX_VELOCITY)
- binding.write(self.data._cpu_joint_velocity_limit, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_MAX_VELOCITY, self.data._cpu_joint_velocity_limit, indices=cpu_env_ids)
def write_joint_velocity_limit_to_sim_mask(
self,
@@ -1537,8 +1535,9 @@ def write_joint_velocity_limit_to_sim_mask(
device=self._device,
)
wp.copy(self.data._cpu_joint_velocity_limit, self._data._joint_vel_limits.data)
- binding = self._get_binding(TT.DOF_MAX_VELOCITY)
- binding.write(self.data._cpu_joint_velocity_limit, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_MAX_VELOCITY, self.data._cpu_joint_velocity_limit, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_effort_limit_to_sim_index(
self,
@@ -1581,8 +1580,7 @@ def write_joint_effort_limit_to_sim_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_joint_effort_limit, self._data._joint_effort_limits.data)
- binding = self._get_binding(TT.DOF_MAX_FORCE)
- binding.write(self.data._cpu_joint_effort_limit, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_MAX_FORCE, self.data._cpu_joint_effort_limit, indices=cpu_env_ids)
def write_joint_effort_limit_to_sim_mask(
self,
@@ -1625,8 +1623,9 @@ def write_joint_effort_limit_to_sim_mask(
device=self._device,
)
wp.copy(self.data._cpu_joint_effort_limit, self._data._joint_effort_limits.data)
- binding = self._get_binding(TT.DOF_MAX_FORCE)
- binding.write(self.data._cpu_joint_effort_limit, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_MAX_FORCE, self.data._cpu_joint_effort_limit, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_armature_to_sim_index(
self,
@@ -1669,8 +1668,7 @@ def write_joint_armature_to_sim_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_joint_armature, self._data._joint_armature.data)
- binding = self._get_binding(TT.DOF_ARMATURE)
- binding.write(self.data._cpu_joint_armature, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_ARMATURE, self.data._cpu_joint_armature, indices=cpu_env_ids)
def write_joint_armature_to_sim_mask(
self,
@@ -1713,8 +1711,9 @@ def write_joint_armature_to_sim_mask(
device=self._device,
)
wp.copy(self.data._cpu_joint_armature, self._data._joint_armature.data)
- binding = self._get_binding(TT.DOF_ARMATURE)
- binding.write(self.data._cpu_joint_armature, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_ARMATURE, self.data._cpu_joint_armature, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_friction_coefficient_to_sim_index(
self,
@@ -1788,8 +1787,7 @@ def write_joint_friction_coefficient_to_sim_index(
cpu_friction = self._data._stage_to_pinned_cpu(
TT.DOF_FRICTION_PROPERTIES, "write", self._data._joint_friction_props_buf.data
)
- binding = self._get_binding(TT.DOF_FRICTION_PROPERTIES)
- binding.write(cpu_friction, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_FRICTION_PROPERTIES, cpu_friction, indices=cpu_env_ids)
def write_joint_friction_coefficient_to_sim_mask(
self,
@@ -1841,8 +1839,9 @@ def write_joint_friction_coefficient_to_sim_mask(
cpu_friction = self._data._stage_to_pinned_cpu(
TT.DOF_FRICTION_PROPERTIES, "write", self._data._joint_friction_props_buf.data
)
- binding = self._get_binding(TT.DOF_FRICTION_PROPERTIES)
- binding.write(cpu_friction, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_FRICTION_PROPERTIES, cpu_friction, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_dynamic_friction_coefficient_to_sim_index(
self,
@@ -1902,8 +1901,7 @@ def write_joint_dynamic_friction_coefficient_to_sim_index(
cpu_friction = self._data._stage_to_pinned_cpu(
TT.DOF_FRICTION_PROPERTIES, "write", self._data._joint_friction_props_buf.data
)
- binding = self._get_binding(TT.DOF_FRICTION_PROPERTIES)
- binding.write(cpu_friction, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_FRICTION_PROPERTIES, cpu_friction, indices=cpu_env_ids)
def write_joint_dynamic_friction_coefficient_to_sim_mask(
self,
@@ -1947,8 +1945,9 @@ def write_joint_dynamic_friction_coefficient_to_sim_mask(
cpu_friction = self._data._stage_to_pinned_cpu(
TT.DOF_FRICTION_PROPERTIES, "write", self._data._joint_friction_props_buf.data
)
- binding = self._get_binding(TT.DOF_FRICTION_PROPERTIES)
- binding.write(cpu_friction, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_FRICTION_PROPERTIES, cpu_friction, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def write_joint_viscous_friction_coefficient_to_sim_index(
self,
@@ -2009,8 +2008,7 @@ def write_joint_viscous_friction_coefficient_to_sim_index(
cpu_friction = self._data._stage_to_pinned_cpu(
TT.DOF_FRICTION_PROPERTIES, "write", self._data._joint_friction_props_buf.data
)
- binding = self._get_binding(TT.DOF_FRICTION_PROPERTIES)
- binding.write(cpu_friction, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.DOF_FRICTION_PROPERTIES, cpu_friction, indices=cpu_env_ids)
def write_joint_viscous_friction_coefficient_to_sim_mask(
self,
@@ -2055,8 +2053,9 @@ def write_joint_viscous_friction_coefficient_to_sim_mask(
cpu_friction = self._data._stage_to_pinned_cpu(
TT.DOF_FRICTION_PROPERTIES, "write", self._data._joint_friction_props_buf.data
)
- binding = self._get_binding(TT.DOF_FRICTION_PROPERTIES)
- binding.write(cpu_friction, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.DOF_FRICTION_PROPERTIES, cpu_friction, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
"""
Operations - Setters.
@@ -2100,8 +2099,7 @@ def set_masses_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_body_mass, self._data._body_mass.data)
- binding = self._get_binding(TT.BODY_MASS)
- binding.write(self.data._cpu_body_mass, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.BODY_MASS, self.data._cpu_body_mass, indices=cpu_env_ids)
def set_masses_mask(
self,
@@ -2142,8 +2140,7 @@ def set_masses_mask(
device=self._device,
)
wp.copy(self.data._cpu_body_mass, self._data._body_mass.data)
- binding = self._get_binding(TT.BODY_MASS)
- binding.write(self.data._cpu_body_mass, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(TT.BODY_MASS, self.data._cpu_body_mass, mask=self._get_cpu_env_mask(env_mask_wp))
def set_coms_index(
self,
@@ -2181,13 +2178,11 @@ def set_coms_index(
outputs=[self._data._body_com_pose_b.data],
device=self._device,
)
- # Invalidate derived buffers that depend on body_com_pose_b.
- self.data._root_com_pose_w.timestamp = -1.0
- self.data._body_com_pose_w.timestamp = -1.0
+ self._data._body_com_pose_b.timestamp = self._data._sim_timestamp
+ self._data._reset_body_com_pose_b_dependents()
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_body_coms, self._data._body_com_pose_b.data)
- binding = self._get_binding(TT.BODY_COM_POSE)
- binding.write(self.data._cpu_body_coms, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.BODY_COM_POSE, self.data._cpu_body_coms, indices=cpu_env_ids)
def set_coms_mask(
self,
@@ -2227,12 +2222,12 @@ def set_coms_mask(
outputs=[self._data._body_com_pose_b.data],
device=self._device,
)
- # Invalidate derived buffers that depend on body_com_pose_b.
- self.data._root_com_pose_w.timestamp = -1.0
- self.data._body_com_pose_w.timestamp = -1.0
+ self._data._body_com_pose_b.timestamp = self._data._sim_timestamp
+ self._data._reset_body_com_pose_b_dependents()
wp.copy(self.data._cpu_body_coms, self._data._body_com_pose_b.data)
- binding = self._get_binding(TT.BODY_COM_POSE)
- binding.write(self.data._cpu_body_coms, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.BODY_COM_POSE, self.data._cpu_body_coms, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def set_inertias_index(
self,
@@ -2272,8 +2267,7 @@ def set_inertias_index(
)
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self.data._cpu_body_inertia, self._data._body_inertia.data)
- binding = self._get_binding(TT.BODY_INERTIA)
- binding.write(self.data._cpu_body_inertia, indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.BODY_INERTIA, self.data._cpu_body_inertia, indices=cpu_env_ids)
def set_inertias_mask(
self,
@@ -2314,8 +2308,9 @@ def set_inertias_mask(
device=self._device,
)
wp.copy(self.data._cpu_body_inertia, self._data._body_inertia.data)
- binding = self._get_binding(TT.BODY_INERTIA)
- binding.write(self.data._cpu_body_inertia, mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.BODY_INERTIA, self.data._cpu_body_inertia, mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def set_joint_position_target_index(
self,
@@ -2354,8 +2349,7 @@ def set_joint_position_target_index(
outputs=[self._data._joint_pos_target],
device=self._device,
)
- binding = self._get_binding(TT.DOF_POSITION_TARGET)
- binding.write(self._data._joint_pos_target, indices=env_ids)
+ self._root_view.set_attribute(TT.DOF_POSITION_TARGET, self._data._joint_pos_target, indices=env_ids)
def set_joint_position_target_mask(
self,
@@ -2391,8 +2385,7 @@ def set_joint_position_target_mask(
outputs=[self._data._joint_pos_target],
device=self._device,
)
- binding = self._get_binding(TT.DOF_POSITION_TARGET)
- binding.write(self._data._joint_pos_target, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.DOF_POSITION_TARGET, self._data._joint_pos_target, mask=env_mask_wp)
def set_joint_velocity_target_index(
self,
@@ -2431,8 +2424,7 @@ def set_joint_velocity_target_index(
outputs=[self._data._joint_vel_target],
device=self._device,
)
- binding = self._get_binding(TT.DOF_VELOCITY_TARGET)
- binding.write(self._data._joint_vel_target, indices=env_ids)
+ self._root_view.set_attribute(TT.DOF_VELOCITY_TARGET, self._data._joint_vel_target, indices=env_ids)
def set_joint_velocity_target_mask(
self,
@@ -2468,8 +2460,7 @@ def set_joint_velocity_target_mask(
outputs=[self._data._joint_vel_target],
device=self._device,
)
- binding = self._get_binding(TT.DOF_VELOCITY_TARGET)
- binding.write(self._data._joint_vel_target, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.DOF_VELOCITY_TARGET, self._data._joint_vel_target, mask=env_mask_wp)
def set_joint_effort_target_index(
self,
@@ -2508,8 +2499,7 @@ def set_joint_effort_target_index(
outputs=[self._data._joint_effort_target],
device=self._device,
)
- binding = self._get_binding(TT.DOF_ACTUATION_FORCE)
- binding.write(self._data._joint_effort_target, indices=env_ids)
+ self._root_view.set_attribute(TT.DOF_ACTUATION_FORCE, self._data._joint_effort_target, indices=env_ids)
def set_joint_effort_target_mask(
self,
@@ -2545,8 +2535,7 @@ def set_joint_effort_target_mask(
outputs=[self._data._joint_effort_target],
device=self._device,
)
- binding = self._get_binding(TT.DOF_ACTUATION_FORCE)
- binding.write(self._data._joint_effort_target, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.DOF_ACTUATION_FORCE, self._data._joint_effort_target, mask=env_mask_wp)
"""
Operations - Tendons.
@@ -2591,8 +2580,9 @@ def set_fixed_tendon_stiffness_index(
outputs=[self._data._fixed_tendon_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_STIFFNESS)
- binding.write(self._data._fixed_tendon_stiffness.data, indices=env_ids)
+ self._root_view.set_attribute(
+ TT.FIXED_TENDON_STIFFNESS, self._data._fixed_tendon_stiffness.data, indices=env_ids
+ )
def set_fixed_tendon_stiffness_mask(
self,
@@ -2635,8 +2625,9 @@ def set_fixed_tendon_stiffness_mask(
outputs=[self._data._fixed_tendon_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_STIFFNESS)
- binding.write(self._data._fixed_tendon_stiffness.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.FIXED_TENDON_STIFFNESS, self._data._fixed_tendon_stiffness.data, mask=env_mask_wp
+ )
def set_fixed_tendon_damping_index(
self,
@@ -2677,8 +2668,7 @@ def set_fixed_tendon_damping_index(
outputs=[self._data._fixed_tendon_damping.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_DAMPING)
- binding.write(self._data._fixed_tendon_damping.data, indices=env_ids)
+ self._root_view.set_attribute(TT.FIXED_TENDON_DAMPING, self._data._fixed_tendon_damping.data, indices=env_ids)
def set_fixed_tendon_damping_mask(
self,
@@ -2721,8 +2711,7 @@ def set_fixed_tendon_damping_mask(
outputs=[self._data._fixed_tendon_damping.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_DAMPING)
- binding.write(self._data._fixed_tendon_damping.data, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.FIXED_TENDON_DAMPING, self._data._fixed_tendon_damping.data, mask=env_mask_wp)
def set_fixed_tendon_limit_stiffness_index(
self,
@@ -2763,8 +2752,9 @@ def set_fixed_tendon_limit_stiffness_index(
outputs=[self._data._fixed_tendon_limit_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_LIMIT_STIFFNESS)
- binding.write(self._data._fixed_tendon_limit_stiffness.data, indices=env_ids)
+ self._root_view.set_attribute(
+ TT.FIXED_TENDON_LIMIT_STIFFNESS, self._data._fixed_tendon_limit_stiffness.data, indices=env_ids
+ )
def set_fixed_tendon_limit_stiffness_mask(
self,
@@ -2807,8 +2797,9 @@ def set_fixed_tendon_limit_stiffness_mask(
outputs=[self._data._fixed_tendon_limit_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_LIMIT_STIFFNESS)
- binding.write(self._data._fixed_tendon_limit_stiffness.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.FIXED_TENDON_LIMIT_STIFFNESS, self._data._fixed_tendon_limit_stiffness.data, mask=env_mask_wp
+ )
def set_fixed_tendon_position_limit_index(
self,
@@ -2855,8 +2846,7 @@ def set_fixed_tendon_position_limit_index(
device=self._device,
copy=False,
)
- binding = self._get_binding(TT.FIXED_TENDON_LIMIT)
- binding.write(flat_src, indices=env_ids)
+ self._root_view.set_attribute(TT.FIXED_TENDON_LIMIT, flat_src, indices=env_ids)
def set_fixed_tendon_position_limit_mask(
self,
@@ -2903,8 +2893,7 @@ def set_fixed_tendon_position_limit_mask(
device=self._device,
copy=False,
)
- binding = self._get_binding(TT.FIXED_TENDON_LIMIT)
- binding.write(flat_src, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.FIXED_TENDON_LIMIT, flat_src, mask=env_mask_wp)
def set_fixed_tendon_rest_length_index(
self,
@@ -2945,8 +2934,9 @@ def set_fixed_tendon_rest_length_index(
outputs=[self._data._fixed_tendon_rest_length.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_REST_LENGTH)
- binding.write(self._data._fixed_tendon_rest_length.data, indices=env_ids)
+ self._root_view.set_attribute(
+ TT.FIXED_TENDON_REST_LENGTH, self._data._fixed_tendon_rest_length.data, indices=env_ids
+ )
def set_fixed_tendon_rest_length_mask(
self,
@@ -2989,8 +2979,9 @@ def set_fixed_tendon_rest_length_mask(
outputs=[self._data._fixed_tendon_rest_length.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_REST_LENGTH)
- binding.write(self._data._fixed_tendon_rest_length.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.FIXED_TENDON_REST_LENGTH, self._data._fixed_tendon_rest_length.data, mask=env_mask_wp
+ )
def set_fixed_tendon_offset_index(
self,
@@ -3031,8 +3022,7 @@ def set_fixed_tendon_offset_index(
outputs=[self._data._fixed_tendon_offset.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_OFFSET)
- binding.write(self._data._fixed_tendon_offset.data, indices=env_ids)
+ self._root_view.set_attribute(TT.FIXED_TENDON_OFFSET, self._data._fixed_tendon_offset.data, indices=env_ids)
def set_fixed_tendon_offset_mask(
self,
@@ -3075,8 +3065,7 @@ def set_fixed_tendon_offset_mask(
outputs=[self._data._fixed_tendon_offset.data],
device=self._device,
)
- binding = self._get_binding(TT.FIXED_TENDON_OFFSET)
- binding.write(self._data._fixed_tendon_offset.data, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.FIXED_TENDON_OFFSET, self._data._fixed_tendon_offset.data, mask=env_mask_wp)
def write_fixed_tendon_properties_to_sim_index(
self,
@@ -3108,9 +3097,8 @@ def write_fixed_tendon_properties_to_sim_index(
(TT.FIXED_TENDON_REST_LENGTH, self._data._fixed_tendon_rest_length),
(TT.FIXED_TENDON_OFFSET, self._data._fixed_tendon_offset),
):
- binding = self._get_binding(tt)
- if binding is not None:
- binding.write(buf.data, indices=env_ids)
+ if self._get_binding(tt) is not None:
+ self._root_view.set_attribute(tt, buf.data, indices=env_ids)
# Position-limit binding consumes a flat (N, T, 2) float32 view.
binding = self._get_binding(TT.FIXED_TENDON_LIMIT)
if binding is not None:
@@ -3121,7 +3109,7 @@ def write_fixed_tendon_properties_to_sim_index(
device=self._device,
copy=False,
)
- binding.write(flat_src, indices=env_ids)
+ self._root_view.set_attribute(TT.FIXED_TENDON_LIMIT, flat_src, indices=env_ids)
def write_fixed_tendon_properties_to_sim_mask(
self,
@@ -3143,9 +3131,8 @@ def write_fixed_tendon_properties_to_sim_mask(
(TT.FIXED_TENDON_REST_LENGTH, self._data._fixed_tendon_rest_length),
(TT.FIXED_TENDON_OFFSET, self._data._fixed_tendon_offset),
):
- binding = self._get_binding(tt)
- if binding is not None:
- binding.write(buf.data, mask=env_mask_wp)
+ if self._get_binding(tt) is not None:
+ self._root_view.set_attribute(tt, buf.data, mask=env_mask_wp)
binding = self._get_binding(TT.FIXED_TENDON_LIMIT)
if binding is not None:
flat_src = wp.array(
@@ -3155,7 +3142,7 @@ def write_fixed_tendon_properties_to_sim_mask(
device=self._device,
copy=False,
)
- binding.write(flat_src, mask=env_mask_wp)
+ self._root_view.set_attribute(TT.FIXED_TENDON_LIMIT, flat_src, mask=env_mask_wp)
def set_spatial_tendon_stiffness_index(
self,
@@ -3197,8 +3184,9 @@ def set_spatial_tendon_stiffness_index(
outputs=[self._data._spatial_tendon_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_STIFFNESS)
- binding.write(self._data._spatial_tendon_stiffness.data, indices=env_ids)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_STIFFNESS, self._data._spatial_tendon_stiffness.data, indices=env_ids
+ )
def set_spatial_tendon_stiffness_mask(
self,
@@ -3241,8 +3229,9 @@ def set_spatial_tendon_stiffness_mask(
outputs=[self._data._spatial_tendon_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_STIFFNESS)
- binding.write(self._data._spatial_tendon_stiffness.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_STIFFNESS, self._data._spatial_tendon_stiffness.data, mask=env_mask_wp
+ )
def set_spatial_tendon_damping_index(
self,
@@ -3281,8 +3270,9 @@ def set_spatial_tendon_damping_index(
outputs=[self._data._spatial_tendon_damping.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_DAMPING)
- binding.write(self._data._spatial_tendon_damping.data, indices=env_ids)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_DAMPING, self._data._spatial_tendon_damping.data, indices=env_ids
+ )
def set_spatial_tendon_damping_mask(
self,
@@ -3325,8 +3315,9 @@ def set_spatial_tendon_damping_mask(
outputs=[self._data._spatial_tendon_damping.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_DAMPING)
- binding.write(self._data._spatial_tendon_damping.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_DAMPING, self._data._spatial_tendon_damping.data, mask=env_mask_wp
+ )
def set_spatial_tendon_limit_stiffness_index(
self,
@@ -3369,8 +3360,9 @@ def set_spatial_tendon_limit_stiffness_index(
outputs=[self._data._spatial_tendon_limit_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_LIMIT_STIFFNESS)
- binding.write(self._data._spatial_tendon_limit_stiffness.data, indices=env_ids)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_LIMIT_STIFFNESS, self._data._spatial_tendon_limit_stiffness.data, indices=env_ids
+ )
def set_spatial_tendon_limit_stiffness_mask(
self,
@@ -3413,8 +3405,9 @@ def set_spatial_tendon_limit_stiffness_mask(
outputs=[self._data._spatial_tendon_limit_stiffness.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_LIMIT_STIFFNESS)
- binding.write(self._data._spatial_tendon_limit_stiffness.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_LIMIT_STIFFNESS, self._data._spatial_tendon_limit_stiffness.data, mask=env_mask_wp
+ )
def set_spatial_tendon_offset_index(
self,
@@ -3455,8 +3448,7 @@ def set_spatial_tendon_offset_index(
outputs=[self._data._spatial_tendon_offset.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_OFFSET)
- binding.write(self._data._spatial_tendon_offset.data, indices=env_ids)
+ self._root_view.set_attribute(TT.SPATIAL_TENDON_OFFSET, self._data._spatial_tendon_offset.data, indices=env_ids)
def set_spatial_tendon_offset_mask(
self,
@@ -3499,8 +3491,9 @@ def set_spatial_tendon_offset_mask(
outputs=[self._data._spatial_tendon_offset.data],
device=self._device,
)
- binding = self._get_binding(TT.SPATIAL_TENDON_OFFSET)
- binding.write(self._data._spatial_tendon_offset.data, mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.SPATIAL_TENDON_OFFSET, self._data._spatial_tendon_offset.data, mask=env_mask_wp
+ )
def write_spatial_tendon_properties_to_sim_index(
self,
@@ -3527,9 +3520,8 @@ def write_spatial_tendon_properties_to_sim_index(
(TT.SPATIAL_TENDON_LIMIT_STIFFNESS, self._data._spatial_tendon_limit_stiffness),
(TT.SPATIAL_TENDON_OFFSET, self._data._spatial_tendon_offset),
):
- binding = self._get_binding(tt)
- if binding is not None:
- binding.write(buf.data, indices=env_ids)
+ if self._get_binding(tt) is not None:
+ self._root_view.set_attribute(tt, buf.data, indices=env_ids)
def write_spatial_tendon_properties_to_sim_mask(
self,
@@ -3545,9 +3537,8 @@ def write_spatial_tendon_properties_to_sim_mask(
(TT.SPATIAL_TENDON_LIMIT_STIFFNESS, self._data._spatial_tendon_limit_stiffness),
(TT.SPATIAL_TENDON_OFFSET, self._data._spatial_tendon_offset),
):
- binding = self._get_binding(tt)
- if binding is not None:
- binding.write(buf.data, mask=env_mask_wp)
+ if self._get_binding(tt) is not None:
+ self._root_view.set_attribute(tt, buf.data, mask=env_mask_wp)
"""
Internal helper.
@@ -3610,33 +3601,33 @@ def has_articulation_root_api(prim) -> bool:
TT.BODY_COM_POSE,
TT.BODY_INERTIA,
]
+ self._root_view = OvPhysxView(self._ovphysx, pattern=pattern, device=self._device)
+ # ``try_binding_for`` creates and caches each binding, returning ``None`` for tensor
+ # types that do not apply to these prims (so a minimal articulation that lacks some
+ # of these types is skipped rather than failing the whole init).
for tt in eager_types:
- try:
- self._bindings[tt] = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=tt)
- except Exception:
- logger.debug("Could not create tensor binding for type %s on pattern %s", tt, pattern)
+ self._root_view.try_binding_for(tt)
- if not self._bindings:
+ if not self._root_view.available_attributes:
raise RuntimeError(
f"OVPhysX could not create any articulation bindings for pattern {pattern!r}. "
f"Check that prim_path={self.cfg.prim_path!r} matches at least one "
"UsdPhysics.ArticulationRootAPI prim."
)
- # read metadata from the first available binding
- sample = next(iter(self._bindings.values()))
- self._num_instances = sample.count
- self._num_joints = sample.dof_count
- self._num_bodies = sample.body_count
- self._is_fixed_base = sample.is_fixed_base
- self._joint_names = list(sample.dof_names)
- self._body_names = list(sample.body_names)
+ # read metadata from the view (any instantiated binding carries it)
+ self._num_instances = self._root_view.count
+ self._num_joints = self._root_view.dof_count
+ self._num_bodies = self._root_view.body_count
+ self._is_fixed_base = self._root_view.is_fixed_base
+ self._joint_names = list(self._root_view.dof_names)
+ self._body_names = list(self._root_view.body_names)
# tendon counts/names must be resolved before buffer allocation
self._process_tendons()
- # eagerly create tendon bindings now that the counts are known; this keeps
- # ArticulationData's _get_binding a simple dict lookup (no lazy callback).
+ # eagerly create tendon bindings now that the counts are known, through the same
+ # view, so ArticulationData reads them via a cached lookup (no lazy callback).
if self._num_fixed_tendons > 0:
for tt in (
TT.FIXED_TENDON_STIFFNESS,
@@ -3646,10 +3637,7 @@ def has_articulation_root_api(prim) -> bool:
TT.FIXED_TENDON_REST_LENGTH,
TT.FIXED_TENDON_OFFSET,
):
- try:
- self._bindings[tt] = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=tt)
- except Exception:
- logger.debug("Could not create tensor binding for type %s on pattern %s", tt, pattern)
+ self._root_view.try_binding_for(tt)
if self._num_spatial_tendons > 0:
for tt in (
TT.SPATIAL_TENDON_STIFFNESS,
@@ -3657,13 +3645,10 @@ def has_articulation_root_api(prim) -> bool:
TT.SPATIAL_TENDON_LIMIT_STIFFNESS,
TT.SPATIAL_TENDON_OFFSET,
):
- try:
- self._bindings[tt] = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=tt)
- except Exception:
- logger.debug("Could not create tensor binding for type %s on pattern %s", tt, pattern)
+ self._root_view.try_binding_for(tt)
- # construct the data container; counts come from the bindings
- self._data = ArticulationData(self._bindings, self._device)
+ # construct the data container; counts come from the view's bindings
+ self._data = ArticulationData(self._root_view, self._device)
self._data.body_names = self._body_names
self._data.joint_names = self._joint_names
self._data.fixed_tendon_names = self._fixed_tendon_names
@@ -3803,9 +3788,8 @@ def _process_tendons(self) -> None:
self._fixed_tendon_names = []
self._spatial_tendon_names = []
- sample = next(iter(self._bindings.values()))
- self._num_fixed_tendons = getattr(sample, "fixed_tendon_count", 0)
- self._num_spatial_tendons = getattr(sample, "spatial_tendon_count", 0)
+ self._num_fixed_tendons = self._root_view.fixed_tendon_count
+ self._num_spatial_tendons = self._root_view.spatial_tendon_count
if self._num_fixed_tendons > 0 or self._num_spatial_tendons > 0:
stage_path = OvPhysxManager._stage_path
@@ -3864,16 +3848,7 @@ def _get_binding(self, tensor_type: int):
Returns:
A TensorBinding object, or ``None`` if the binding could not be created.
"""
- binding = self._bindings.get(tensor_type)
- if binding is not None:
- return binding
- try:
- binding = self._ovphysx.create_tensor_binding(pattern=self._binding_pattern, tensor_type=tensor_type)
- self._bindings[tensor_type] = binding
- return binding
- except Exception:
- logger.debug("Could not create tensor binding for type %s", tensor_type)
- return None
+ return self._root_view.try_binding_for(tensor_type)
def _resolve_joint_values(self, pattern_dict: dict[str, float], buffer: wp.array) -> None:
"""Resolve a ``{pattern: value}`` dict into a per-joint buffer.
@@ -3920,6 +3895,9 @@ def _nst(self) -> int:
def _invalidate_initialize_callback(self, event) -> None:
"""Invalidate the asset on simulation reset."""
super()._invalidate_initialize_callback(event)
+ # Drop the view (and the bindings it caches) on stop so a destroyed/stale binding is
+ # not held across the reset; ``_initialize_impl`` rebuilds a fresh view on the next play.
+ self._root_view = None
"""
Internal helpers -- Actuators.
@@ -4185,9 +4163,10 @@ def _broadcast_scalar_to_2d(
def _resolve_env_mask(self, env_mask: wp.array | None) -> wp.array:
"""Resolve an environment mask to a ``wp.bool`` array on ``self._device``.
- OVPhysX (like Newton) uses the binding's native ``binding.write(mask=...)`` path,
- so the mask is preserved end-to-end; no ``torch.nonzero`` conversion is needed.
- ``None`` returns the pre-allocated all-true mask.
+ OVPhysX (like Newton) writes through the view's ``set_attribute(mask=...)``, which
+ forwards to the binding's native masked write, so the mask is preserved end-to-end;
+ no ``torch.nonzero`` conversion is needed. ``None`` returns the pre-allocated
+ all-true mask.
"""
if env_mask is None:
return self._ALL_TRUE_ENV_MASK
@@ -4240,9 +4219,9 @@ def _resolve_spatial_tendon_mask(self, tendon_mask: wp.array | None) -> wp.array
def _get_cpu_env_mask(self, env_mask: wp.array) -> wp.array:
"""Return a pinned-host CPU copy of :paramref:`env_mask` for a CPU-only binding write.
- :paramref:`env_mask` is normally on ``self._device``; ``binding.write(mask=...)``
- requires the mask on the binding's device, which is CPU for mass / CoMs / inertia.
- Reuses the pre-allocated ``_cpu_env_mask`` pinned buffer.
+ :paramref:`env_mask` is normally on ``self._device``; ``set_attribute(mask=...)``
+ requires the mask on the binding's native device, which is CPU for mass / CoMs /
+ inertia. Reuses the pre-allocated ``_cpu_env_mask`` pinned buffer.
"""
wp.copy(self._cpu_env_mask, env_mask)
return self._cpu_env_mask
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation_data.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation_data.py
index 922c12edfaa3..b3d485e26a99 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation_data.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation_data.py
@@ -32,6 +32,7 @@
vec13f,
)
from isaaclab_ovphysx.physics import OvPhysxManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .kernels import _fd_joint_acc
@@ -72,30 +73,28 @@ class ArticulationData(BaseArticulationData):
__backend_name__: str = "ovphysx"
"""The name of the backend for the articulation data."""
- def __init__(self, bindings: dict[int, Any], device: str) -> None:
+ def __init__(self, view: OvPhysxView, device: str) -> None:
"""Initialize the articulation data container.
Args:
- bindings: Dictionary of OVPhysX :class:`TensorBinding` objects keyed
- by :class:`isaaclab_ovphysx.tensor_types.TensorType`. All counts
- (instances, bodies, DOFs, fixed/spatial tendons) are derived
- from the binding metadata. Name lists are assigned by
- :meth:`~isaaclab_ovphysx.assets.Articulation._initialize_impl`
- after construction.
+ view: The :class:`~isaaclab_ovphysx.sim.views.OvPhysxView` binding manager
+ for this articulation. All counts (instances, bodies, DOFs,
+ fixed/spatial tendons) are derived from the view metadata. Name lists
+ are assigned by
+ :meth:`~isaaclab_ovphysx.assets.Articulation._initialize_impl` after
+ construction.
device: Simulation device string (e.g., ``"cuda:0"`` or ``"cpu"``).
"""
super().__init__(root_view=None, device=device)
- self._bindings = bindings
-
- # Every OVPhysX TensorBinding carries the articulation metadata
- # (instance count, dof_count, body_count, fixed/spatial tendon counts);
- # any binding will do for the read.
- sample = next(iter(bindings.values()))
- self.num_instances = sample.count
- self.num_bodies = sample.body_count
- self.num_joints = sample.dof_count
- self.num_fixed_tendons = getattr(sample, "fixed_tendon_count", 0)
- self.num_spatial_tendons = getattr(sample, "spatial_tendon_count", 0)
+ self._view = view
+
+ # The view exposes the articulation metadata (instance count, dof_count,
+ # body_count, fixed/spatial tendon counts) read from any instantiated binding.
+ self.num_instances = view.count
+ self.num_bodies = view.body_count
+ self.num_joints = view.dof_count
+ self.num_fixed_tendons = view.fixed_tendon_count
+ self.num_spatial_tendons = view.spatial_tendon_count
# private aliases used throughout _create_buffers and property bodies
self._num_instances = self.num_instances
self._num_bodies = self.num_bodies
@@ -109,8 +108,6 @@ def __init__(self, bindings: dict[int, Any], device: str) -> None:
self._is_primed: bool = False
# pinned-host staging buffers for CPU-only bindings (keyed by tensor_type)
self._cpu_staging_buffers: dict[int, wp.array] = {}
- # scratch buffers for _get_read_view cache (keyed by (tensor_type, ptr))
- self._read_scratch: dict = {}
# obtain gravity from the simulation configuration (fall back to standard
# gravity when the simulation has not been configured yet, e.g. in unit tests)
@@ -248,6 +245,29 @@ def _reset_velocity(self, from_com: bool = True) -> None:
# Force a kinematic refresh on the next FK-dependent read.
self._fk_timestamp = -1.0
+ def _reset_body_com_pose_b_dependents(self) -> None:
+ """Reset cached properties derived from body-frame center-of-mass offsets."""
+ reset_timestamps(
+ [
+ self._root_com_pose_w,
+ self._root_com_vel_w,
+ self._root_link_vel_w,
+ self._body_com_pose_w,
+ self._body_com_vel_w,
+ self._body_link_vel_w,
+ self._root_link_lin_vel_b,
+ self._root_link_ang_vel_b,
+ self._root_com_lin_vel_b,
+ self._root_com_ang_vel_b,
+ self._root_state_w_buf,
+ self._root_link_state_w_buf,
+ self._root_com_state_w_buf,
+ self._body_state_w_buf,
+ self._body_link_state_w_buf,
+ self._body_com_state_w_buf,
+ ]
+ )
+
"""
Names.
"""
@@ -977,7 +997,8 @@ def body_com_pose_b(self) -> ProxyArray:
This quantity is the pose of the center of mass frame of the rigid body relative to the body's link frame.
The orientation is provided in (x, y, z, w) format.
"""
- self._read_transform_binding(TT.BODY_COM_POSE, self._body_com_pose_b)
+ if self._body_com_pose_b.timestamp < 0.0:
+ self._read_transform_binding(TT.BODY_COM_POSE, self._body_com_pose_b)
if self._body_com_pose_b_ta is None:
self._body_com_pose_b_ta = ProxyArray(self._body_com_pose_b.data)
return self._body_com_pose_b_ta
@@ -1553,35 +1574,37 @@ def _create_buffers(self) -> None: # noqa: C901
# Initialize ProxyArray wrappers (lazily created on first property access).
self._pin_proxy_arrays()
- def _binding_read(self, tensor_type: int, binding: Any, dst: wp.array) -> None:
- """Read *binding* into *dst*, staging through a pinned-host buffer for CPU-only bindings.
+ def _binding_read(self, tensor_type: int, dst: wp.array) -> None:
+ """Refresh *dst* from the binding via the view, staging for CPU-only bindings.
- For GPU-resident state bindings (pose, velocity, etc.) the read goes directly
- into the destination array. For CPU-only property bindings (mass, COM, limits,
- stiffness, …) the wheel writes into a pinned-host staging buffer first, then
- :func:`wp.copy` moves the data to the simulation device asynchronously.
+ GPU-resident state bindings (pose, velocity, …) fill *dst* directly through
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.read_into`, which reinterprets a
+ structured *dst* and reuses that reinterpret across calls so the wheel's read cache
+ stays warm. CPU-only property bindings (mass, COM, limits, stiffness, …) are read
+ into a pinned-host staging buffer first (the view does not stage across devices),
+ then :func:`wp.copy` moves the data to the simulation device.
Args:
tensor_type: TensorType key identifying the binding.
- binding: OVPhysX TensorBinding whose ``read`` method is called.
dst: Destination :class:`wp.array` on the simulation device.
"""
if tensor_type not in TT._CPU_ONLY_TYPES or self.device == "cpu":
- binding.read(dst)
+ self._view.read_into(tensor_type, dst)
return
- # Route through a lazily-allocated pinned-host staging buffer.
+ # Route through a lazily-allocated pinned-host staging buffer (read_into refuses to
+ # cross devices), then copy to the simulation device.
staging = self._cpu_staging_buffers.get(tensor_type)
if staging is None:
- staging = wp.zeros(binding.shape, dtype=wp.float32, device="cpu", pinned=True)
+ staging = wp.zeros(self._view.binding_for(tensor_type).shape, dtype=wp.float32, device="cpu", pinned=True)
self._cpu_staging_buffers[tensor_type] = staging
- binding.read(staging)
- # Build a flat float32 view of dst matching the binding's flat shape.
+ self._view.read_into(tensor_type, staging)
+ # Build a flat float32 view of dst matching the staging's flat shape.
if dst.dtype == wp.float32:
view = dst
else:
view = wp.array(
ptr=dst.ptr,
- shape=binding.shape,
+ shape=staging.shape,
dtype=wp.float32,
device=str(dst.device),
copy=False,
@@ -1741,11 +1764,11 @@ def _read_cpu(tensor_type):
]:
binding = self._get_binding(tt)
if binding is not None:
- self._binding_read(tt, binding, buf.data)
+ self._binding_read(tt, buf.data)
buf.timestamp = self._sim_timestamp
binding = self._get_binding(TT.FIXED_TENDON_LIMIT)
if binding is not None:
- self._binding_read(TT.FIXED_TENDON_LIMIT, binding, self._fixed_tendon_pos_limits.data)
+ self._binding_read(TT.FIXED_TENDON_LIMIT, self._fixed_tendon_pos_limits.data)
self._fixed_tendon_pos_limits.timestamp = self._sim_timestamp
# Spatial tendon properties (sim-device, see fixed-tendon comment above).
@@ -1759,7 +1782,7 @@ def _read_cpu(tensor_type):
]:
binding = self._get_binding(tt)
if binding is not None:
- self._binding_read(tt, binding, buf.data)
+ self._binding_read(tt, buf.data)
buf.timestamp = self._sim_timestamp
def _pin_proxy_arrays(self) -> None:
@@ -1920,135 +1943,47 @@ def _invalidate_initialize_callback(self, event) -> None:
val.timestamp = -1.0
def _get_binding(self, tensor_type: int):
- """Return the cached binding for :paramref:`tensor_type`, or ``None`` if absent.
+ """Return the binding for :paramref:`tensor_type`, or ``None`` if unavailable.
- Args:
- tensor_type: TensorType key.
-
- Returns:
- The TensorBinding, or ``None`` if not present in the binding dict.
- """
- return self._bindings.get(tensor_type)
-
- def _get_read_view(self, tensor_type: int, wp_array: wp.array, floats_per_elem: int = 0) -> wp.array | None:
- """Return a stable float32 view of a warp buffer for reading from a binding.
-
- For structured-dtype buffers (transformf, spatial_vectorf), the view
- reinterprets the same GPU memory as a flat float32 array matching the
- binding's shape. For plain float32 buffers, returns the array as-is.
-
- The returned view is cached so that ``binding.read(view)`` sees the
- same object on every call, enabling the binding's internal read cache.
+ Delegates to :attr:`root_view`'s
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.try_binding_for`, which returns the
+ cached binding (creating it on first access) or ``None`` for tensor types that do
+ not apply to these prims.
Args:
tensor_type: TensorType key.
- wp_array: Destination warp array.
- floats_per_elem: Number of float32 elements per logical element
- (e.g. 7 for transformf, 6 for spatial_vectorf). Pass 0 to
- return the array as-is.
Returns:
- Float32 view suitable for ``binding.read()``, or ``None``.
+ The TensorBinding, or ``None`` if not available for these prims.
"""
- if not hasattr(self, "_read_view_cache"):
- self._read_view_cache = {}
- cache_key = (tensor_type, wp_array.ptr)
- cached = self._read_view_cache.get(cache_key)
- if cached is not None:
- return cached
-
- binding = self._get_binding(tensor_type)
- if binding is None:
- self._read_view_cache[cache_key] = None
- return None
-
- if floats_per_elem > 0:
- view = wp.array(
- ptr=wp_array.ptr,
- shape=binding.shape,
- dtype=wp.float32,
- device=str(wp_array.device),
- copy=False,
- )
- else:
- view = wp_array
-
- self._read_view_cache[cache_key] = view
- return view
+ return self._view.try_binding_for(tensor_type)
def _read_binding_into_buf(self, tensor_type: int, buf: TimestampedBuffer) -> None:
- """Read from an ovphysx binding into a :class:`TimestampedBuffer`, skipping if fresh.
-
- Args:
- tensor_type: TensorType key.
- buf: Timestamped buffer to refresh.
- """
- if buf.timestamp >= self._sim_timestamp:
- return
- view = self._get_read_view(tensor_type, buf.data)
- if view is None:
- return
- self._get_binding(tensor_type).read(view)
- buf.timestamp = self._sim_timestamp
+ """Refresh *buf* from the matching binding via the view, skipping if fresh or absent.
- def _read_transform_binding(self, tensor_type: int, buf: TimestampedBuffer) -> None:
- """Read a pose binding (float32 view of transformf buffer), skipping if fresh.
-
- CPU-only bindings (e.g. ``BODY_COM_POSE``) are routed through a
- pinned-host staging buffer via :meth:`_binding_read` so the wheel's
- device-match requirement is satisfied even on a GPU sim.
+ Reads route through :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.read_into`, which
+ derives the structured reinterpret from the binding shape (so transform, spatial-vector,
+ and scalar buffers all use the same path) and reuses that reinterpret across calls;
+ CPU-only property bindings are staged onto the simulation device inside
+ :meth:`_binding_read`.
Args:
tensor_type: TensorType key.
- buf: Timestamped :class:`wp.transformf` buffer to refresh.
- """
- if buf.timestamp >= self._sim_timestamp:
- return
- binding = self._get_binding(tensor_type)
- if binding is None:
- return
- view = self._get_read_view(tensor_type, buf.data, 7)
- if view is None:
- return
- self._binding_read(tensor_type, binding, view)
- buf.timestamp = self._sim_timestamp
-
- def _read_spatial_vector_binding(self, tensor_type: int, buf: TimestampedBuffer) -> None:
- """Read a velocity binding (float32 view of spatial_vectorf buffer), skipping if fresh.
-
- Args:
- tensor_type: TensorType key.
- buf: Timestamped :class:`wp.spatial_vectorf` buffer to refresh.
+ buf: Timestamped buffer to refresh.
"""
if buf.timestamp >= self._sim_timestamp:
return
- view = self._get_read_view(tensor_type, buf.data, 6)
- if view is None:
+ if self._get_binding(tensor_type) is None:
return
- self._get_binding(tensor_type).read(view)
+ self._binding_read(tensor_type, buf.data)
buf.timestamp = self._sim_timestamp
- def _read_scalar_binding(self, tensor_type: int, buf: TimestampedBuffer) -> None:
- """Refresh a scalar or flat float32 buffer from the matching binding if stale.
-
- Identical timestamp-gating contract as :meth:`_read_transform_binding`
- but without a structured-dtype reinterpret cast. CPU-only bindings
- (e.g. ``DOF_STIFFNESS``, ``DOF_LIMIT``) are routed through a
- pre-allocated pinned-host staging buffer via :meth:`_binding_read` so
- the wheel's device-match requirement is satisfied even on a GPU sim.
-
- Args:
- tensor_type: TensorType key identifying the binding.
- buf: Timestamped buffer whose :attr:`~TimestampedBuffer.data` field
- will be refreshed.
- """
- if buf.timestamp >= self._sim_timestamp:
- return
- binding = self._get_binding(tensor_type)
- if binding is None:
- return
- self._binding_read(tensor_type, binding, buf.data)
- buf.timestamp = self._sim_timestamp
+ # ``read_into`` derives the reinterpret from the binding shape and ``_binding_read`` handles
+ # CPU-only staging, so the transform / spatial-vector / scalar read paths are now identical;
+ # keep the distinct names as aliases for call-site readability.
+ _read_transform_binding = _read_binding_into_buf
+ _read_spatial_vector_binding = _read_binding_into_buf
+ _read_scalar_binding = _read_binding_into_buf
def _get_pos_from_transform(self, transform: wp.array) -> wp.array:
"""Return a position view aliased into a transform array.
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object.py
index 0428c9d2f67e..f0df0e11255a 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object.py
@@ -10,7 +10,6 @@
import re
import warnings
from collections.abc import Sequence
-from typing import Any
import numpy as np
import torch
@@ -29,6 +28,7 @@
from isaaclab_ovphysx.assets.kernels import _body_wrench_to_world
from isaaclab_ovphysx.cloner import queue_ovphysx_replication
from isaaclab_ovphysx.physics import OvPhysxManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .rigid_object_data import RigidObjectData
@@ -64,9 +64,9 @@ def __init__(self, cfg: RigidObjectCfg):
"""
super().__init__(cfg)
queue_ovphysx_replication(cfg)
- # Bindings are created lazily (on first access) to avoid allocating
- # handles for tensor types the user never queries.
- self._bindings: dict[int, Any] = {}
+ # The binding manager is created in ``_initialize_impl``; it owns all
+ # TensorBinding creation, caching, and the CPU/GPU device policy.
+ self._root_view: OvPhysxView | None = None
"""
Properties
@@ -94,20 +94,23 @@ def body_names(self) -> list[str]:
return self._body_names
@property
- def root_view(self) -> dict[int, Any]:
+ def root_view(self) -> OvPhysxView:
"""Root view for the asset.
- OVPhysX exposes per-tensor-type bindings rather than a single opaque view object
- as used by the PhysX and Newton backends. Callers that need low-level binding
- access should call :meth:`_get_binding` rather than iterating this dict directly.
- For high-level state access (instance counts, prim paths, transforms), use the
+ On OVPhysX this is an :class:`~isaaclab_ovphysx.sim.views.OvPhysxView`: a
+ string-keyed binding manager over the per-tensor-type ``TensorBinding`` handles,
+ rather than the single opaque view object used by the PhysX and Newton backends.
+ Address attributes by their lowercased ``TensorType`` name (e.g.
+ ``root_view.get_attribute("rigid_body_pose")``) or by the
+ :class:`~isaaclab_ovphysx.tensor_types.TensorType` member itself. For high-level
+ state access (instance counts, prim paths, transforms), prefer the
:attr:`num_instances`, :attr:`body_names`, and
:attr:`~RigidObjectData.root_link_pose_w` accessors instead.
.. note::
Use this view with caution. It requires handling of tensors in a specific way.
"""
- return self._bindings
+ return self._root_view
@property
def instantaneous_wrench_composer(self) -> WrenchComposer | None:
@@ -178,8 +181,7 @@ def write_data_to_sim(self) -> None:
outputs=[self._wrench_buf],
device=self._device,
)
- binding = self._get_binding(TT.RIGID_BODY_WRENCH)
- binding.write(self._wrench_buf_flat)
+ self._root_view.set_attribute(TT.RIGID_BODY_WRENCH, self._wrench_buf_flat)
inst.reset()
def update(self, dt: float) -> None:
@@ -362,8 +364,9 @@ def write_root_link_pose_to_sim_index(
if not skip_forward:
self.data._reset_pose()
# Push cache to the wheel via an indexed write.
- binding = self._get_binding(TT.RIGID_BODY_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_POSE, self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids
+ )
def write_root_link_pose_to_sim_mask(
self,
@@ -401,8 +404,9 @@ def write_root_link_pose_to_sim_mask(
)
if not skip_forward:
self.data._reset_pose()
- binding = self._get_binding(TT.RIGID_BODY_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_POSE, self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp
+ )
def write_root_com_pose_to_sim_index(
self,
@@ -441,8 +445,9 @@ def write_root_com_pose_to_sim_index(
)
if not skip_forward:
self.data._reset_pose(from_link=False)
- binding = self._get_binding(TT.RIGID_BODY_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_POSE, self.data._root_link_pose_w.data.view(wp.float32), indices=env_ids
+ )
def write_root_com_pose_to_sim_mask(
self,
@@ -481,8 +486,9 @@ def write_root_com_pose_to_sim_mask(
)
if not skip_forward:
self.data._reset_pose(from_link=False)
- binding = self._get_binding(TT.RIGID_BODY_POSE)
- binding.write(self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_POSE, self.data._root_link_pose_w.data.view(wp.float32), mask=env_mask_wp
+ )
def write_root_com_velocity_to_sim_index(
self,
@@ -524,8 +530,9 @@ def write_root_com_velocity_to_sim_index(
# Invalidate dependent timestamps.
if not skip_forward:
self.data._reset_velocity()
- binding = self._get_binding(TT.RIGID_BODY_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids
+ )
def write_root_com_velocity_to_sim_mask(
self,
@@ -566,8 +573,9 @@ def write_root_com_velocity_to_sim_mask(
)
if not skip_forward:
self.data._reset_velocity()
- binding = self._get_binding(TT.RIGID_BODY_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp
+ )
def write_root_link_velocity_to_sim_index(
self,
@@ -614,8 +622,9 @@ def write_root_link_velocity_to_sim_index(
)
if not skip_forward:
self.data._reset_velocity(from_com=False)
- binding = self._get_binding(TT.RIGID_BODY_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), indices=env_ids
+ )
def write_root_link_velocity_to_sim_mask(
self,
@@ -656,8 +665,9 @@ def write_root_link_velocity_to_sim_mask(
)
if not skip_forward:
self.data._reset_velocity(from_com=False)
- binding = self._get_binding(TT.RIGID_BODY_VELOCITY)
- binding.write(self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_VELOCITY, self.data._root_com_vel_w.data.view(wp.float32), mask=env_mask_wp
+ )
"""
Operations - Setters.
@@ -698,8 +708,7 @@ def set_masses_index(
# Push cache to the wheel via pinned-CPU staging (RIGID_BODY_MASS is CPU-only).
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self._cpu_body_mass, self.data._body_mass)
- binding = self._get_binding(TT.RIGID_BODY_MASS)
- binding.write(self._cpu_body_mass.flatten(), indices=cpu_env_ids)
+ self._root_view.set_attribute(TT.RIGID_BODY_MASS, self._cpu_body_mass.flatten(), indices=cpu_env_ids)
def set_masses_mask(
self,
@@ -733,8 +742,9 @@ def set_masses_mask(
device=self._device,
)
wp.copy(self._cpu_body_mass, self.data._body_mass)
- binding = self._get_binding(TT.RIGID_BODY_MASS)
- binding.write(self._cpu_body_mass.flatten(), mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_MASS, self._cpu_body_mass.flatten(), mask=self._get_cpu_env_mask(env_mask_wp)
+ )
def set_coms_index(
self,
@@ -773,9 +783,10 @@ def set_coms_index(
# Push cache to the wheel via pinned-CPU staging (RIGID_BODY_COM_POSE is CPU-only).
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self._cpu_body_coms, self.data._body_com_pose_b.data)
- binding = self._get_binding(TT.RIGID_BODY_COM_POSE)
# Wheel binding shape is (N, 7); squeeze singleton body dim with a flat float32 view.
- binding.write(self._cpu_body_coms.reshape((self._num_instances, 7)), indices=cpu_env_ids)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_COM_POSE, self._cpu_body_coms.reshape((self._num_instances, 7)), indices=cpu_env_ids
+ )
def set_coms_mask(
self,
@@ -810,8 +821,11 @@ def set_coms_mask(
)
self.data._root_com_pose_w.timestamp = -1.0
wp.copy(self._cpu_body_coms, self.data._body_com_pose_b.data)
- binding = self._get_binding(TT.RIGID_BODY_COM_POSE)
- binding.write(self._cpu_body_coms.reshape((self._num_instances, 7)), mask=self._get_cpu_env_mask(env_mask_wp))
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_COM_POSE,
+ self._cpu_body_coms.reshape((self._num_instances, 7)),
+ mask=self._get_cpu_env_mask(env_mask_wp),
+ )
def set_inertias_index(
self,
@@ -847,9 +861,10 @@ def set_inertias_index(
# Push cache to the wheel via pinned-CPU staging (RIGID_BODY_INERTIA is CPU-only).
cpu_env_ids = self._get_cpu_env_ids(env_ids)
wp.copy(self._cpu_body_inertia, self.data._body_inertia)
- binding = self._get_binding(TT.RIGID_BODY_INERTIA)
# Wheel binding shape is (N, 9); flatten the singleton body dim.
- binding.write(self._cpu_body_inertia.reshape((self._num_instances, 9)), indices=cpu_env_ids)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_INERTIA, self._cpu_body_inertia.reshape((self._num_instances, 9)), indices=cpu_env_ids
+ )
def set_inertias_mask(
self,
@@ -883,9 +898,10 @@ def set_inertias_mask(
device=self._device,
)
wp.copy(self._cpu_body_inertia, self.data._body_inertia)
- binding = self._get_binding(TT.RIGID_BODY_INERTIA)
- binding.write(
- self._cpu_body_inertia.reshape((self._num_instances, 9)), mask=self._get_cpu_env_mask(env_mask_wp)
+ self._root_view.set_attribute(
+ TT.RIGID_BODY_INERTIA,
+ self._cpu_body_inertia.reshape((self._num_instances, 9)),
+ mask=self._get_cpu_env_mask(env_mask_wp),
)
"""
@@ -920,6 +936,7 @@ def has_rigid_body_api(prim) -> bool:
# Eagerly create every binding the data container reads at init, so failures
# surface here with a helpful message rather than as a raw wheel exception
# (or a KeyError) at first writer call.
+ self._root_view = OvPhysxView(self._ovphysx, pattern=pattern, device=self._device)
for tt in (
TT.RIGID_BODY_POSE,
TT.RIGID_BODY_VELOCITY,
@@ -929,7 +946,7 @@ def has_rigid_body_api(prim) -> bool:
TT.RIGID_BODY_INERTIA,
):
try:
- self._get_binding(tt)
+ self._root_view.binding_for(tt)
except Exception as e:
raise RuntimeError(
f"OVPhysX could not create rigid-body binding {tt!r}. "
@@ -941,7 +958,7 @@ def has_rigid_body_api(prim) -> bool:
) from e
# read counts and body names from the root-pose binding
- root_pose = self._bindings[TT.RIGID_BODY_POSE]
+ root_pose = self._root_view.binding_for(TT.RIGID_BODY_POSE)
self._num_instances = root_pose.count
self._num_bodies = 1
try:
@@ -957,7 +974,7 @@ def has_rigid_body_api(prim) -> bool:
self._body_names = ["base_link"]
# container for data access
- self._data = RigidObjectData(self._bindings, self._device, check_shapes=self._check_shapes)
+ self._data = RigidObjectData(self._root_view, self._device, check_shapes=self._check_shapes)
# create buffers
self._create_buffers()
@@ -977,7 +994,7 @@ def _create_buffers(self) -> None:
# constants
self._ALL_INDICES = wp.array(np.arange(N, dtype=np.int32), device=device)
self._ALL_BODY_INDICES = wp.array(np.arange(B, dtype=np.int32), device=device)
- # All-true masks for default mask paths. These let ``binding.write(..., mask=...)``
+ # All-true masks for default mask paths. These let ``set_attribute(..., mask=...)``
# cover all instances when no env_mask is supplied, without converting back to indices.
self._ALL_TRUE_ENV_MASK = wp.array(np.ones(N, dtype=bool), dtype=wp.bool, device=device)
self._ALL_TRUE_BODY_MASK = wp.array(np.ones(B, dtype=bool), dtype=wp.bool, device=device)
@@ -1093,8 +1110,8 @@ def _resolve_body_mask(self, body_mask: wp.array | None) -> wp.array:
def _get_cpu_env_mask(self, env_mask: wp.array) -> wp.array:
"""Return a pinned-host CPU copy of *env_mask* for a CPU-only binding write.
- The wheel's ``binding.write(mask=...)`` requires the mask on the binding's
- device, which is CPU for mass / coms / inertia. Reuses the pre-allocated
+ ``set_attribute(mask=...)`` requires the mask on the binding's native device,
+ which is CPU for mass / coms / inertia. Reuses the pre-allocated
``_cpu_env_mask`` pinned buffer.
"""
wp.copy(self._cpu_env_mask, env_mask)
@@ -1126,12 +1143,7 @@ def _get_binding(self, tensor_type: int):
Returns:
The cached TensorBinding for ``tensor_type``.
"""
- binding = self._bindings.get(tensor_type)
- if binding is not None:
- return binding
- binding = self._ovphysx.create_tensor_binding(pattern=self._binding_pattern, tensor_type=tensor_type)
- self._bindings[tensor_type] = binding
- return binding
+ return self._root_view.try_binding_for(tensor_type)
"""
Internal simulation callbacks.
@@ -1140,6 +1152,9 @@ def _get_binding(self, tensor_type: int):
def _invalidate_initialize_callback(self, event) -> None:
"""Invalidates the scene elements."""
super()._invalidate_initialize_callback(event)
+ # Drop the view (and the bindings it caches) on stop so a destroyed/stale binding is
+ # not held across the reset; ``_initialize_impl`` rebuilds a fresh view on the next play.
+ self._root_view = None
def write_root_state_to_sim(
self,
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object_data.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object_data.py
index e2ef03564d27..6d3659338d54 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object_data.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/assets/rigid_object/rigid_object_data.py
@@ -22,6 +22,7 @@
from isaaclab_ovphysx import tensor_types as TT
from isaaclab_ovphysx.assets import kernels as shared_kernels
from isaaclab_ovphysx.physics import OvPhysxManager as SimulationManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
class RigidObjectData(BaseRigidObjectData):
@@ -60,30 +61,31 @@ class RigidObjectData(BaseRigidObjectData):
def __init__(
self,
- bindings: dict,
+ view: OvPhysxView,
device: str,
check_shapes: bool = True,
):
"""Initializes the rigid object data.
Args:
- bindings: The OVPhysX tensor bindings dict keyed by tensor-type constant.
- ``num_instances`` is read from ``bindings[RIGID_BODY_POSE].count`` and
- ``num_bodies`` is fixed at 1; ``body_names`` is set by
+ view: The :class:`~isaaclab_ovphysx.sim.views.OvPhysxView` binding manager
+ for this rigid object. ``num_instances`` is read from the
+ ``rigid_body_pose`` binding's ``count`` and ``num_bodies`` is fixed at 1;
+ ``body_names`` is set by
:meth:`~isaaclab_ovphysx.assets.RigidObject._initialize_impl`.
device: The device used for processing.
check_shapes: Whether to enforce internal shape/dtype invariants on
lazy reads. Defaults to ``True``; production callers thread this
from :attr:`~isaaclab.assets.AssetBaseCfg.disable_shape_checks`.
"""
- super().__init__(bindings, device)
- # Set the tensor bindings (OVPhysX exposes per-tensor-type bindings rather than a single view).
- self._bindings = bindings
+ super().__init__(view, device)
+ # The view owns the per-tensor-type bindings and the CPU/GPU device policy.
+ self._view = view
self._check_shapes = check_shapes
# Set initial time stamp
self._sim_timestamp = 0.0
self._is_primed = False
- root_pose = self._bindings[TT.RIGID_BODY_POSE]
+ root_pose = self._view.binding_for(TT.RIGID_BODY_POSE)
self._num_instances = root_pose.count
self._num_bodies = 1
@@ -873,8 +875,8 @@ def _create_buffers(self) -> None:
# The wheel exposes ``RIGID_BODY_MASS`` as ``(N,)`` and ``RIGID_BODY_INERTIA`` as ``(N, 9)``;
# the ``BaseRigidObjectData`` contract is ``(N, 1)`` and ``(N, 1, 9)`` respectively, so we
# read into a flat buffer and reshape (zero-copy) after the read.
- mass_binding = self._bindings[TT.RIGID_BODY_MASS]
- inertia_binding = self._bindings[TT.RIGID_BODY_INERTIA]
+ mass_binding = self._view.binding_for(TT.RIGID_BODY_MASS)
+ inertia_binding = self._view.binding_for(TT.RIGID_BODY_INERTIA)
self._body_mass = wp.zeros(mass_binding.shape, dtype=wp.float32, device=self.device)
self._body_inertia = wp.zeros(inertia_binding.shape, dtype=wp.float32, device=self.device)
self._read_binding_into(TT.RIGID_BODY_MASS, self._body_mass)
@@ -957,20 +959,24 @@ def _pin_proxy_arrays(self) -> None:
"""
def _get_binding(self, tensor_type: int):
- """Return the binding for the given tensor type, or None."""
- return self._bindings.get(tensor_type)
+ """Return the binding for the given tensor type, or None.
+
+ Delegates to :attr:`root_view`'s
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.try_binding_for`.
+ """
+ return self._view.try_binding_for(tensor_type)
def _read_binding_into(self, tensor_type: int, dst: wp.array) -> None:
"""Read the OVPhysX TensorBinding for *tensor_type* into *dst*.
- Adapter that replaces PhysX's view-getter pattern: the wheel exposes
- ``binding.read(target)`` rather than a getter returning a wp.array, so
- we read into a flat float32 view of *dst*. CPU-only bindings on a
- non-CPU sim go through a lazily-allocated pinned-host wp.array to
- satisfy the wheel's device match.
+ Routes through :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.read_into`, which
+ reinterprets a structured *dst* off the binding shape and reuses that reinterpret
+ across calls (keeping the wheel's read cache warm). CPU-only bindings on a non-CPU
+ sim are read into a pinned-host staging buffer first (the view does not stage across
+ devices), then copied to *dst* on the simulation device.
"""
- binding = self._bindings[tensor_type]
if self._check_shapes:
+ binding = self._view.binding_for(tensor_type)
dst_bytes = dst.size * wp.types.type_size_in_bytes(dst.dtype)
binding_bytes = 4 * math.prod(binding.shape)
assert dst_bytes >= binding_bytes, (
@@ -978,26 +984,22 @@ def _read_binding_into(self, tensor_type: int, dst: wp.array) -> None:
f"({dst_bytes} B < {binding_bytes} B). Caller allocated dst with "
f"shape={tuple(dst.shape)}, dtype={dst.dtype}; binding shape={tuple(binding.shape)}."
)
- # Build a flat float32 view of dst matching the binding's shape.
- if dst.dtype == wp.float32:
- view = dst
- else:
- view = wp.array(
- ptr=dst.ptr,
- shape=binding.shape,
- dtype=wp.float32,
- device=str(dst.device),
- copy=False,
- )
- if tensor_type in TT._CPU_ONLY_TYPES and str(view.device) != "cpu":
+ if tensor_type in TT._CPU_ONLY_TYPES and self.device != "cpu":
staging = self._cpu_staging_buffers.get(tensor_type)
if staging is None:
- staging = wp.zeros(binding.shape, dtype=wp.float32, device="cpu", pinned=True)
+ staging = wp.zeros(
+ self._view.binding_for(tensor_type).shape, dtype=wp.float32, device="cpu", pinned=True
+ )
self._cpu_staging_buffers[tensor_type] = staging
- binding.read(staging)
+ self._view.read_into(tensor_type, staging)
+ # Copy the flat float32 staging into dst (possibly structured) on the sim device.
+ if dst.dtype == wp.float32:
+ view = dst
+ else:
+ view = wp.array(ptr=dst.ptr, shape=staging.shape, dtype=wp.float32, device=str(dst.device), copy=False)
wp.copy(view, staging)
else:
- binding.read(view)
+ self._view.read_into(tensor_type, dst)
def _get_pos_from_transform(self, transform: wp.array) -> wp.array:
"""Generates a position array from a transform array."""
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py
index 01803d51a769..f21eeb094363 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/physics/ovphysx_manager.py
@@ -98,6 +98,7 @@ def setup(self, physx, stage, device: str) -> None:
device: Warp device string used to allocate the staging and merged buffers.
"""
from isaaclab_ovphysx import tensor_types as TT # local: keep heavy ovphysx out of module load
+ from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
self._physx = physx
self._rigid_bindings = []
@@ -119,7 +120,8 @@ def setup(self, physx, stage, device: str) -> None:
total_count = 0
for pattern in sorted(patterns):
try:
- pose_binding = physx.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_POSE)
+ view = OvPhysxView(physx, pattern=pattern, device=device)
+ pose_binding = view.binding_for(TT.RIGID_BODY_POSE)
except Exception as exc:
logger.warning("Failed to create RIGID_BODY_POSE binding for %s: %s", pattern, exc)
continue
@@ -141,6 +143,7 @@ def setup(self, physx, stage, device: str) -> None:
self._rigid_bindings.append(
{
"pattern": pattern,
+ "view": view,
"pose": pose_binding,
"pose_buf": pose_buf,
"pose_buf_transformf": pose_buf_transformf,
@@ -175,7 +178,7 @@ def transforms(self) -> SceneDataFormat.Transform:
for entry in self._rigid_bindings:
try:
- entry["pose"].read(entry["pose_buf"])
+ entry["view"].read_into("rigid_body_pose", entry["pose_buf"])
except Exception as exc:
logger.warning("RIGID_BODY_POSE read failed for %s: %s", entry["pattern"], exc)
continue
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/contact_sensor/contact_sensor.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/contact_sensor/contact_sensor.py
index fba5d8b3da49..1bfd5077bf9f 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/contact_sensor/contact_sensor.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/contact_sensor/contact_sensor.py
@@ -22,6 +22,7 @@
import isaaclab_ovphysx.tensor_types as TT
from isaaclab_ovphysx.physics import OvPhysxManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .contact_sensor_data import ContactSensorData
from .kernels import (
@@ -92,6 +93,9 @@ def __init__(self, cfg: ContactSensorCfg):
self._physx_instance: Any = None
self._contact_binding: Any = None
self._pose_binding: Any = None
+ # The pose binding (track_pose only) is managed by an OvPhysxView; the ContactBinding
+ # is a separate wheel API the view does not wrap.
+ self._root_view: OvPhysxView | None = None
# Pre-allocated read buffers, populated in _create_buffers.
self._net_forces_flat_buf: wp.array | None = None
self._force_matrix_flat_buf: wp.array | None = None
@@ -281,10 +285,8 @@ def has_contact_report(prim) -> bool:
"per body."
)
single_pose_pattern = f"{base_glob}/{body_names[0]}"
- self._pose_binding = physx_instance.create_tensor_binding(
- pattern=single_pose_pattern,
- tensor_type=TT.RIGID_BODY_POSE,
- )
+ self._root_view = OvPhysxView(physx_instance, pattern=single_pose_pattern, device=self._device)
+ self._pose_binding = self._root_view.binding_for(TT.RIGID_BODY_POSE)
if self._pose_binding.count != self._contact_binding.sensor_count:
raise RuntimeError(
"RIGID_BODY_POSE binding count mismatch."
@@ -378,7 +380,7 @@ def _update_buffers_impl(self, env_mask: wp.array | None = None) -> None:
if self.cfg.track_pose:
# Read pose into [num_envs * num_sensors, 7] float32 -> view as transformf.
- self._pose_binding.read(self._poses_flat_buf)
+ self._root_view.read_into(TT.RIGID_BODY_POSE, self._poses_flat_buf)
poses_flat = self._poses_flat_buf.view(wp.transformf)
wp.launch(
split_flat_pose_to_pos_quat,
@@ -518,4 +520,7 @@ def _invalidate_initialize_callback(self, event) -> None:
with contextlib.suppress(Exception):
self._pose_binding.destroy()
self._pose_binding = None
+ # Drop the view too: it caches the same (now-destroyed) pose binding, so leaving it set
+ # would keep a destroyed handle reachable. _initialize_impl rebuilds a fresh view on play.
+ self._root_view = None
self._physx_instance = None
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/imu/imu.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/imu/imu.py
index 0ce9539bf8ed..9292cfcd6c6a 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/imu/imu.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/imu/imu.py
@@ -16,6 +16,7 @@
import isaaclab_ovphysx.tensor_types as TT
from isaaclab_ovphysx.physics import OvPhysxManager as SimulationManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .imu_data import ImuData
from .kernels import imu_reset_kernel, imu_update_kernel
@@ -134,9 +135,10 @@ def _initialize_impl(self):
# Translate the regex-style path expression to an ovphysx fnmatch glob.
pattern = self._rigid_parent_expr.replace(".*", "*")
- self._pose_binding = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_POSE)
- self._vel_binding = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_VELOCITY)
- self._com_binding = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_COM_POSE)
+ self._root_view = OvPhysxView(physx_instance, pattern=pattern, device=self._device)
+ self._pose_binding = self._root_view.binding_for(TT.RIGID_BODY_POSE)
+ self._vel_binding = self._root_view.binding_for(TT.RIGID_BODY_VELOCITY)
+ self._com_binding = self._root_view.binding_for(TT.RIGID_BODY_COM_POSE)
self._num_bodies = self._pose_binding.count
if self._num_bodies != self._num_envs:
@@ -167,17 +169,27 @@ def _initialize_impl(self):
self._offset_pos_b = wp.from_torch(composed_p.contiguous(), dtype=wp.vec3f)
self._offset_quat_b = wp.from_torch(composed_q.contiguous(), dtype=wp.quatf)
+ def _invalidate_initialize_callback(self, event) -> None:
+ """Drop the OVPhysX view and bindings when physics stops."""
+ super()._invalidate_initialize_callback(event)
+ # Drop the view (and the bindings it caches) so a stale/destroyed handle is not held
+ # across the reset; ``_initialize_impl`` rebuilds a fresh view on the next play.
+ self._root_view = None
+ self._pose_binding = None
+ self._vel_binding = None
+ self._com_binding = None
+
def _update_buffers_impl(self, env_mask: wp.array | None = None):
"""Fills the buffers of the sensor data."""
env_mask = self._resolve_indices_and_mask(None, env_mask)
- # ovphysx ``binding.read(dst)`` writes into the pre-allocated dst buffer;
- # ``_*_view`` are float32 aliases of the structured-dtype buffers below.
- self._pose_binding.read(self._transforms_view)
- self._vel_binding.read(self._velocities_view)
+ # ``read_into`` fills the structured-dtype destination in place through a cached
+ # float32 reinterpret of the binding's flat shape (no extra copy).
+ self._root_view.read_into(TT.RIGID_BODY_POSE, self._transforms)
+ self._root_view.read_into(TT.RIGID_BODY_VELOCITY, self._velocities)
# RIGID_BODY_COM_POSE is a CPU tensor type in the OVPhysX wheel.
- # For GPU simulations, stage on CPU then copy into the kernel buffer.
- self._com_binding.read(self._coms_read_view)
+ # For GPU simulations, stage on a pinned CPU buffer then copy into the kernel buffer.
+ self._root_view.read_into(TT.RIGID_BODY_COM_POSE, self._coms_read_view)
if self._coms_read_view is not self._coms_gpu_view:
wp.copy(self._coms_gpu_view, self._coms_read_view)
@@ -212,25 +224,16 @@ def _initialize_buffers_impl(self):
self._offset_pos_b = wp.from_torch(offset_pos_torch.contiguous(), dtype=wp.vec3f)
self._offset_quat_b = wp.from_torch(offset_quat_torch.contiguous(), dtype=wp.quatf)
- # Structured-dtype buffers consumed by the kernel.
+ # Structured-dtype buffers consumed by the kernel. ``read_into`` fills the GPU-resident
+ # pose/velocity buffers directly, building and caching the float32 reinterpret itself.
self._transforms = wp.zeros(self._num_bodies, dtype=wp.transformf, device=self._device)
self._velocities = wp.zeros(self._num_bodies, dtype=wp.spatial_vectorf, device=self._device)
self._coms_buffer = wp.zeros(self._num_bodies, dtype=wp.transformf, device=self._device)
- self._transforms_view = wp.array(
- ptr=self._transforms.ptr,
- shape=self._pose_binding.shape,
- dtype=wp.float32,
- device=self._device,
- copy=False,
- )
- self._velocities_view = wp.array(
- ptr=self._velocities.ptr,
- shape=self._vel_binding.shape,
- dtype=wp.float32,
- device=self._device,
- copy=False,
- )
+ # RIGID_BODY_COM_POSE is CPU-only in the OVPhysX wheel. ``read_into`` requires the
+ # destination on the binding's native device (cpu), so on a GPU sim we read into a pinned
+ # CPU buffer and copy into the GPU kernel buffer; on a CPU sim the two alias and the copy
+ # is skipped. ``_coms_gpu_view`` stays a flat float32 view so the copy dtype matches.
self._coms_gpu_view = wp.array(
ptr=self._coms_buffer.ptr,
shape=self._com_binding.shape,
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/joint_wrench/joint_wrench_sensor.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/joint_wrench/joint_wrench_sensor.py
index 29150513e28f..41106e0f3b01 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/joint_wrench/joint_wrench_sensor.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/joint_wrench/joint_wrench_sensor.py
@@ -22,6 +22,7 @@
import isaaclab_ovphysx.tensor_types as TT
from isaaclab_ovphysx.physics import OvPhysxManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .joint_wrench_sensor_data import JointWrenchSensorData
from .kernels import joint_wrench_reset_kernel, joint_wrench_split_kernel
@@ -63,9 +64,9 @@ def __init__(self, cfg: JointWrenchSensorCfg):
self._data = JointWrenchSensorData()
self._physx_instance: Any = None
+ self._root_view: OvPhysxView | None = None
self._wrench_binding: Any = None
self._wrench_buf: wp.array | None = None
- self._wrench_read_view: wp.array | None = None
self._joint_pos_b: wp.array | None = None
self._joint_quat_b: wp.array | None = None
self._num_bodies: int = 0
@@ -135,9 +136,8 @@ def _initialize_impl(self) -> None:
pattern = re.sub(r"\{ENV_REGEX_NS\}", "*", root_prim_path_expr)
pattern = re.sub(r"\.\*", "*", pattern)
- self._wrench_binding = physx_instance.create_tensor_binding(
- pattern=pattern, tensor_type=TT.LINK_INCOMING_JOINT_FORCE
- )
+ self._root_view = OvPhysxView(physx_instance, pattern=pattern, device=self._device)
+ self._wrench_binding = self._root_view.binding_for(TT.LINK_INCOMING_JOINT_FORCE)
if self._wrench_binding.body_count == 0 or self._wrench_binding.count == 0:
raise RuntimeError(f"Joint wrench sensor matched zero bodies at '{self.cfg.prim_path}'.")
@@ -160,17 +160,10 @@ def _initialize_impl(self) -> None:
self._create_joint_frame_buffers()
- # Wrench storage as (N, L) spatial_vectorf; a float32 alias view targets the
- # same memory and is the buffer passed to TensorBinding.read(...). Mirrors the
- # OVPhysX Articulation pattern (see articulation_data.py:_get_read_view).
+ # Wrench storage as (N, L) spatial_vectorf, read each step via the view. The view
+ # reinterprets this structured buffer off the binding's flat float32 shape and caches
+ # that reinterpret per destination buffer, so no manual float32 alias is needed here.
self._wrench_buf = wp.zeros((self._num_envs, self._num_bodies), dtype=wp.spatial_vectorf, device=self._device)
- self._wrench_read_view = wp.array(
- ptr=self._wrench_buf.ptr,
- shape=self._wrench_binding.shape,
- dtype=wp.float32,
- device=str(self._wrench_buf.device),
- copy=False,
- )
self._data.create_buffers(num_envs=self._num_envs, num_bodies=self._num_bodies, device=self._device)
@@ -250,7 +243,7 @@ def _update_buffers_impl(self, env_mask: wp.array) -> None:
Args:
env_mask: A mask containing which environments need to be updated. Shape is ``(num_envs,)``.
"""
- if self._wrench_binding is None or self._wrench_buf is None or self._wrench_read_view is None:
+ if self._root_view is None or self._wrench_buf is None:
raise RuntimeError(
f"Joint wrench sensor '{self.cfg.prim_path}': not initialized."
" Access sensor data only after sim.reset() has been called."
@@ -258,7 +251,7 @@ def _update_buffers_impl(self, env_mask: wp.array) -> None:
if self._joint_pos_b is None or self._joint_quat_b is None:
raise RuntimeError(f"Joint wrench sensor '{self.cfg.prim_path}': joint frame buffers are not initialized.")
- self._wrench_binding.read(self._wrench_read_view)
+ self._root_view.read_into(TT.LINK_INCOMING_JOINT_FORCE, self._wrench_buf)
wp.launch(
joint_wrench_split_kernel,
dim=(self._num_envs, self._num_bodies),
@@ -281,10 +274,10 @@ def _invalidate_initialize_callback(self, event) -> None:
event: An invalidate event.
"""
super()._invalidate_initialize_callback(event)
- # Drop the float32 alias view before the wrench buffer it aliases via raw
- # ptr: if the buffer is freed while the alias still references its memory,
- # Warp's array deallocator aborts.
- self._wrench_read_view = None
+ # Drop the view (and the binding it owns) before the wrench buffer it reads into:
+ # the view caches a float32 reinterpret of that buffer, so releasing it first keeps
+ # Warp's array deallocator from aborting on a freed-but-still-referenced allocation.
+ self._root_view = None
self._wrench_binding = None
self._physx_instance = None
self._wrench_buf = None
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/pva/pva.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/pva/pva.py
index 7fb30e71e622..569cd5f333db 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/pva/pva.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sensors/pva/pva.py
@@ -19,6 +19,7 @@
import isaaclab_ovphysx.tensor_types as TT
from isaaclab_ovphysx.physics import OvPhysxManager as SimulationManager
+from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView
from .kernels import pva_reset_kernel, pva_update_kernel
from .pva_data import PvaData
@@ -67,7 +68,7 @@ def __init__(self, cfg: PvaCfg):
self._rigid_parent_expr: str | None = None
# Sentinel — set in :meth:`_initialize_impl`; ``None`` means the sensor has not been bound yet
# (used by :meth:`_debug_vis_callback` to safely no-op before init).
- self._pose_binding = None
+ self._root_view: OvPhysxView | None = None
def __str__(self) -> str:
"""Returns: A string containing information about the instance."""
@@ -143,10 +144,8 @@ def _initialize_impl(self):
# Translate the regex-style path expression to an ovphysx fnmatch glob.
pattern = self._rigid_parent_expr.replace(".*", "*")
- self._pose_binding = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_POSE)
- self._vel_binding = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_VELOCITY)
- self._com_binding = physx_instance.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_COM_POSE)
- self._num_bodies = self._pose_binding.count
+ self._root_view = OvPhysxView(physx_instance, pattern=pattern, device=self._device)
+ self._num_bodies = self._root_view.binding_for(TT.RIGID_BODY_POSE).count
if self._num_bodies != self._num_envs:
raise ValueError(
@@ -178,19 +177,26 @@ def _initialize_impl(self):
self._offset_pos_b = wp.from_torch(composed_p.contiguous(), dtype=wp.vec3f)
self._offset_quat_b = wp.from_torch(composed_q.contiguous(), dtype=wp.quatf)
+ def _invalidate_initialize_callback(self, event) -> None:
+ """Drop the OVPhysX view when physics stops."""
+ super()._invalidate_initialize_callback(event)
+ # Drop the view (and the bindings it caches) so a stale/destroyed handle is not held
+ # across the reset; ``_initialize_impl`` rebuilds a fresh view on the next play.
+ self._root_view = None
+
def _update_buffers_impl(self, env_mask: wp.array | None = None):
"""Fills the buffers of the sensor data."""
env_mask = self._resolve_indices_and_mask(None, env_mask)
- # ovphysx ``binding.read(dst)`` writes into the pre-allocated dst buffer;
- # ``_*_view`` are float32 aliases of the structured-dtype buffers below.
- self._pose_binding.read(self._transforms_view)
- self._vel_binding.read(self._velocities_view)
+ # ``OvPhysxView.read_into`` fills the structured-dtype buffer in place via a
+ # cached float32 reinterpret; no manual float32 alias is needed.
+ self._root_view.read_into(TT.RIGID_BODY_POSE, self._transforms)
+ self._root_view.read_into(TT.RIGID_BODY_VELOCITY, self._velocities)
# RIGID_BODY_COM_POSE is a CPU tensor type in the OVPhysX wheel.
# For GPU simulations, stage on CPU then copy into the kernel buffer.
- self._com_binding.read(self._coms_read_view)
- if self._coms_read_view is not self._coms_gpu_view:
- wp.copy(self._coms_gpu_view, self._coms_read_view)
+ self._root_view.read_into(TT.RIGID_BODY_COM_POSE, self._coms_read_view)
+ if self._coms_read_view is not self._coms_buffer:
+ wp.copy(self._coms_buffer, self._coms_read_view)
wp.launch(
pva_update_kernel,
@@ -231,36 +237,18 @@ def _initialize_buffers_impl(self):
self._offset_pos_b = wp.from_torch(offset_pos_torch.contiguous(), dtype=wp.vec3f)
self._offset_quat_b = wp.from_torch(offset_quat_torch.contiguous(), dtype=wp.quatf)
- # Structured-dtype buffers consumed by the kernel.
+ # Structured-dtype buffers filled in place by :meth:`OvPhysxView.read_into`.
self._transforms = wp.zeros(self._num_bodies, dtype=wp.transformf, device=self._device)
self._velocities = wp.zeros(self._num_bodies, dtype=wp.spatial_vectorf, device=self._device)
self._coms_buffer = wp.zeros(self._num_bodies, dtype=wp.transformf, device=self._device)
- self._transforms_view = wp.array(
- ptr=self._transforms.ptr,
- shape=self._pose_binding.shape,
- dtype=wp.float32,
- device=self._device,
- copy=False,
- )
- self._velocities_view = wp.array(
- ptr=self._velocities.ptr,
- shape=self._vel_binding.shape,
- dtype=wp.float32,
- device=self._device,
- copy=False,
- )
- self._coms_gpu_view = wp.array(
- ptr=self._coms_buffer.ptr,
- shape=self._com_binding.shape,
- dtype=wp.float32,
- device=self._device,
- copy=False,
- )
+ # RIGID_BODY_COM_POSE is CPU-resident even on a GPU sim, so its binding requires a
+ # CPU destination. On a GPU sim, stage the read into a pinned CPU buffer and copy into
+ # the kernel buffer; on a CPU sim, read straight into the kernel buffer.
if self._device == "cpu":
- self._coms_read_view = self._coms_gpu_view
+ self._coms_read_view = self._coms_buffer
else:
- self._coms_read_view = wp.zeros(self._com_binding.shape, dtype=wp.float32, device="cpu", pinned=True)
+ self._coms_read_view = wp.zeros(self._num_bodies, dtype=wp.transformf, device="cpu", pinned=True)
def _set_debug_vis_impl(self, debug_vis: bool):
if debug_vis:
@@ -273,7 +261,7 @@ def _set_debug_vis_impl(self, debug_vis: bool):
def _debug_vis_callback(self, event):
# safely return if the sensor has not been bound yet (matches the PhysX `_view is None` idiom)
- if self._pose_binding is None:
+ if self._root_view is None:
return
# get marker location
# -- base state (convert warp -> torch for visualization)
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/__init__.pyi b/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/__init__.pyi
index cbb07417da49..b771ab472dc4 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/__init__.pyi
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/__init__.pyi
@@ -5,6 +5,8 @@
__all__ = [
"OvPhysxFrameView",
+ "OvPhysxView",
]
from .ovphysx_frame_view import OvPhysxFrameView
+from .ovphysx_view import OvPhysxView
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_frame_view.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_frame_view.py
index 879ecddf385f..5965662d4209 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_frame_view.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_frame_view.py
@@ -357,6 +357,7 @@ def _initialize_impl(self, physx: Any) -> None:
``env_0`` replaced by the row's env_id.
"""
from isaaclab_ovphysx import tensor_types as TT # noqa: PLC0415
+ from isaaclab_ovphysx.sim.views.ovphysx_view import OvPhysxView # noqa: PLC0415
xform_cache = UsdGeom.XformCache(Usd.TimeCode.Default())
identity_xform7 = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]
@@ -406,8 +407,11 @@ def _initialize_impl(self, physx: Any) -> None:
# 4. Create the RIGID_BODY_POSE binding (or operate in world-only mode).
if patterns:
pattern = patterns[0]
- self._pose_binding = physx.create_tensor_binding(pattern=pattern, tensor_type=TT.RIGID_BODY_POSE)
- if self._pose_binding.shape[0] == 0:
+ self._root_view = OvPhysxView(physx, pattern=pattern, device=self._device)
+ # ``try_binding_for`` returns None for a zero-match binding (the view rejects a
+ # 0-count binding); surface that as the explicit zero-bodies error below.
+ self._pose_binding = self._root_view.try_binding_for(TT.RIGID_BODY_POSE)
+ if self._pose_binding is None:
raise RuntimeError(
f"OvPhysxFrameView: RIGID_BODY_POSE binding for pattern {pattern!r} matched zero bodies."
)
@@ -415,6 +419,7 @@ def _initialize_impl(self, physx: Any) -> None:
binding_paths: list[str] = list(self._pose_binding.prim_paths)
else:
# All prims resolved as world-attached: no binding needed; kernels only hit the -1 branch.
+ self._root_view = None
self._pose_binding = None
self._pose_buf = wp.zeros((1, 7), dtype=wp.float32, device=self._device)
binding_paths = []
@@ -613,7 +618,7 @@ def _current_body_q(self) -> wp.array:
buffer ``[num_bodies]``.
"""
if self._pose_binding is not None:
- self._pose_binding.read(self._pose_buf)
+ self._root_view.read_into("rigid_body_pose", self._pose_buf)
return self._pose_buf.view(wp.transformf)
# ------------------------------------------------------------------
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_view.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_view.py
new file mode 100644
index 000000000000..099f4309e617
--- /dev/null
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/sim/views/ovphysx_view.py
@@ -0,0 +1,704 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""String-keyed view over OVPhysX ``TensorBinding`` handles.
+
+OVPhysX exposes physics attributes as a loose ``dict[TensorType, TensorBinding]``
+with no view object -- unlike Newton's ``selection.ArticulationView`` or PhysX's
+typed tensor views. :class:`OvPhysxView` wraps those bindings for one prim pattern
+(or an explicit ``prim_paths`` list) behind a string-keyed surface that mirrors
+Newton's selection ergonomics, but is simpler: there is no ``Model``/``State``/
+``Control`` source object because the :class:`TensorType` already implies where the
+data lives.
+
+Attributes are addressed by the lowercased ``TensorType`` enum member name (derived
+directly from the wheel enum -- no hand-maintained table) or by the enum member
+itself::
+
+ view.get_attribute("articulation_dof_stiffness") # allocates and returns
+ view.read_into("articulation_root_pose", root_pose_buf) # zero-copy into a caller buffer
+ view.set_attribute("rigid_body_pose", values, mask=env_mask)
+
+Design intent: be usable as the binding-management layer *inside* the OVPhysX asset
+classes (see ``docs/superpowers/specs/2026-06-17-ovphysx-view-design.md`` §6), so it
+exposes a raw :meth:`binding_for` accessor and a zero-copy :meth:`read_into` that
+fills a caller-owned, possibly structured-dtype buffer via a ``float32`` reinterpret
+view -- the same mechanism the data containers use today.
+
+**Device policy: no implicit CPU<->GPU conversion.** OVPhysX serves DOF/body
+*property* tensor types from CPU memory even on a GPU sim (see :data:`_CPU_ONLY_NAMES`),
+while *state* tensor types are device-resident. This view reads/writes each binding on
+its native device and **raises** :class:`OvPhysxView.DeviceMismatch` if a caller hands
+it a buffer on the wrong device. Staging a CPU property to/from the simulation device
+is the caller's explicit responsibility, never hidden here.
+
+**Dtype: float32 only (interim).** The wheel's ``TensorBinding.read``/``write`` are
+float32-only and expose no dtype metadata, so this view treats every binding as ``float32``
+(the structured dtypes in :data:`_ATTR_DTYPE`, e.g. ``wp.transformf``, are byte-compatible
+views over float32, not a different scalar type). Every ``TensorType`` in the current wheel
+is float32; a future non-float binding (e.g. a ``uint8``/``bool`` control tensor) could not be
+read correctly here until the wheel exposes dtype metadata. Rather than guess a dtype-supported
+subset, the public surface (:attr:`~OvPhysxView.attribute_names`) deliberately stays at
+name-validity; narrowing it to a dtype-aware subset is deferred to wheel dtype metadata
+(design doc §7 ask).
+"""
+
+from __future__ import annotations
+
+import logging
+import math
+from typing import Any, Protocol
+
+import warp as wp
+
+from isaaclab_ovphysx._runtime import import_ovphysx
+from isaaclab_ovphysx.tensor_types import _CPU_ONLY_TYPES
+
+logger = logging.getLogger(__name__)
+
+# Pure-Python enum (no native dependency); safe to import regardless of USD state.
+TensorType = import_ovphysx("ovphysx.types").TensorType
+
+# Tensor types that cannot be written. The first group is read-only by PhysX
+# convention (accelerations, inverse mass/inertia, projected joint force); the
+# computed-dynamics group (jacobian, mass matrix, coriolis, gravity) is read-only
+# in practice.
+#
+# TEMPORARY: this is a hand-maintained table and WILL drift as ``TensorType`` grows.
+# The wheel has at least three access modes in practice -- read/write, read-only, and
+# write-only control tensors -- and exposes no access metadata today. Replace this whole
+# table once the wheel exposes a per-type ``access_mode`` enum (preferred over a boolean
+# ``is_writable`` flag, so write-only control tensors stay distinguishable).
+# TODO(ovphysx): source access mode from a wheel ``access_mode`` query (design doc §7 ask 3).
+_READ_ONLY_NAMES: frozenset[str] = frozenset(
+ {
+ "rigid_body_acceleration",
+ "rigid_body_inv_mass",
+ "rigid_body_inv_inertia",
+ "articulation_link_acceleration",
+ "articulation_body_inv_mass",
+ "articulation_body_inv_inertia",
+ "articulation_dof_projected_joint_force",
+ "articulation_jacobian",
+ "articulation_mass_matrix",
+ "articulation_coriolis_and_centrifugal_force",
+ "articulation_gravity_force",
+ }
+)
+
+# DOF/body property tensor types that are CPU-resident even on a GPU sim. Derived
+# from the canonical, wheel-availability-gated set in ``isaaclab_ovphysx.tensor_types``
+# so the two never drift.
+_CPU_ONLY_NAMES: frozenset[str] = frozenset(tt.name.lower() for tt in _CPU_ONLY_TYPES)
+
+# Structured Warp dtype for attributes whose flat trailing dimension has a fixed semantic
+# layout: 7-float poses -> ``wp.transformf``, 6-float spatial vectors -> ``wp.spatial_vectorf``.
+# :meth:`OvPhysxView.get_attribute` returns an array of this dtype, so callers get a typed
+# ``[N, ...]`` array rather than a flat ``[N, ..., k]`` float32 one. Attributes absent from this
+# map default to flat ``float32``. The wheel exposes only flat float32 shapes, so this map is
+# hand-maintained.
+# TODO(ovphysx): source structured layouts from a wheel dtype query if one is added.
+_ATTR_DTYPE: dict[str, Any] = {
+ "articulation_root_pose": wp.transformf,
+ "articulation_link_pose": wp.transformf,
+ "articulation_body_com_pose": wp.transformf,
+ "rigid_body_pose": wp.transformf,
+ "rigid_body_com_pose": wp.transformf,
+ "articulation_root_velocity": wp.spatial_vectorf,
+ "articulation_link_velocity": wp.spatial_vectorf,
+ "articulation_link_acceleration": wp.spatial_vectorf,
+ "articulation_link_incoming_joint_force": wp.spatial_vectorf,
+ "rigid_body_velocity": wp.spatial_vectorf,
+ "rigid_body_acceleration": wp.spatial_vectorf,
+}
+
+
+class _BindingLike(Protocol):
+ """Structural type of an ovphysx ``TensorBinding`` as used by this view.
+
+ ``read`` fills the passed array in place; ``write`` consumes ``indices``/``mask``
+ for partial writes. ``shape`` is the binding's flat tensor shape; ``count`` is the
+ number of matched prims.
+ """
+
+ shape: tuple[int, ...]
+ count: int
+ prim_paths: list[str]
+ dof_names: list[str]
+ body_names: list[str]
+ joint_names: list[str]
+ dof_count: int
+ body_count: int
+ joint_count: int
+ is_fixed_base: bool
+ fixed_tendon_count: int
+ spatial_tendon_count: int
+
+ def read(self, tensor: wp.array) -> None: ...
+
+ def write(self, tensor: wp.array, indices: wp.array | None = None, mask: wp.array | None = None) -> None: ...
+
+
+class _PhysXLike(Protocol):
+ """Structural type of the ovphysx ``PhysX`` instance this view depends on."""
+
+ def create_tensor_binding(self, *, tensor_type: Any, pattern: str = ..., prim_paths: list[str] = ...) -> Any: ...
+
+
+# -----------------------------------------------------------------------------
+# Pure helpers (no native simulation required; testable against ``ovphysx.types``)
+# -----------------------------------------------------------------------------
+
+
+def attribute_vocabulary() -> list[str]:
+ """Return every valid attribute name (sorted lowercased ``TensorType`` members)."""
+ return sorted(t.name.lower() for t in TensorType if t.name != "INVALID")
+
+
+def resolve_tensor_type(name: str) -> Any:
+ """Resolve a lowercased attribute name to its :class:`TensorType` member.
+
+ Args:
+ name: Lowercased enum name, e.g. ``"articulation_dof_stiffness"``.
+
+ Returns:
+ The matching :class:`TensorType` member.
+
+ Raises:
+ OvPhysxView.UnknownAttribute: If the name is not an addressable ``TensorType``.
+ """
+ try:
+ tt = TensorType[name.upper()]
+ except KeyError:
+ raise OvPhysxView.UnknownAttribute(
+ f"Unknown attribute {name!r}. Valid names are the lowercased TensorType members, "
+ f"e.g. {attribute_vocabulary()[:4]} ... ({len(attribute_vocabulary())} total)."
+ ) from None
+ if tt.name == "INVALID":
+ raise OvPhysxView.UnknownAttribute(f"{name!r} is not an addressable attribute.")
+ return tt
+
+
+def tensor_type_name(tensor_type: Any) -> str:
+ """Return the canonical lowercased name of a :class:`TensorType` member."""
+ return tensor_type.name.lower()
+
+
+def is_read_only(name: str) -> bool:
+ """Return whether an attribute name is read-only (cannot be written)."""
+ return name.lower() in _READ_ONLY_NAMES
+
+
+def is_cpu_only(name: str) -> bool:
+ """Return whether an attribute is CPU-resident even on a GPU simulation."""
+ return name.lower() in _CPU_ONLY_NAMES
+
+
+# -----------------------------------------------------------------------------
+# The view
+# -----------------------------------------------------------------------------
+
+
+class OvPhysxView:
+ """A string-keyed, generic view over OVPhysX ``TensorBinding`` handles for one prim set.
+
+ Args:
+ physx: The OVPhysX ``PhysX`` instance exposing ``create_tensor_binding``.
+ pattern: An fnmatch glob selecting the prims this view addresses. Mutually
+ exclusive with ``prim_paths``.
+ device: Simulation device (e.g. ``"cuda:0"`` or ``"cpu"``). State bindings are
+ read/written on this device; CPU-only property bindings always use ``"cpu"``.
+ prim_paths: An explicit list of fnmatch globs for the fused multi-prim binding
+ form (``create_tensor_binding(prim_paths=[...])``). Mutually exclusive with
+ ``pattern``.
+ key_aliases: Optional mapping ``requested_type -> created_type`` so a binding can
+ be stored under a different :class:`TensorType` key than the one created
+ (e.g. a ``RigidObjectCollection`` stores ``rigid_body_pose`` under ``link_pose``).
+ This is an **internal IsaacLab adapter** for the fused-collection binding path, not
+ a general public API: the requested key and the created binding type deliberately
+ differ, so a caller reasoning from the visible key can get different runtime
+ semantics. A public form would instead carry descriptor metadata (requested key,
+ source tensor type, shape, native device, access mode); that is deferred to
+ wheel-exposed metadata (design doc §7 ask). Prefer not to rely on it outside the
+ collection adapter.
+ tensor_types: Explicit set of :class:`TensorType` members to instantiate eagerly.
+ Used only when ``eager`` is set; defaults to every applicable type.
+ eager: If ``True``, create bindings up front and raise if none could be created.
+ Defaults to ``False`` (lazy: bindings are created on first access).
+ """
+
+ class OvPhysxViewError(RuntimeError):
+ """Base class for all errors raised by :class:`OvPhysxView`."""
+
+ class UnknownAttribute(OvPhysxViewError):
+ """The attribute name does not resolve to an addressable ``TensorType``."""
+
+ class ReadOnlyAttribute(OvPhysxViewError):
+ """A write was attempted on a read-only attribute."""
+
+ class AttributeUnavailable(OvPhysxViewError):
+ """No binding could be created for the attribute on this view's prims."""
+
+ class ShapeMismatch(OvPhysxViewError):
+ """A supplied buffer does not match the binding's element count."""
+
+ class DtypeMismatch(OvPhysxViewError):
+ """A supplied buffer's scalar element type is not ``float32``."""
+
+ class DeviceMismatch(OvPhysxViewError):
+ """A supplied buffer is on a different device than the binding requires."""
+
+ def __init__(
+ self,
+ physx: _PhysXLike,
+ pattern: str | None = None,
+ device: str = "cpu",
+ *,
+ prim_paths: list[str] | None = None,
+ key_aliases: dict[Any, Any] | None = None,
+ tensor_types: list[Any] | None = None,
+ eager: bool = False,
+ ) -> None:
+ if (pattern is None) == (prim_paths is None):
+ raise ValueError("Provide exactly one of 'pattern' or 'prim_paths'.")
+ if pattern is not None and not pattern:
+ raise ValueError("'pattern' must be a non-empty glob string.")
+ if prim_paths is not None and not prim_paths:
+ raise ValueError("'prim_paths' must contain at least one glob.")
+ if tensor_types is not None and not eager:
+ raise ValueError("'tensor_types' is only honored with eager=True; pass eager=True or omit it.")
+ self._physx = physx
+ self._pattern = pattern
+ self._prim_paths = prim_paths
+ # Canonicalize the device so a "cuda" alias compares equal to a buffer's "cuda:0"
+ # (warp canonicalizes buffer devices). Fall back to the raw string when the device
+ # cannot be resolved here (e.g. constructing a cuda view on a CPU-only CI box) -- the
+ # string is only used for comparison, so construction must not fail on it.
+ try:
+ self._device = str(wp.get_device(device))
+ except Exception: # noqa: BLE001 -- unresolvable device: keep the raw string for comparison
+ self._device = device
+ # Normalize key_aliases to TensorType members (accepts str names too) so string keys are
+ # honored rather than silently dropped, and reject aliases that cross the CPU/GPU residency
+ # or read-only boundary -- the device and read-only guards key on the requested type.
+ self._key_aliases: dict[Any, Any] = {}
+ for requested_type, created_type in (key_aliases or {}).items():
+ req_tt, made_tt = self._resolve(requested_type), self._resolve(created_type)
+ if (req_tt in _CPU_ONLY_TYPES) != (made_tt in _CPU_ONLY_TYPES):
+ raise ValueError(
+ f"key_alias {tensor_type_name(req_tt)!r} -> {tensor_type_name(made_tt)!r} crosses the "
+ "CPU/GPU residency boundary; the device policy would apply to the wrong type."
+ )
+ if is_read_only(tensor_type_name(req_tt)) != is_read_only(tensor_type_name(made_tt)):
+ raise ValueError(
+ f"key_alias {tensor_type_name(req_tt)!r} -> {tensor_type_name(made_tt)!r} mixes a read-only "
+ "and a writable type."
+ )
+ self._key_aliases[req_tt] = made_tt
+ self._bindings: dict[Any, Any] = {}
+ # Cache of float32 reinterpret views for read_into / get_attribute, keyed by the
+ # destination buffer's id(). Reusing the same reinterpret object across calls keeps the
+ # wheel's object-identity read cache (the TensorBinding.read fast path) warm.
+ self._read_views: dict[int, wp.array] = {}
+
+ if eager:
+ explicit = tensor_types is not None
+ requested = tensor_types if explicit else [t for t in TensorType if t.name != "INVALID"]
+ for tt in requested:
+ try:
+ self._binding(self._resolve(tt))
+ except OvPhysxView.AttributeUnavailable:
+ if explicit:
+ raise # caller named this exact type; surface the failure rather than drop it
+ logger.debug("eager binding skipped for %s", tt) # default sweep: skip inapplicable types
+ if not self._bindings:
+ raise OvPhysxView.AttributeUnavailable(
+ f"Could not create any bindings for {self._target_repr()}; "
+ "the pattern/prim_paths likely match no prims."
+ )
+
+ # -- core: string-keyed get / set / read-into ------------------------------
+
+ def get_attribute(self, name: str | Any, *, out: wp.array | None = None) -> wp.array:
+ """Read the full attribute tensor.
+
+ Reads are full-array (the wheel exposes no selective read); index into the
+ returned tensor for a subset.
+
+ Args:
+ name: Lowercased ``TensorType`` name or the member itself.
+ out: Optional destination buffer to fill (must be on the binding's native
+ device and match its element count). If omitted, a freshly allocated
+ :class:`warp.array` on the native device is returned.
+
+ Returns:
+ A :class:`warp.array` holding the attribute values, on the attribute's native
+ device -- ``cpu`` for CPU-only property types even on a GPU sim (see
+ :func:`is_cpu_only`). When ``out`` is omitted this is a fresh, caller-owned array;
+ its dtype is the attribute's structured Warp dtype when it has one (e.g.
+ ``wp.transformf`` for poses, ``wp.spatial_vectorf`` for velocities) and flat
+ ``float32`` otherwise (see :data:`_ATTR_DTYPE`).
+ """
+ tt = self._resolve(name)
+ binding = self._binding(tt)
+ device = self._native_device(tt)
+ if out is not None:
+ self._check_device(out, device, tensor_type_name(tt), "destination")
+ binding.read(self._read_view(out, binding))
+ return out
+ alloc_shape, dtype = self._attribute_dtype(tt, binding)
+ buf = wp.zeros(alloc_shape, dtype=dtype, device=device)
+ # ``buf`` is freshly allocated here, so it is never a persistent destination: route it
+ # through ``_as_binding_view`` directly rather than ``_read_view``. Caching by ``id(buf)``
+ # could never hit on a later call and would leak one entry (and keep ``buf`` alive) per
+ # call in a step loop -- the read cache only pays off for a reused ``out``/``dst`` buffer.
+ binding.read(self._as_binding_view(buf, binding, "destination"))
+ return buf
+
+ def read_into(self, name: str | Any, dst: wp.array) -> None:
+ """Fill ``dst`` in place from the attribute binding (zero-copy).
+
+ ``dst`` may be a structured-dtype buffer (e.g. ``wp.transformf``); it is read
+ through a ``float32`` reinterpret view that matches the binding's flat shape, so
+ the structured GPU/CPU buffer is filled directly with no extra copy. This is the
+ path the asset data containers use. The reinterpret view for a given ``dst`` is
+ built once and reused across calls (see :meth:`_read_view`) so the wheel's
+ object-identity read cache stays warm -- callers can pass the structured buffer
+ directly each step without maintaining their own reinterpret cache.
+
+ Args:
+ name: Lowercased ``TensorType`` name or the member itself.
+ dst: Caller-owned buffer on the binding's native device whose element count
+ matches the binding.
+
+ Raises:
+ OvPhysxView.DeviceMismatch: If ``dst`` is not on the binding's native device.
+ OvPhysxView.DtypeMismatch: If ``dst``'s scalar element type is not ``float32``.
+ OvPhysxView.ShapeMismatch: If ``dst`` is non-contiguous or its element count does not match.
+ """
+ tt = self._resolve(name)
+ binding = self._binding(tt)
+ self._check_device(dst, self._native_device(tt), tensor_type_name(tt), "destination")
+ binding.read(self._read_view(dst, binding))
+
+ def set_attribute(
+ self,
+ name: str | Any,
+ values: wp.array,
+ *,
+ indices: wp.array | None = None,
+ mask: wp.array | None = None,
+ ) -> None:
+ """Write a full attribute tensor; ``indices``/``mask`` select which rows apply.
+
+ ``values`` may be a structured-dtype buffer (read through a ``float32``
+ reinterpret view). If both ``indices`` and ``mask`` are given, ``mask`` wins and
+ the wheel emits a ``UserWarning`` -- this view forwards both verbatim to
+ ``TensorBinding.write`` and does not implement the precedence itself.
+
+ Args:
+ name: Lowercased ``TensorType`` name or the member itself.
+ values: Source buffer on the binding's native device, matching its element count.
+ indices: Optional integer row indices to write.
+ mask: Optional boolean row mask to write.
+
+ Raises:
+ OvPhysxView.ReadOnlyAttribute: If the attribute is read-only.
+ OvPhysxView.DeviceMismatch: If ``values`` is not on the binding's native device.
+ OvPhysxView.DtypeMismatch: If ``values``' scalar element type is not ``float32``.
+ OvPhysxView.ShapeMismatch: If ``values`` is non-contiguous or its element count does not match.
+ """
+ tt = self._resolve(name)
+ attr = tensor_type_name(tt)
+ if attr in _READ_ONLY_NAMES:
+ raise OvPhysxView.ReadOnlyAttribute(f"Attribute {attr!r} is read-only and cannot be written.")
+ binding = self._binding(tt)
+ device = self._native_device(tt)
+ src = self._as_wp(values, device)
+ self._check_device(src, device, attr, "source")
+ binding.write(self._as_binding_view(src, binding, "source"), indices=indices, mask=mask)
+
+ # -- raw binding access (for asset/data-container adoption) ----------------
+
+ def binding_for(self, name: str | Any) -> _BindingLike:
+ """Return the underlying ``TensorBinding`` for an attribute, creating it on first use.
+
+ This is a raw escape hatch for asset-internal binding management: the returned
+ binding's ``read``/``write`` **bypass** the view's device, dtype-reinterpret, shape,
+ and read-only guards. Prefer :meth:`get_attribute` / :meth:`read_into` /
+ :meth:`set_attribute` unless you are deliberately managing bindings directly.
+ """
+ return self._binding(self._resolve(name))
+
+ def try_binding_for(self, name: str | Any) -> _BindingLike | None:
+ """Like :meth:`binding_for`, but return ``None`` instead of raising when the attribute
+ is valid yet **not available for this view's prims** (e.g. tendon types on a
+ tendon-less articulation, or a not-yet-created optional binding).
+
+ An invalid *name* still raises :class:`UnknownAttribute` -- that is a programming
+ error, not an availability question. Use this for the asset's ``binding or None``
+ pattern over optional bindings.
+ """
+ try:
+ return self._binding(self._resolve(name))
+ except OvPhysxView.AttributeUnavailable:
+ return None
+
+ # -- discoverability -------------------------------------------------------
+
+ @property
+ def attribute_names(self) -> list[str]:
+ """Every valid attribute name (the full ``TensorType`` vocabulary).
+
+ This is name *validity*, not availability for this view's prims -- a rigid-body view
+ still lists ``"articulation_*"`` names. Use :attr:`available_attributes` for what is
+ actually instantiated.
+
+ .. note::
+ A listed name is **not** a promise of correct dtype handling. The view is
+ float32-only (see the module docstring); every ``TensorType`` in the current wheel
+ is float32, but a future non-float binding would still be listed here yet not be
+ correctly readable until the wheel exposes dtype metadata. Filtering this to a
+ dtype-aware supported subset is deferred to that metadata (design doc §7 ask).
+ """
+ return attribute_vocabulary()
+
+ @property
+ def available_attributes(self) -> list[str]:
+ """Names with a live binding instantiated for this view's prims."""
+ return sorted(tensor_type_name(tt) for tt in self._bindings)
+
+ def has_attribute(self, name: str | Any) -> bool:
+ """Return whether ``name`` is a valid attribute name (resolves to a ``TensorType``).
+
+ This checks name *validity* for any view, not availability for these prims: it can
+ return ``True`` for a name whose binding does not apply to this view's prims (in which
+ case :meth:`get_attribute` raises :class:`AttributeUnavailable`). It likewise does not
+ promise dtype support -- the view is float32-only (see :attr:`attribute_names`).
+ """
+ try:
+ self._resolve(name)
+ except OvPhysxView.UnknownAttribute:
+ return False
+ return True
+
+ def __contains__(self, name: str | Any) -> bool:
+ return self.has_attribute(name)
+
+ # -- metadata passthrough (from a sample binding) --------------------------
+
+ @property
+ def count(self) -> int:
+ """Number of prims matched by this view."""
+ return self._sample().count
+
+ @property
+ def prim_paths(self) -> list[str]:
+ """USD paths of the prims matched by this view."""
+ return list(self._sample().prim_paths)
+
+ @property
+ def dof_names(self) -> list[str]:
+ """Per-articulation DOF names (articulation views only)."""
+ return list(self._sample().dof_names)
+
+ @property
+ def body_names(self) -> list[str]:
+ """Per-articulation body (link) names (articulation views only)."""
+ return list(self._sample().body_names)
+
+ @property
+ def joint_names(self) -> list[str]:
+ """Per-articulation joint names (articulation views only)."""
+ return list(self._sample().joint_names)
+
+ @property
+ def dof_count(self) -> int:
+ """Number of DOFs per articulation (articulation views only)."""
+ return self._sample().dof_count
+
+ @property
+ def body_count(self) -> int:
+ """Number of bodies (links) per articulation (articulation views only)."""
+ return self._sample().body_count
+
+ @property
+ def joint_count(self) -> int:
+ """Number of joints per articulation (articulation views only)."""
+ return self._sample().joint_count
+
+ @property
+ def is_fixed_base(self) -> bool:
+ """Whether the articulation has a fixed base (articulation views only)."""
+ return self._sample().is_fixed_base
+
+ @property
+ def fixed_tendon_count(self) -> int:
+ """Number of fixed tendons per articulation (articulation views only)."""
+ return self._sample().fixed_tendon_count
+
+ @property
+ def spatial_tendon_count(self) -> int:
+ """Number of spatial tendons per articulation (articulation views only)."""
+ return self._sample().spatial_tendon_count
+
+ # -- internals -------------------------------------------------------------
+
+ def _resolve(self, name: str | Any) -> Any:
+ """Resolve a string name or a ``TensorType`` member to a ``TensorType``."""
+ if isinstance(name, str):
+ return resolve_tensor_type(name)
+ if isinstance(name, TensorType):
+ if name.name == "INVALID": # mirror the string path's INVALID rejection
+ raise OvPhysxView.UnknownAttribute(f"{name!r} is not an addressable attribute.")
+ return name
+ raise OvPhysxView.UnknownAttribute(
+ f"Attribute key must be a str name or a TensorType member, got {type(name).__name__}."
+ )
+
+ def _binding(self, tensor_type: Any) -> Any:
+ """Return the cached ``TensorBinding`` for ``tensor_type``, creating it on first use."""
+ binding = self._bindings.get(tensor_type)
+ if binding is not None:
+ return binding
+ create_type = self._key_aliases.get(tensor_type, tensor_type)
+ kwargs: dict[str, Any] = {"tensor_type": create_type}
+ if self._prim_paths is not None:
+ kwargs["prim_paths"] = self._prim_paths
+ else:
+ kwargs["pattern"] = self._pattern
+ try:
+ binding = self._physx.create_tensor_binding(**kwargs)
+ except Exception as exc: # noqa: BLE001 -- wheel raises bare exceptions; surface the cause below
+ # The wheel raises both for "type not applicable to these prims" and for genuine
+ # failures (init/ABI/OOM); we can't tell them apart without a wheel-side exception
+ # type, so the underlying error is surfaced in the message (and chained) rather than
+ # hidden behind a generic "not available". TODO(ovphysx): a typed no-match error.
+ raise OvPhysxView.AttributeUnavailable(
+ f"Could not create the {tensor_type_name(tensor_type)!r} binding for "
+ f"{self._target_repr()}: create_tensor_binding raised {type(exc).__name__}: {exc}"
+ ) from exc
+ # The wheel returns a 0-count binding when nothing matches. Access ``count`` directly so a
+ # malformed binding (missing ``count``) surfaces as an error rather than a phantom no-match.
+ if binding is None or binding.count == 0:
+ raise OvPhysxView.AttributeUnavailable(
+ f"Attribute {tensor_type_name(tensor_type)!r} is not available for {self._target_repr()} "
+ "(no matching prims)."
+ )
+ self._bindings[tensor_type] = binding
+ return binding
+
+ def _sample(self) -> Any:
+ """Return any instantiated binding to read view-level metadata from."""
+ if not self._bindings:
+ raise OvPhysxView.AttributeUnavailable(
+ "No bindings instantiated yet; access an attribute (or construct with eager=True) "
+ "before reading view metadata."
+ )
+ return next(iter(self._bindings.values()))
+
+ def _native_device(self, tensor_type: Any) -> str:
+ """Device a buffer for ``tensor_type`` must live on (CPU for CPU-only types)."""
+ return "cpu" if tensor_type in _CPU_ONLY_TYPES else self._device
+
+ def _check_device(self, arr: wp.array, device: str, attr: str, role: str) -> None:
+ """Raise if ``arr`` is not on the binding's native device (no implicit conversion)."""
+ if str(arr.device) != device:
+ raise OvPhysxView.DeviceMismatch(
+ f"{role} for {attr!r} must be on device {device!r}, got {str(arr.device)!r}. "
+ "OvPhysxView does not stage between CPU and GPU; move the buffer yourself."
+ )
+
+ def _as_binding_view(self, arr: wp.array, binding: Any, role: str) -> wp.array:
+ """Return a ``float32`` view of ``arr`` matching the binding's flat shape.
+
+ ``arr`` must have a ``float32`` scalar element type (``float32`` itself or a
+ composite built on it, e.g. ``wp.transformf``/``wp.vec3f``): the view
+ **reinterprets bits, not values**, so a non-``float32`` dtype (``int32``,
+ ``float64``, ``float16``) would corrupt the data and is rejected. Given a matching
+ scalar, validates the flat ``float32`` element count and returns ``arr`` directly
+ when it is already ``float32`` with the binding's shape, else a zero-copy
+ reinterpret view.
+ """
+ scalar = getattr(arr.dtype, "_wp_scalar_type_", arr.dtype)
+ if scalar is not wp.float32:
+ raise OvPhysxView.DtypeMismatch(
+ f"{role} must have float32 scalar elements (got dtype "
+ f"{getattr(arr.dtype, '__name__', arr.dtype)}); the view reinterprets bits, "
+ "not values, so a non-float32 dtype would silently corrupt the buffer."
+ )
+ if not arr.is_contiguous:
+ raise OvPhysxView.ShapeMismatch(
+ f"{role} must be a contiguous array; the view reinterprets the buffer's raw memory, "
+ "so a strided/sliced view would read or write the wrong elements."
+ )
+ expected = math.prod(tuple(binding.shape))
+ actual = arr.size * (wp.types.type_size_in_bytes(arr.dtype) // 4) # scalar is float32 -> exact
+ if actual != expected:
+ raise OvPhysxView.ShapeMismatch(
+ f"Shape mismatch for {role}: {actual} float32 elements, "
+ f"binding expects {expected} (shape {tuple(binding.shape)})."
+ )
+ if arr.dtype == wp.float32 and tuple(arr.shape) == tuple(binding.shape):
+ return arr
+ return wp.array(ptr=arr.ptr, shape=tuple(binding.shape), dtype=wp.float32, device=str(arr.device), copy=False)
+
+ def _read_view(self, dst: wp.array, binding: Any) -> wp.array:
+ """Return the ``float32`` view of ``dst`` to hand to ``binding.read``, reused across calls.
+
+ The wheel's ``TensorBinding.read`` has an object-identity read cache: it skips DLPack
+ acquisition and the attribute-chain lookup when handed the *same* tensor object as the
+ previous read. To keep that cache warm, the ``float32`` reinterpret of a structured
+ ``dst`` is built once and reused for that destination buffer; a pointer-staleness guard
+ rebuilds it if the buffer's backing storage moved. A ``dst`` that is already flat
+ ``float32`` is its own stable identity, so it is returned directly (and not cached).
+ """
+ cached = self._read_views.get(id(dst))
+ if cached is not None and cached.ptr == dst.ptr:
+ return cached
+ view = self._as_binding_view(dst, binding, "destination")
+ if view is not dst: # structured dst -> cache the reinterpret; a flat float32 dst caches nothing
+ self._read_views[id(dst)] = view
+ return view
+
+ def _attribute_dtype(self, tensor_type: Any, binding: Any) -> tuple[tuple[int, ...], Any]:
+ """Return ``(alloc_shape, dtype)`` for :meth:`get_attribute`.
+
+ Maps an attribute to its structured Warp dtype (see :data:`_ATTR_DTYPE`) when the
+ binding's trailing dimension matches that dtype's ``float32`` count, dropping the
+ trailing dimension from the allocation shape (e.g. ``[N, 7] -> ([N], wp.transformf)``).
+ Falls back to the flat ``float32`` shape for unmapped attributes or a mismatched layout.
+ """
+ dtype = _ATTR_DTYPE.get(tensor_type_name(tensor_type))
+ shape = tuple(binding.shape)
+ if dtype is not None and shape and shape[-1] == wp.types.type_size_in_bytes(dtype) // 4:
+ return shape[:-1], dtype
+ return shape, wp.float32
+
+ def _as_wp(self, values: Any, device: str) -> wp.array:
+ """Coerce ``values`` to a :class:`warp.array`.
+
+ A :class:`warp.array` is used as-is, keeping its own device (validated by the caller;
+ a mismatch raises and is never staged). Device-less host data (numpy arrays, lists)
+ carries no device, so it is materialized directly on ``device``.
+
+ This view is Warp-native and does **not** special-case framework tensors: bridge a
+ Torch tensor on the caller side with ``view.set_attribute(name, wp.from_torch(t))``.
+ This keeps the device policy explicit and avoids an optional Torch dependency and the
+ fragile detection a built-in conversion would require.
+ """
+ if isinstance(values, wp.array):
+ return values
+ return wp.array(values, device=device)
+
+ def _target_repr(self) -> str:
+ return f"prim_paths={self._prim_paths!r}" if self._prim_paths is not None else f"pattern={self._pattern!r}"
+
+ def __repr__(self) -> str:
+ return f"OvPhysxView({self._target_repr()}, device={self._device!r}, instantiated={len(self._bindings)})"
+
+
+# Backward-compatible module-level alias for the error base class.
+OvPhysxViewError = OvPhysxView.OvPhysxViewError
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/__init__.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/__init__.py
index 2c6c0e67ffc4..a1b56269d5ac 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/__init__.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/__init__.py
@@ -3,4 +3,4 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-from .views import MockTensorBinding, MockOvPhysxBindingSet
+from .views import MockOvPhysxBindingSet, MockOvPhysxView, MockTensorBinding
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/__init__.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/__init__.py
index 6f133a18202c..b15f32483798 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/__init__.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/__init__.py
@@ -3,4 +3,4 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-from .mock_ovphysx_bindings import MockTensorBinding, MockOvPhysxBindingSet
+from .mock_ovphysx_bindings import MockOvPhysxBindingSet, MockOvPhysxView, MockTensorBinding
diff --git a/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/mock_ovphysx_bindings.py b/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/mock_ovphysx_bindings.py
index 51e96d9bb427..603e9f448d63 100644
--- a/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/mock_ovphysx_bindings.py
+++ b/source/isaaclab_ovphysx/isaaclab_ovphysx/test/mock_interfaces/views/mock_ovphysx_bindings.py
@@ -158,6 +158,129 @@ def set_random_data(self, low: float = -1.0, high: float = 1.0) -> None:
self._data = np.random.uniform(low, high, self._shape).astype(np.float32)
+class MockOvPhysxView:
+ """Mock of :class:`~isaaclab_ovphysx.sim.views.OvPhysxView` over a dict of
+ :class:`MockTensorBinding`.
+
+ Lets a unit test inject a working ``_root_view`` into an OVPhysX asset/data class
+ without standing up the real view, a real ``PhysX``, or a USD stage. It mirrors the
+ consumed surface of ``OvPhysxView`` -- ``binding_for`` / ``try_binding_for``,
+ ``get_attribute`` / ``read_into`` / ``set_attribute``, the discoverability helpers,
+ and the metadata passthrough -- delegating reads/writes to the mock bindings, which
+ already implement ``read``/``write`` against numpy buffers.
+
+ Names resolve like the real view: pass either a :class:`TensorType` member or its
+ lowercased name (e.g. ``"articulation_dof_stiffness"``). Unlike the real view this
+ keeps everything on CPU and applies no device/dtype/read-only guards -- it is a test
+ double for the binding-routing surface, not the device policy.
+ """
+
+ def __init__(self, bindings: dict[int, MockTensorBinding]):
+ self._bindings = bindings
+
+ def _resolve(self, name):
+ """Resolve a TensorType member or its lowercased name to the member."""
+ if isinstance(name, str):
+ enum_cls = type(next(iter(self._bindings)))
+ try:
+ return enum_cls[name.upper()]
+ except KeyError:
+ raise KeyError(f"Unknown attribute {name!r}") from None
+ return name
+
+ def _sample(self) -> MockTensorBinding:
+ """A representative binding to read shared metadata from."""
+ return next(iter(self._bindings.values()))
+
+ # -- core read / write -----------------------------------------------------
+
+ def get_attribute(self, name, *, out=None):
+ """Read the full attribute tensor; fill ``out`` if given, else allocate float32."""
+ binding = self._bindings[self._resolve(name)]
+ if out is not None:
+ binding.read(out)
+ return out
+ import warp as wp
+
+ buf = wp.zeros(tuple(binding.shape), dtype=wp.float32, device="cpu")
+ binding.read(buf)
+ return buf
+
+ def read_into(self, name, dst) -> None:
+ """Fill ``dst`` in place from the attribute binding."""
+ self._bindings[self._resolve(name)].read(dst)
+
+ def set_attribute(self, name, values, *, indices=None, mask=None) -> None:
+ """Write a full attribute tensor; ``indices``/``mask`` select which rows apply."""
+ self._bindings[self._resolve(name)].write(values, indices=indices, mask=mask)
+
+ # -- raw binding access ----------------------------------------------------
+
+ def binding_for(self, name) -> MockTensorBinding:
+ """Return the underlying binding, raising ``KeyError`` if absent for these prims."""
+ return self._bindings[self._resolve(name)]
+
+ def try_binding_for(self, name) -> MockTensorBinding | None:
+ """Like :meth:`binding_for`, but return ``None`` when the attribute is absent."""
+ return self._bindings.get(self._resolve(name))
+
+ # -- discoverability -------------------------------------------------------
+
+ def has_attribute(self, name) -> bool:
+ """Return whether a binding is instantiated for ``name`` on these prims."""
+ return self._resolve(name) in self._bindings
+
+ def __contains__(self, name) -> bool:
+ return self.has_attribute(name)
+
+ @property
+ def available_attributes(self) -> list[str]:
+ """Names with a live binding (lowercased ``TensorType`` members)."""
+ return sorted(tt.name.lower() for tt in self._bindings)
+
+ # -- metadata passthrough (from a sample binding) --------------------------
+
+ @property
+ def count(self) -> int:
+ return self._sample().count
+
+ @property
+ def dof_count(self) -> int:
+ return self._sample().dof_count
+
+ @property
+ def body_count(self) -> int:
+ return self._sample().body_count
+
+ @property
+ def joint_count(self) -> int:
+ return self._sample().joint_count
+
+ @property
+ def is_fixed_base(self) -> bool:
+ return self._sample().is_fixed_base
+
+ @property
+ def dof_names(self) -> list[str]:
+ return list(self._sample().dof_names)
+
+ @property
+ def body_names(self) -> list[str]:
+ return list(self._sample().body_names)
+
+ @property
+ def joint_names(self) -> list[str]:
+ return list(self._sample().joint_names)
+
+ @property
+ def fixed_tendon_count(self) -> int:
+ return self._sample().fixed_tendon_count
+
+ @property
+ def spatial_tendon_count(self) -> int:
+ return self._sample().spatial_tendon_count
+
+
class MockOvPhysxBindingSet:
"""Factory that creates a full set of MockTensorBinding objects
for a given articulation configuration.
@@ -307,6 +430,20 @@ def __init__(
}
)
+ @property
+ def view(self) -> MockOvPhysxView:
+ """A mock :class:`OvPhysxView` over this set's bindings.
+
+ Inject as an asset's ``_root_view`` to exercise the migrated binding-routing
+ code paths without a real view or ``PhysX``. Cached so repeated access returns
+ the same object, like the single view an asset holds.
+ """
+ v = getattr(self, "_view", None)
+ if v is None:
+ v = MockOvPhysxView(self.bindings)
+ self._view = v
+ return v
+
def set_random_data(self) -> None:
"""Fill all bindings with random data."""
for b in self.bindings.values():
diff --git a/source/isaaclab_ovphysx/pyproject.toml b/source/isaaclab_ovphysx/pyproject.toml
index 9e58b1ccfb7e..46ba8f83b3a8 100644
--- a/source/isaaclab_ovphysx/pyproject.toml
+++ b/source/isaaclab_ovphysx/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab_ovphysx"
-version = "3.2.0"
+version = "5.0.0"
description = "Extension providing IsaacLab with ovphysx/TensorBindingsAPI specific abstractions."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
diff --git a/source/isaaclab_ovphysx/test/assets/test_articulation.py b/source/isaaclab_ovphysx/test/assets/test_articulation.py
index 76df62e1abba..39c22080f539 100644
--- a/source/isaaclab_ovphysx/test/assets/test_articulation.py
+++ b/source/isaaclab_ovphysx/test/assets/test_articulation.py
@@ -19,11 +19,14 @@
environment.
PhysX-specific ``cube_object.root_view.set_X(...)`` / ``get_X(...)`` calls are
-adapted to OVPhysX by going through the backend's per-tensor-type binding
-dictionary (``cube_object._bindings`` / :meth:`~isaaclab_ovphysx.assets.Articulation._get_binding`)
-and the public setters (:meth:`set_masses_index`, :meth:`set_coms_index`,
-:meth:`set_inertias_index`). Reads use the data-class properties
-(``cube_object.data.body_mass``, ``body_inertia``, ``body_com_pose_b``).
+adapted to OVPhysX by going through
+:attr:`~isaaclab_ovphysx.assets.Articulation.root_view`, an
+:class:`~isaaclab_ovphysx.sim.views.OvPhysxView` over the per-tensor-type bindings
+(``root_view.get_attribute(tensor_type)`` /
+:meth:`~isaaclab_ovphysx.assets.Articulation._get_binding`), and the public setters
+(:meth:`set_masses_index`, :meth:`set_coms_index`, :meth:`set_inertias_index`).
+Reads use the data-class properties (``cube_object.data.body_mass``,
+``body_inertia``, ``body_com_pose_b``).
Process-global device lock
--------------------------
@@ -51,7 +54,6 @@
import sys
-import numpy as np
import pytest
import torch
import warp as wp
@@ -94,26 +96,25 @@
_MATERIAL_GAP_REASON = (
"Requires a ``RIGID_BODY_MATERIAL`` TensorType (or a view-helper) on the "
- "ovphysx wheel side. ``Articulation.root_view`` is a per-tensor-type "
- "bindings dict on OVPhysX, so ``root_view.get_material_properties()`` / "
+ "ovphysx wheel side. ``Articulation.root_view`` is an ``OvPhysxView`` over "
+ "the per-tensor-type bindings on OVPhysX, so ``root_view.get_material_properties()`` / "
"``set_material_properties()`` / ``max_shapes`` are not available. See "
"docs/superpowers/specs/2026-04-28-ovphysx-wheel-gaps-for-marco.md."
)
def _read_binding_to_torch(articulation: Articulation, tensor_type: int, device: str | torch.device) -> torch.Tensor:
- """Read an OVPhysX TensorBinding into a torch tensor on *device*.
+ """Read an OVPhysX attribute into a torch tensor on *device*.
Test-side adapter for the verbatim PhysX mirror. PhysX cross-checks the
data class against the simulation via ``articulation.root_view.get_X()``
- accessors; on OVPhysX, ``root_view`` is a per-tensor-type bindings dict
- (no view-level getters), so we read the binding directly into a CPU
- numpy buffer (CPU-only types) and move the result to *device*.
+ accessors; on OVPhysX we go through the equivalent
+ :meth:`~isaaclab_ovphysx.sim.views.OvPhysxView.get_attribute`, which returns a
+ freshly allocated ``float32`` array on the attribute's native device (CPU for
+ CPU-only property types), then move the result to *device*.
"""
- binding = articulation.root_view[tensor_type]
- np_buf = np.zeros(binding.shape, dtype=np.float32)
- binding.read(np_buf)
- return torch.from_numpy(np_buf).to(device)
+ arr = articulation.root_view.get_attribute(tensor_type)
+ return wp.to_torch(arr).to(device)
# Session-locked device. Set on the first parametrized test that runs and
@@ -365,15 +366,17 @@ def test_initialization_floating_base_non_root(sim, num_articulations, device, a
# Cross-check binding shapes against cached counts. PhysX does this via
# ``root_view.max_dofs == shared_metatype.dof_count``; on OVPhysX
- # ``root_view`` is the per-tensor-type bindings dict, so the equivalent
+ # ``root_view`` is an ``OvPhysxView`` over the per-tensor-type bindings, so the equivalent
# invariant is that each per-DOF / per-link binding's shape agrees with
# the count cached on the asset.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# Body-name ordering check is degenerate on OVPhysX: ``body_names`` is
# sourced from binding metadata (``sample.body_names``), so the PhysX
# ``link_paths[0]`` round-trip is a no-op here and is omitted.
@@ -428,15 +431,17 @@ def test_initialization_floating_base(sim, num_articulations, device, add_ground
# Cross-check binding shapes against cached counts. PhysX does this via
# ``root_view.max_dofs == shared_metatype.dof_count``; on OVPhysX
- # ``root_view`` is the per-tensor-type bindings dict, so the equivalent
+ # ``root_view`` is an ``OvPhysxView`` over the per-tensor-type bindings, so the equivalent
# invariant is that each per-DOF / per-link binding's shape agrees with
# the count cached on the asset.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# Body-name ordering check is degenerate on OVPhysX: ``body_names`` is
# sourced from binding metadata (``sample.body_names``), so the PhysX
# ``link_paths[0]`` round-trip is a no-op here and is omitted.
@@ -490,15 +495,17 @@ def test_initialization_fixed_base(sim, num_articulations, device):
# Cross-check binding shapes against cached counts. PhysX does this via
# ``root_view.max_dofs == shared_metatype.dof_count``; on OVPhysX
- # ``root_view`` is the per-tensor-type bindings dict, so the equivalent
+ # ``root_view`` is an ``OvPhysxView`` over the per-tensor-type bindings, so the equivalent
# invariant is that each per-DOF / per-link binding's shape agrees with
# the count cached on the asset.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# Body-name ordering check is degenerate on OVPhysX: ``body_names`` is
# sourced from binding metadata (``sample.body_names``), so the PhysX
# ``link_paths[0]`` round-trip is a no-op here and is omitted.
@@ -561,15 +568,17 @@ def test_initialization_fixed_base_single_joint(sim, num_articulations, device,
# Cross-check binding shapes against cached counts. PhysX does this via
# ``root_view.max_dofs == shared_metatype.dof_count``; on OVPhysX
- # ``root_view`` is the per-tensor-type bindings dict, so the equivalent
+ # ``root_view`` is an ``OvPhysxView`` over the per-tensor-type bindings, so the equivalent
# invariant is that each per-DOF / per-link binding's shape agrees with
# the count cached on the asset.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# Body-name ordering check is degenerate on OVPhysX: ``body_names`` is
# sourced from binding metadata (``sample.body_names``), so the PhysX
# ``link_paths[0]`` round-trip is a no-op here and is omitted.
@@ -634,11 +643,13 @@ def test_initialization_hand_with_tendons(sim, num_articulations, device):
# PhysX ``root_view.max_dofs == shared_metatype.dof_count`` identity is
# replaced with binding-shape checks on OVPhysX.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# -- actuator type
for actuator_name, actuator in articulation.actuators.items():
is_implicit_model_cfg = isinstance(articulation_cfg.actuators[actuator_name], ImplicitActuatorCfg)
@@ -690,15 +701,17 @@ def test_initialization_floating_base_made_fixed_base(sim, num_articulations, de
# Cross-check binding shapes against cached counts. PhysX does this via
# ``root_view.max_dofs == shared_metatype.dof_count``; on OVPhysX
- # ``root_view`` is the per-tensor-type bindings dict, so the equivalent
+ # ``root_view`` is an ``OvPhysxView`` over the per-tensor-type bindings, so the equivalent
# invariant is that each per-DOF / per-link binding's shape agrees with
# the count cached on the asset.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# Body-name ordering check is degenerate on OVPhysX: ``body_names`` is
# sourced from binding metadata (``sample.body_names``), so the PhysX
# ``link_paths[0]`` round-trip is a no-op here and is omitted.
@@ -756,15 +769,17 @@ def test_initialization_fixed_base_made_floating_base(sim, num_articulations, de
# Cross-check binding shapes against cached counts. PhysX does this via
# ``root_view.max_dofs == shared_metatype.dof_count``; on OVPhysX
- # ``root_view`` is the per-tensor-type bindings dict, so the equivalent
+ # ``root_view`` is an ``OvPhysxView`` over the per-tensor-type bindings, so the equivalent
# invariant is that each per-DOF / per-link binding's shape agrees with
# the count cached on the asset.
for tt in (TT.DOF_POSITION, TT.DOF_VELOCITY, TT.DOF_STIFFNESS):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_joints
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_joints
for tt in (TT.BODY_MASS, TT.BODY_COM_POSE):
- if tt in articulation.root_view:
- assert articulation.root_view[tt].shape[1] == articulation.num_bodies
+ binding = articulation.root_view.try_binding_for(tt)
+ if binding is not None:
+ assert binding.shape[1] == articulation.num_bodies
# Body-name ordering check is degenerate on OVPhysX: ``body_names`` is
# sourced from binding metadata (``sample.body_names``), so the PhysX
# ``link_paths[0]`` round-trip is a no-op here and is omitted.
@@ -1978,6 +1993,51 @@ def test_write_root_state(sim, num_articulations, device, with_offset, state_loc
torch.testing.assert_close(rand_state[..., 7:], articulation.data.root_link_vel_w.torch)
+@pytest.mark.parametrize("device", ["cpu"])
+def test_body_com_pose_b_cache_and_set_coms_invalidation(sim, device):
+ """Body-frame COM offsets stay cached and invalidate derived buffers after writes."""
+ sim._app_control_on_stop_handle = None
+ articulation_cfg = generate_articulation_cfg(articulation_type="single_joint_implicit")
+ articulation, _ = generate_articulation(articulation_cfg, 2, device=device)
+
+ sim.reset()
+ articulation.update(sim.cfg.dt)
+
+ articulation.data.body_com_pose_b
+ first_timestamp = articulation.data._body_com_pose_b.timestamp
+ articulation.update(sim.cfg.dt)
+ articulation.data.body_com_pose_b
+ assert articulation.data._body_com_pose_b.timestamp == first_timestamp
+
+ dependent_buffers = [
+ ("root_com_pose_w", articulation.data._root_com_pose_w),
+ ("root_com_vel_w", articulation.data._root_com_vel_w),
+ ("root_link_vel_w", articulation.data._root_link_vel_w),
+ ("body_com_pose_w", articulation.data._body_com_pose_w),
+ ("body_com_vel_w", articulation.data._body_com_vel_w),
+ ("body_link_vel_w", articulation.data._body_link_vel_w),
+ ("root_link_lin_vel_b", articulation.data._root_link_lin_vel_b),
+ ("root_link_ang_vel_b", articulation.data._root_link_ang_vel_b),
+ ("root_com_lin_vel_b", articulation.data._root_com_lin_vel_b),
+ ("root_com_ang_vel_b", articulation.data._root_com_ang_vel_b),
+ ("root_state_w", articulation.data._root_state_w_buf),
+ ("root_link_state_w", articulation.data._root_link_state_w_buf),
+ ("root_com_state_w", articulation.data._root_com_state_w_buf),
+ ("body_state_w", articulation.data._body_state_w_buf),
+ ("body_link_state_w", articulation.data._body_link_state_w_buf),
+ ("body_com_state_w", articulation.data._body_com_state_w_buf),
+ ]
+ for _, buffer in dependent_buffers:
+ buffer.timestamp = articulation.data._sim_timestamp
+
+ coms = wp.zeros((articulation.num_instances, articulation.num_bodies), dtype=wp.transformf, device=device)
+ articulation.set_coms_index(coms=coms)
+
+ assert articulation.data._body_com_pose_b.timestamp == articulation.data._sim_timestamp
+ for name, buffer in dependent_buffers:
+ assert buffer.timestamp < articulation.data._sim_timestamp, name
+
+
@pytest.mark.parametrize("device", ["cuda:0", "cpu"])
def test_setting_articulation_root_prim_path(sim, device):
"""Test that the articulation root prim path can be set explicitly."""
diff --git a/source/isaaclab_ovphysx/test/assets/test_articulation_helpers.py b/source/isaaclab_ovphysx/test/assets/test_articulation_helpers.py
index da85e53facbc..1356daec70da 100644
--- a/source/isaaclab_ovphysx/test/assets/test_articulation_helpers.py
+++ b/source/isaaclab_ovphysx/test/assets/test_articulation_helpers.py
@@ -84,7 +84,9 @@ def _make_articulation_shell() -> Articulation:
num_fixed_tendons=1,
num_spatial_tendons=1,
)
- object.__setattr__(articulation, "_bindings", bindings.bindings)
+ # The migrated Articulation reads tendon counts off its OvPhysxView; inject the mock
+ # view over these bindings so the metadata passthrough resolves without a real view.
+ object.__setattr__(articulation, "_root_view", bindings.view)
object.__setattr__(articulation, "_articulation_root_path", "/World/envs/env_0/Robot/root")
object.__setattr__(articulation, "_initialize_handle", None)
object.__setattr__(articulation, "_invalidate_initialize_handle", None)
diff --git a/source/isaaclab_ovphysx/test/assets/test_rigid_object.py b/source/isaaclab_ovphysx/test/assets/test_rigid_object.py
index 87d4f2e9e882..b3012dfb3971 100644
--- a/source/isaaclab_ovphysx/test/assets/test_rigid_object.py
+++ b/source/isaaclab_ovphysx/test/assets/test_rigid_object.py
@@ -168,8 +168,8 @@ def generate_cubes_scene(
_MATERIAL_GAP_REASON = (
"Requires RIGID_BODY_MATERIAL TensorType (or a view-helper) on the ovphysx "
- "wheel side. RigidObject.root_view is a per-tensor-type bindings dict on "
- "OVPhysX, so root_view.get_material_properties() / set_material_properties() "
+ "wheel side. RigidObject.root_view is an OvPhysxView over the per-tensor-type "
+ "bindings on OVPhysX, so root_view.get_material_properties() / set_material_properties() "
"are not available. See "
"docs/superpowers/specs/2026-04-28-ovphysx-wheel-gaps-for-marco.md."
)
diff --git a/source/isaaclab_ovphysx/test/physics/test_ovphysx_scene_data_backend.py b/source/isaaclab_ovphysx/test/physics/test_ovphysx_scene_data_backend.py
index 37487b5dd85e..d57efdddfdd1 100644
--- a/source/isaaclab_ovphysx/test/physics/test_ovphysx_scene_data_backend.py
+++ b/source/isaaclab_ovphysx/test/physics/test_ovphysx_scene_data_backend.py
@@ -186,6 +186,7 @@ def fake_read_b(dst):
{
"pattern": "/World/envs/env_*/Cube",
"pose": SimpleNamespace(read=fake_read_a, prim_paths=["/Cube0", "/Cube1"]),
+ "view": SimpleNamespace(read_into=lambda name, dst, _r=fake_read_a: _r(dst)),
"pose_buf": buf_a,
"pose_buf_transformf": buf_a_tf,
"row_offset": 0,
@@ -194,6 +195,7 @@ def fake_read_b(dst):
{
"pattern": "/World/envs/env_*/Pole",
"pose": SimpleNamespace(read=fake_read_b, prim_paths=["/Pole"]),
+ "view": SimpleNamespace(read_into=lambda name, dst, _r=fake_read_b: _r(dst)),
"pose_buf": buf_b,
"pose_buf_transformf": buf_b_tf,
"row_offset": 2,
@@ -324,6 +326,7 @@ def bad_read(dst):
{
"pattern": "/World/envs/env_*/Good",
"pose": SimpleNamespace(read=good_read, prim_paths=["/Good"]),
+ "view": SimpleNamespace(read_into=lambda name, dst, _r=good_read: _r(dst)),
"pose_buf": buf_good,
"pose_buf_transformf": buf_good_tf,
"row_offset": 0,
@@ -332,6 +335,7 @@ def bad_read(dst):
{
"pattern": "/World/envs/env_*/Bad",
"pose": SimpleNamespace(read=bad_read, prim_paths=["/Bad"]),
+ "view": SimpleNamespace(read_into=lambda name, dst, _r=bad_read: _r(dst)),
"pose_buf": buf_bad,
"pose_buf_transformf": buf_bad_tf,
"row_offset": 1,
diff --git a/source/isaaclab_ovphysx/test/sim/test_ovphysx_view.py b/source/isaaclab_ovphysx/test/sim/test_ovphysx_view.py
new file mode 100644
index 000000000000..f5de647edc55
--- /dev/null
+++ b/source/isaaclab_ovphysx/test/sim/test_ovphysx_view.py
@@ -0,0 +1,587 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for the :class:`OvPhysxView` string-keyed binding manager.
+
+These exercise the pure-Python name<->enum logic and the view's get/set/read-into
+dispatch (including the float32 reinterpret of structured buffers and the
+no-implicit-conversion device policy) against a fake ``PhysX`` + fake ``TensorBinding``.
+
+Scope is intentionally the **API mechanics** against mock bindings. Live coverage against
+real ovphysx bindings -- CPU-only properties on a GPU sim, read-only/write-only failures,
+and structured ``read_into`` round-trips -- is provided by the asset-integration tests
+(``test_articulation.py`` / ``test_rigid_object.py`` / ``test_rigid_object_collection.py``)
+that adopt this view as ``root_view``; it is not (and is not meant to be) re-covered here.
+"""
+
+from __future__ import annotations
+
+import numpy as np
+import pytest
+
+# The OVPhysX runtime wheel is optional. ``ovphysx.types`` is pure Python (no native
+# dependency), so the import-skip guards only the wheel's presence.
+pytest.importorskip("ovphysx.types", reason="ovphysx wheel not installed")
+
+import warp as wp # noqa: E402
+from isaaclab_ovphysx.sim.views.ovphysx_view import ( # noqa: E402
+ OvPhysxView,
+ OvPhysxViewError,
+ attribute_vocabulary,
+ is_cpu_only,
+ is_read_only,
+ resolve_tensor_type,
+ tensor_type_name,
+)
+from ovphysx.types import TensorType # noqa: E402
+
+wp.init()
+_HAS_CUDA = wp.get_cuda_device_count() > 0
+
+# Per-type shapes used by the fakes (only the types touched by the tests).
+_SHAPES = {
+ TensorType.RIGID_BODY_POSE: lambda n: (n, 7),
+ TensorType.RIGID_BODY_VELOCITY: lambda n: (n, 6),
+ TensorType.RIGID_BODY_MASS: lambda n: (n,), # CPU-only
+ TensorType.RIGID_BODY_ACCELERATION: lambda n: (n, 6), # read-only
+}
+
+
+class _FakeBinding:
+ """Minimal stand-in for an ovphysx ``TensorBinding``."""
+
+ def __init__(self, tensor_type, n: int):
+ self.tensor_type = tensor_type
+ self.shape = _SHAPES.get(tensor_type, lambda k: (k, 1))(n)
+ self.count = n
+ self.prim_paths = [f"/World/env_{i}/body" for i in range(n)]
+ self.dof_names: list[str] = []
+ self.body_names = ["body"]
+ self.joint_names: list[str] = []
+ self.dof_count = 0
+ self.body_count = 1
+ self.joint_count = 0
+ self.is_fixed_base = True
+ self.fixed_tendon_count = 0
+ self.spatial_tendon_count = 0
+ self.read_calls = 0
+ self.last_read: tuple | None = None
+ self.last_read_obj = None # the actual array object handed to read (for cache-warmth checks)
+ self.write_calls: list[tuple] = []
+
+ def read(self, dst) -> None:
+ self.read_calls += 1
+ self.last_read = (dst.dtype, tuple(dst.shape), str(dst.device))
+ self.last_read_obj = dst
+
+ def write(self, tensor, indices=None, mask=None) -> None:
+ self.write_calls.append((tensor.dtype, tuple(tensor.shape), indices, mask))
+
+
+class _FakePhysX:
+ """Fake ``PhysX`` whose ``create_tensor_binding`` hands back ``_FakeBinding`` instances."""
+
+ def __init__(self, n: int = 3, unavailable: set | None = None, all_unavailable: bool = False):
+ self.n = n
+ self._unavailable = unavailable or set()
+ self._all_unavailable = all_unavailable
+ self.created: list[tuple] = []
+
+ def create_tensor_binding(self, *, tensor_type, pattern=None, prim_paths=None):
+ self.created.append((tensor_type, pattern, prim_paths))
+ if self._all_unavailable or tensor_type in self._unavailable:
+ return _FakeBinding(tensor_type, 0) # wheel returns a 0-count binding on no match
+ return _FakeBinding(tensor_type, self.n)
+
+
+def _make_view(n: int = 3, unavailable: set | None = None, device: str = "cpu") -> OvPhysxView:
+ return OvPhysxView(_FakePhysX(n=n, unavailable=unavailable), pattern="/World/env_*/body", device=device)
+
+
+# -----------------------------------------------------------------------------
+# Pure helpers
+# -----------------------------------------------------------------------------
+
+
+def test_vocabulary_is_lowercased_enum_without_invalid():
+ vocab = attribute_vocabulary()
+ assert "articulation_dof_stiffness" in vocab
+ assert "rigid_body_pose" in vocab
+ assert "invalid" not in vocab
+ assert vocab == sorted(vocab)
+
+
+def test_resolve_roundtrips_name_and_enum():
+ tt = resolve_tensor_type("articulation_dof_stiffness")
+ assert tt is TensorType.ARTICULATION_DOF_STIFFNESS
+ assert tensor_type_name(tt) == "articulation_dof_stiffness"
+ assert resolve_tensor_type("RIGID_BODY_POSE") is TensorType.RIGID_BODY_POSE # case-insensitive
+
+
+def test_resolve_unknown_name_raises():
+ with pytest.raises(OvPhysxView.UnknownAttribute):
+ resolve_tensor_type("not_a_real_attribute")
+
+
+def test_read_only_names_are_valid_vocabulary():
+ # Every read-only name must resolve to a real TensorType, so the hand-maintained
+ # set stays coupled to the wheel enum (no dead names).
+ from isaaclab_ovphysx.sim.views import ovphysx_view as mod
+
+ assert set(attribute_vocabulary()) >= mod._READ_ONLY_NAMES
+
+
+def test_read_only_and_cpu_only_classification():
+ assert is_read_only("articulation_jacobian")
+ assert is_read_only("rigid_body_acceleration")
+ assert not is_read_only("articulation_dof_stiffness")
+ assert is_cpu_only("articulation_dof_stiffness")
+ assert is_cpu_only("rigid_body_mass")
+ assert not is_cpu_only("rigid_body_pose")
+
+
+def test_cpu_only_names_match_canonical_set():
+ # The view derives its CPU-only set from tensor_types so the two cannot drift.
+ from isaaclab_ovphysx.sim.views import ovphysx_view as mod
+ from isaaclab_ovphysx.tensor_types import _CPU_ONLY_TYPES
+
+ assert frozenset(tt.name.lower() for tt in _CPU_ONLY_TYPES) == mod._CPU_ONLY_NAMES
+
+
+# -----------------------------------------------------------------------------
+# Construction
+# -----------------------------------------------------------------------------
+
+
+def test_requires_exactly_one_of_pattern_or_prim_paths():
+ with pytest.raises(ValueError):
+ OvPhysxView(_FakePhysX(), pattern="/p", prim_paths=["/p"], device="cpu")
+ with pytest.raises(ValueError):
+ OvPhysxView(_FakePhysX(), device="cpu")
+
+
+def test_eager_creates_requested_and_exposes_metadata():
+ view = OvPhysxView(
+ _FakePhysX(n=5),
+ pattern="/World/env_*/body",
+ device="cpu",
+ tensor_types=[TensorType.RIGID_BODY_POSE, TensorType.RIGID_BODY_MASS],
+ eager=True,
+ )
+ assert view.available_attributes == ["rigid_body_mass", "rigid_body_pose"]
+ assert view.count == 5 # metadata works without an explicit get_attribute call
+
+
+def test_eager_default_sweep_empty_view_raises():
+ # Default sweep (no tensor_types) on a pattern that matches nothing -> aggregate raise.
+ physx = _FakePhysX(all_unavailable=True)
+ with pytest.raises(OvPhysxViewError, match="Could not create any bindings"):
+ OvPhysxView(physx, pattern="/no/match", device="cpu", eager=True)
+
+
+# -----------------------------------------------------------------------------
+# get_attribute / read_into
+# -----------------------------------------------------------------------------
+
+
+def test_get_attribute_allocates_fresh_typed_buffer_each_call():
+ view = _make_view(n=4)
+ buf = view.get_attribute("rigid_body_pose")
+ # Pose maps to a structured dtype: an [N] transformf array (== [N, 7] float32).
+ assert tuple(buf.shape) == (4,) and buf.dtype == wp.transformf
+ binding = view._bindings[TensorType.RIGID_BODY_POSE]
+ assert binding.read_calls == 1
+ buf2 = view.get_attribute("rigid_body_pose")
+ assert buf2 is not buf # no aliasing of view state
+ assert binding.read_calls == 2
+
+
+def test_get_attribute_no_out_does_not_grow_read_cache():
+ # A no-`out` get_attribute allocates a fresh buffer each call, so caching its reinterpret by
+ # id() could never hit on a later call and would leak one entry (keeping the buffer alive) per
+ # call in a step loop. The structured-dtype path must reinterpret directly, never touching the
+ # cache -- the read cache only pays off for a reused `out`/`dst`. Pose is the structured case
+ # (transformf), the one that would have been cached before the fix.
+ view = _make_view(n=3)
+ for _ in range(5):
+ view.get_attribute("rigid_body_pose")
+ assert view._read_views == {}
+
+
+def test_get_attribute_types_pose_and_velocity_falls_back_to_float32():
+ view = _make_view(n=3)
+ assert view.get_attribute("rigid_body_pose").dtype == wp.transformf
+ assert view.get_attribute("rigid_body_velocity").dtype == wp.spatial_vectorf
+ # An attribute absent from the structured-dtype map stays flat float32.
+ mass = view.get_attribute("rigid_body_mass")
+ assert mass.dtype == wp.float32 and tuple(mass.shape) == (3,)
+
+
+def test_read_into_reuses_reinterpret_view_across_calls():
+ # The float32 reinterpret of a structured dst is built once and reused so the wheel's
+ # object-identity read cache stays warm across steps.
+ view = _make_view(n=3)
+ dst = wp.zeros((3,), dtype=wp.transformf, device="cpu")
+ view.read_into("rigid_body_pose", dst)
+ binding = view._bindings[TensorType.RIGID_BODY_POSE]
+ first = binding.last_read_obj
+ view.read_into("rigid_body_pose", dst)
+ assert binding.last_read_obj is first # same object handed to the wheel both times
+ assert first is not dst # it is the float32 reinterpret, not the transformf buffer
+
+
+def test_read_into_passthrough_reuses_dst_object():
+ # A flat float32 dst is its own stable identity -- passed straight through, not cached.
+ view = _make_view(n=3)
+ dst = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ view.read_into("rigid_body_pose", dst)
+ binding = view._bindings[TensorType.RIGID_BODY_POSE]
+ assert binding.last_read_obj is dst
+ assert id(dst) not in view._read_views # float32 dst is not cached
+
+
+def test_read_into_caches_per_destination_buffer():
+ view = _make_view(n=3)
+ a = wp.zeros((3,), dtype=wp.transformf, device="cpu")
+ b = wp.zeros((3,), dtype=wp.transformf, device="cpu")
+ binding = view._bindings.get(TensorType.RIGID_BODY_POSE) or view.binding_for("rigid_body_pose")
+ view.read_into("rigid_body_pose", a)
+ view_a = binding.last_read_obj
+ view.read_into("rigid_body_pose", b)
+ view_b = binding.last_read_obj
+ assert view_a is not view_b # distinct reinterprets per destination buffer
+ assert view_a.ptr == a.ptr and view_b.ptr == b.ptr
+
+
+def test_get_attribute_out_param_is_filled_and_returned():
+ view = _make_view(n=2)
+ out = wp.zeros((2, 7), dtype=wp.float32, device="cpu")
+ ret = view.get_attribute("rigid_body_pose", out=out)
+ assert ret is out
+ assert view._bindings[TensorType.RIGID_BODY_POSE].read_calls == 1
+
+
+def test_read_into_reinterprets_structured_buffer():
+ view = _make_view(n=3)
+ dst = wp.zeros((3,), dtype=wp.transformf, device="cpu") # [N] transformf == [N,7] float32
+ view.read_into("rigid_body_pose", dst)
+ binding = view._bindings[TensorType.RIGID_BODY_POSE]
+ # The binding was handed a float32 view matching its flat shape, not the transformf buffer.
+ assert binding.last_read == (wp.float32, (3, 7), "cpu")
+
+
+def test_read_into_passthrough_when_already_float32():
+ view = _make_view(n=3)
+ dst = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ view.read_into("rigid_body_pose", dst)
+ assert view._bindings[TensorType.RIGID_BODY_POSE].last_read == (wp.float32, (3, 7), "cpu")
+
+
+def test_read_into_shape_mismatch_raises():
+ view = _make_view(n=3)
+ wrong = wp.zeros((3, 6), dtype=wp.float32, device="cpu")
+ with pytest.raises(OvPhysxView.ShapeMismatch):
+ view.read_into("rigid_body_pose", wrong)
+
+
+# -----------------------------------------------------------------------------
+# Device policy (no implicit CPU<->GPU conversion)
+# -----------------------------------------------------------------------------
+
+
+def test_cpu_array_for_device_state_on_gpu_sim_raises():
+ # GPU sim, but a CPU buffer is supplied for a device-resident state attribute.
+ view = _make_view(n=3, device="cuda:0")
+ cpu_buf = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ with pytest.raises(OvPhysxView.DeviceMismatch, match="cuda:0"):
+ view.read_into("rigid_body_pose", cpu_buf)
+
+
+def test_cpu_only_property_accepts_cpu_buffer_on_gpu_sim():
+ # GPU sim, CPU-only property (mass): a CPU buffer is correct and must NOT raise.
+ view = _make_view(n=3, device="cuda:0")
+ cpu_buf = wp.zeros((3,), dtype=wp.float32, device="cpu")
+ view.read_into("rigid_body_mass", cpu_buf) # no raise
+ assert view._bindings[TensorType.RIGID_BODY_MASS].read_calls == 1
+
+
+@pytest.mark.skipif(not _HAS_CUDA, reason="needs a CUDA device to allocate a GPU buffer")
+def test_gpu_array_for_cpu_only_property_raises():
+ view = _make_view(n=3, device="cuda:0")
+ gpu_buf = wp.zeros((3,), dtype=wp.float32, device="cuda:0")
+ with pytest.raises(OvPhysxView.DeviceMismatch, match="cpu"):
+ view.read_into("rigid_body_mass", gpu_buf)
+
+
+# -----------------------------------------------------------------------------
+# set_attribute
+# -----------------------------------------------------------------------------
+
+
+def test_set_attribute_forwards_indices_and_mask():
+ view = _make_view(n=3)
+ values = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ idx = wp.array([0, 2], dtype=wp.int32, device="cpu")
+ view.set_attribute("rigid_body_pose", values, indices=idx)
+ dtype, shape, indices, mask = view._bindings[TensorType.RIGID_BODY_POSE].write_calls[0]
+ assert (dtype, shape, indices, mask) == (wp.float32, (3, 7), idx, None)
+
+
+def test_set_attribute_reinterprets_structured_source():
+ view = _make_view(n=3)
+ values = wp.zeros((3,), dtype=wp.transformf, device="cpu")
+ view.set_attribute("rigid_body_pose", values)
+ dtype, shape, _, _ = view._bindings[TensorType.RIGID_BODY_POSE].write_calls[0]
+ assert (dtype, shape) == (wp.float32, (3, 7))
+
+
+def test_set_attribute_read_only_raises_and_does_not_bind():
+ view = _make_view(n=3)
+ values = wp.zeros((3, 6), dtype=wp.float32, device="cpu")
+ with pytest.raises(OvPhysxView.ReadOnlyAttribute, match="read-only"):
+ view.set_attribute("rigid_body_acceleration", values)
+ assert TensorType.RIGID_BODY_ACCELERATION not in view._bindings
+
+
+def test_set_attribute_shape_mismatch_raises():
+ view = _make_view(n=3)
+ wrong = wp.zeros((3, 6), dtype=wp.float32, device="cpu")
+ with pytest.raises(OvPhysxView.ShapeMismatch, match="Shape mismatch"):
+ view.set_attribute("rigid_body_pose", wrong)
+
+
+def test_set_attribute_cpu_array_for_state_on_gpu_sim_raises():
+ view = _make_view(n=3, device="cuda:0")
+ values = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ with pytest.raises(OvPhysxView.DeviceMismatch):
+ view.set_attribute("rigid_body_pose", values)
+
+
+def test_as_wp_accepts_numpy_float32_and_rejects_float64():
+ view = _make_view(n=2)
+ # float32 host data is materialized on the native device and written.
+ view.set_attribute("rigid_body_pose", np.zeros((2, 7), dtype=np.float32))
+ assert len(view._bindings[TensorType.RIGID_BODY_POSE].write_calls) == 1
+ # float64 is not float32-bit-equivalent; reject rather than silently reinterpret.
+ with pytest.raises(OvPhysxView.DtypeMismatch, match="float32 scalar"):
+ view.set_attribute("rigid_body_pose", np.zeros((2, 7), dtype=np.float64))
+
+
+# -----------------------------------------------------------------------------
+# prim_paths + key aliases (RigidObjectCollection fused-binding shape)
+# -----------------------------------------------------------------------------
+
+
+def test_prim_paths_with_key_alias_creates_remapped_type():
+ physx = _FakePhysX(n=6)
+ view = OvPhysxView(
+ physx,
+ prim_paths=["/World/env_*/cube", "/World/env_*/sphere"],
+ device="cpu",
+ key_aliases={TensorType.ARTICULATION_LINK_POSE: TensorType.RIGID_BODY_POSE},
+ )
+ binding = view.binding_for("articulation_link_pose")
+ # Created as RIGID_BODY_POSE via prim_paths, cached under the requested LINK_POSE key.
+ created_type, pattern, prim_paths = physx.created[0]
+ assert created_type is TensorType.RIGID_BODY_POSE
+ assert pattern is None and prim_paths == ["/World/env_*/cube", "/World/env_*/sphere"]
+ assert view._bindings[TensorType.ARTICULATION_LINK_POSE] is binding
+ # And a write through the aliased key resolves to that same cached binding.
+ view.set_attribute("articulation_link_pose", wp.zeros((6, 7), dtype=wp.float32, device="cpu"))
+ assert len(binding.write_calls) == 1 and binding is view._bindings[TensorType.ARTICULATION_LINK_POSE]
+
+
+# -----------------------------------------------------------------------------
+# Errors / discoverability / metadata
+# -----------------------------------------------------------------------------
+
+
+def test_unknown_attribute_raises_on_access():
+ view = _make_view()
+ with pytest.raises(OvPhysxView.UnknownAttribute):
+ view.get_attribute("totally_made_up")
+
+
+def test_unavailable_binding_reports_clear_error():
+ view = _make_view(n=3, unavailable={TensorType.RIGID_BODY_VELOCITY})
+ with pytest.raises(OvPhysxView.AttributeUnavailable, match="not available"):
+ view.get_attribute("rigid_body_velocity")
+
+
+def test_discoverability_surface():
+ view = _make_view()
+ assert "rigid_body_pose" in view
+ assert view.has_attribute("articulation_dof_stiffness")
+ assert not view.has_attribute("nope")
+ assert "rigid_body_pose" in view.attribute_names
+ assert view.available_attributes == []
+ view.get_attribute("rigid_body_pose")
+ assert view.available_attributes == ["rigid_body_pose"]
+
+
+def test_metadata_passthrough_from_sample_binding():
+ view = _make_view(n=5)
+ with pytest.raises(OvPhysxView.AttributeUnavailable):
+ _ = view.count # metadata before any access raises a clear error
+ view.get_attribute("rigid_body_pose")
+ assert view.count == 5
+ assert len(view.prim_paths) == 5
+ assert view.body_names == ["body"]
+ assert view.is_fixed_base is True
+ assert view.joint_count == 0 and view.fixed_tendon_count == 0
+
+
+# -----------------------------------------------------------------------------
+# dtype safety — the view reinterprets bits, so non-float32 scalars must be rejected
+# -----------------------------------------------------------------------------
+
+
+def test_set_attribute_rejects_same_byte_size_wrong_dtype():
+ # int32 has the same 4-byte width as float32: it would pass a byte-count-only guard
+ # and get bit-reinterpreted into garbage. It must be rejected, not silently written.
+ view = _make_view(n=3)
+ int_buf = wp.zeros((3, 7), dtype=wp.int32, device="cpu")
+ with pytest.raises(OvPhysxView.DtypeMismatch, match="float32 scalar"):
+ view.set_attribute("rigid_body_pose", int_buf)
+ assert view._bindings[TensorType.RIGID_BODY_POSE].write_calls == []
+
+
+def test_set_attribute_rejects_sub_4byte_dtype():
+ view = _make_view(n=3)
+ half_buf = wp.zeros((3, 7), dtype=wp.float16, device="cpu")
+ with pytest.raises(OvPhysxView.DtypeMismatch, match="float32 scalar"):
+ view.set_attribute("rigid_body_pose", half_buf)
+
+
+def test_set_attribute_forwards_both_indices_and_mask():
+ # The view forwards both verbatim; the wheel resolves precedence (mask wins).
+ view = _make_view(n=3)
+ values = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ idx = wp.array([0, 2], dtype=wp.int32, device="cpu")
+ mask = wp.array([True, False, True], dtype=wp.bool, device="cpu")
+ view.set_attribute("rigid_body_pose", values, indices=idx, mask=mask)
+ _, _, fwd_idx, fwd_mask = view._bindings[TensorType.RIGID_BODY_POSE].write_calls[0]
+ assert fwd_idx is idx and fwd_mask is mask
+
+
+def test_get_attribute_out_on_wrong_device_raises():
+ # `get_attribute(out=)` has its own device check distinct from read_into's.
+ view = _make_view(n=3, device="cuda:0")
+ cpu_out = wp.zeros((3, 7), dtype=wp.float32, device="cpu")
+ with pytest.raises(OvPhysxView.DeviceMismatch):
+ view.get_attribute("rigid_body_pose", out=cpu_out)
+
+
+def test_resolve_rejects_non_str_non_tensortype():
+ view = _make_view()
+ with pytest.raises(OvPhysxView.UnknownAttribute):
+ view.get_attribute(123)
+
+
+def test_set_attribute_rejects_non_contiguous_source():
+ # A strided slice has the right element count but non-contiguous memory; the ptr-based
+ # reinterpret would read the wrong elements, so it must be rejected.
+ view = _make_view(n=3)
+ base = wp.zeros((3, 14), dtype=wp.float32, device="cpu")
+ strided = base[:, :7]
+ assert not strided.is_contiguous
+ with pytest.raises(OvPhysxView.ShapeMismatch, match="contiguous"):
+ view.set_attribute("rigid_body_pose", strided)
+
+
+# -----------------------------------------------------------------------------
+# API hardening — adversarial construction / resolution
+# -----------------------------------------------------------------------------
+
+
+def test_invalid_tensortype_member_rejected():
+ view = _make_view()
+ with pytest.raises(OvPhysxView.UnknownAttribute):
+ view.get_attribute(TensorType.INVALID)
+
+
+def test_string_keyed_aliases_are_honored():
+ # Passing string alias keys/values must be normalized to TensorType, not silently dropped.
+ physx = _FakePhysX(n=6)
+ view = OvPhysxView(
+ physx,
+ prim_paths=["/World/env_*/cube"],
+ device="cpu",
+ key_aliases={"articulation_link_pose": "rigid_body_pose"},
+ )
+ view.binding_for("articulation_link_pose")
+ assert physx.created[0][0] is TensorType.RIGID_BODY_POSE # alias applied
+
+
+def test_key_alias_crossing_residency_is_rejected():
+ # LINK_POSE is GPU state; RIGID_BODY_MASS is CPU-only -> the device guard would be wrong.
+ with pytest.raises(ValueError, match="residency"):
+ OvPhysxView(
+ _FakePhysX(),
+ pattern="/p",
+ device="cpu",
+ key_aliases={TensorType.ARTICULATION_LINK_POSE: TensorType.RIGID_BODY_MASS},
+ )
+
+
+def test_tensor_types_without_eager_raises():
+ with pytest.raises(ValueError, match="eager"):
+ OvPhysxView(_FakePhysX(), pattern="/p", device="cpu", tensor_types=[TensorType.RIGID_BODY_POSE])
+
+
+def test_empty_target_is_rejected():
+ with pytest.raises(ValueError):
+ OvPhysxView(_FakePhysX(), prim_paths=[], device="cpu")
+ with pytest.raises(ValueError):
+ OvPhysxView(_FakePhysX(), pattern="", device="cpu")
+
+
+def test_eager_explicit_unavailable_type_raises_loud():
+ # When the caller names exact types, a failing one is surfaced (not silently dropped).
+ physx = _FakePhysX(n=3, unavailable={TensorType.RIGID_BODY_VELOCITY})
+ with pytest.raises(OvPhysxView.AttributeUnavailable):
+ OvPhysxView(
+ physx,
+ pattern="/World/env_*/body",
+ device="cpu",
+ tensor_types=[TensorType.RIGID_BODY_POSE, TensorType.RIGID_BODY_VELOCITY],
+ eager=True,
+ )
+
+
+def test_get_attribute_cpu_only_property_returns_cpu_buffer_on_gpu_sim():
+ # No-out allocation path must use the native device: CPU for a CPU-only property even
+ # though the sim device is a GPU. (CPU allocation -> runs without a GPU.)
+ view = _make_view(n=3, device="cuda:0")
+ buf = view.get_attribute("rigid_body_mass")
+ assert str(buf.device) == "cpu"
+
+
+def test_binding_for_is_idempotent_and_unguarded():
+ view = _make_view(n=3)
+ # Returns a binding even for a read-only attribute (raw access bypasses the write guard)...
+ b1 = view.binding_for("rigid_body_acceleration")
+ b2 = view.binding_for("rigid_body_acceleration")
+ assert b1 is b2 # cached / created once
+ assert len(view._physx.created) == 1
+
+
+def test_try_binding_for_returns_none_when_unavailable():
+ view = _make_view(n=3, unavailable={TensorType.RIGID_BODY_VELOCITY})
+ # Available for these prims -> the (cached) binding; unavailable -> None, no raise.
+ assert view.try_binding_for("rigid_body_pose") is view._bindings[TensorType.RIGID_BODY_POSE]
+ assert view.try_binding_for("rigid_body_velocity") is None
+ # An invalid name is still a hard error, not an availability question.
+ with pytest.raises(OvPhysxView.UnknownAttribute):
+ view.try_binding_for("not_a_real_attribute")
+
+
+@pytest.mark.skipif(not _HAS_CUDA, reason="needs a CUDA device for the cuda:0 buffer")
+def test_device_cuda_alias_is_canonicalized():
+ # A view built with the bare "cuda" alias must accept a canonical "cuda:0" buffer.
+ view = _make_view(n=3, device="cuda")
+ gpu_buf = wp.zeros((3, 7), dtype=wp.float32, device="cuda:0")
+ view.read_into("rigid_body_pose", gpu_buf) # must not raise
+ assert view._bindings[TensorType.RIGID_BODY_POSE].read_calls == 1
diff --git a/source/isaaclab_physx/changelog.d/jmart-cartpole-rtx.minor.rst b/source/isaaclab_physx/changelog.d/jmart-cartpole-rtx.minor.rst
deleted file mode 100644
index 1f2a1c956e42..000000000000
--- a/source/isaaclab_physx/changelog.d/jmart-cartpole-rtx.minor.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Added
-^^^^^
-
-* Overrode :meth:`provides_temporal_camera_data` on :class:`IsaacRtxRenderer` to return ``True``
- only for the ``rgb``/``rgba`` beauty buffer (temporally accumulated by DLSS); the depth, albedo,
- simple_shading, and segmentation AOVs return ``False`` as they bypass DLSS.
diff --git a/source/isaaclab_physx/changelog.d/vidurv-schema-frag-jointdrive.minor.rst b/source/isaaclab_physx/changelog.d/vidurv-schema-frag-jointdrive.minor.rst
new file mode 100644
index 000000000000..93ed43935d82
--- /dev/null
+++ b/source/isaaclab_physx/changelog.d/vidurv-schema-frag-jointdrive.minor.rst
@@ -0,0 +1,11 @@
+Added
+^^^^^
+
+* Added the :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` joint-drive fragment
+ (``physxJoint:*`` / ``PhysxJointAPI``), carrying ``max_joint_velocity`` (with the legacy
+ ``max_velocity`` deprecation alias). Applied alongside
+ :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg` via
+ :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`.
+* Added :func:`~isaaclab_physx.sim.schemas.apply_physx_joint`, the dedicated applier for
+ :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` that converts ``max_joint_velocity`` from
+ rad/s to deg/s for angular (revolute) joints, matching the legacy joint-drive unit convention.
diff --git a/source/isaaclab_physx/changelog.d/vidurv-schema-frag-meshcollision.minor.rst b/source/isaaclab_physx/changelog.d/vidurv-schema-frag-meshcollision.minor.rst
new file mode 100644
index 000000000000..8ced9b2e5d2a
--- /dev/null
+++ b/source/isaaclab_physx/changelog.d/vidurv-schema-frag-meshcollision.minor.rst
@@ -0,0 +1,11 @@
+Added
+^^^^^
+
+* Added the PhysX mesh-collision cooking fragments:
+ :class:`~isaaclab_physx.sim.schemas.PhysxConvexHullCfg`,
+ :class:`~isaaclab_physx.sim.schemas.PhysxConvexDecompositionCfg`,
+ :class:`~isaaclab_physx.sim.schemas.PhysxTriangleMeshCfg`,
+ :class:`~isaaclab_physx.sim.schemas.PhysxTriangleMeshSimplificationCfg`, and
+ :class:`~isaaclab_physx.sim.schemas.PhysxSDFMeshCfg`. Each is a single-namespace
+ :class:`~isaaclab.sim.schemas.MeshCollisionFragment` owning one ``physx*Collision:*`` namespace and
+ applied schema, dispatched via :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
diff --git a/source/isaaclab_physx/config/extension.toml b/source/isaaclab_physx/config/extension.toml
index 519859d53fc1..b9a934f8fe38 100644
--- a/source/isaaclab_physx/config/extension.toml
+++ b/source/isaaclab_physx/config/extension.toml
@@ -1,7 +1,7 @@
[package]
# Note: Semantic Versioning is used: https://semver.org/
-version = "2.0.2"
+version = "2.4.0"
# Description
title = "PhysX simulation interfaces for IsaacLab core package"
diff --git a/source/isaaclab_physx/docs/CHANGELOG.rst b/source/isaaclab_physx/docs/CHANGELOG.rst
index 6f7c55b3b0ba..2a6e262c9d82 100644
--- a/source/isaaclab_physx/docs/CHANGELOG.rst
+++ b/source/isaaclab_physx/docs/CHANGELOG.rst
@@ -1,6 +1,91 @@
Changelog
---------
+2.4.0 (2026-06-27)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonCfg` and
+ :class:`~isaaclab_physx.sim.schemas.PhysxSpatialTendonCfg`, the PhysX tendon schema
+ fragments. They override ``func`` with
+ :func:`~isaaclab_physx.sim.schemas.apply_fixed_tendon` /
+ :func:`~isaaclab_physx.sim.schemas.apply_spatial_tendon`, which delegate to the existing
+ multi-instance tendon writers to tune every applied ``PhysxTendonAxisRootAPI`` /
+ ``PhysxTendonAttachmentRootAPI`` / ``PhysxTendonAttachmentLeafAPI`` instance.
+
+Changed
+^^^^^^^
+
+* Reworked :class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonCfg` /
+ :class:`~isaaclab_physx.sim.schemas.PhysxSpatialTendonCfg` appliers to tune the multi-instance
+ PhysX tendon schemas directly, removing the dependency on the legacy
+ ``modify_*_tendon_properties`` writers and the legacy ``Physx*TendonPropertiesCfg`` reconstruction.
+ Callers relying on :class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonPropertiesCfg`
+ reconstruction inside the applier should pass a
+ :class:`~isaaclab_physx.sim.schemas.PhysxFixedTendonCfg` fragment directly to
+ :func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties` instead.
+
+Fixed
+^^^^^
+
+* Fixed repeated PhysX articulation body-frame center-of-mass pose reads by caching them as model
+ properties and invalidating dependent buffers when center-of-mass offsets are updated.
+
+
+2.3.0 (2026-06-26)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_physx.sim.schemas.PhysxCollisionCfg`, the ``physxCollision:*``
+ single-namespace collision fragment (PhysX ``PhysxCollisionAPI``). It carries
+ ``contact_offset`` / ``rest_offset`` plus the torsional patch-friction fields, and composes with
+ :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` in a ``collision_props`` fragment list.
+
+
+2.2.0 (2026-06-25)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added :class:`~isaaclab_physx.sim.schemas.PhysxRigidBodyCfg`, the ``physxRigidBody:*``
+ single-namespace rigid-body fragment (PhysX ``PhysxRigidBodyAPI``). It carries the PhysX
+ damping / velocity-limit / solver-iteration / sleep fields plus ``disable_gravity``, and
+ composes with :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg` in a ``rigid_props``
+ fragment list.
+
+Changed
+^^^^^^^
+
+* Changed :meth:`~isaaclab_physx.renderers.IsaacRtxRenderer.prepare_stage` to skip authoring
+ ``primvars:omni:scenePartition`` and ``omni:scenePartition`` by default. Set the environment
+ variable ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` to re-enable
+ per-environment scene partitioning for Isaac RTX rendering.
+
+
+2.1.0 (2026-06-24)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Overrode :meth:`provides_temporal_camera_data` on :class:`IsaacRtxRenderer` to return ``True``
+ only for the ``rgb``/``rgba`` beauty buffer (temporally accumulated by DLSS); the depth, albedo,
+ simple_shading, and segmentation AOVs return ``False`` as they bypass DLSS.
+
+Fixed
+^^^^^
+
+* Fixed the optional ``newton[sim]`` dependency pin to use Newton commit
+ ``79e95bf5571d70a0a46c8eaedc80644531d27368``, including the
+ RenderContext triangle-mesh construction fix from `newton-physics/newton#3199
+ `_.
+
+
2.0.2 (2026-06-17)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py b/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py
index 9d0aa641ba9c..39d9604e3922 100644
--- a/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py
+++ b/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py
@@ -2357,6 +2357,11 @@ def set_coms_index(
self.assert_shape_and_dtype(coms, (self.num_instances, self.num_bodies), wp.transformf, "coms")
else:
self.assert_shape_and_dtype(coms, (env_ids.shape[0], body_ids.shape[0]), wp.transformf, "coms")
+ if self.data._body_com_pose_b.timestamp < 0.0 and (
+ env_ids.shape[0] != self.num_instances or body_ids.shape[0] != self.num_bodies
+ ):
+ # Partial writes need the current model-property cache as a base for untouched entries.
+ self.data.body_com_pose_b
# Warp kernels can ingest torch tensors directly, so we don't need to convert to warp arrays here.
wp.launch(
shared_kernels.write_body_com_pose_to_buffer,
@@ -2372,6 +2377,8 @@ def set_coms_index(
],
device=self.device,
)
+ self.data._body_com_pose_b.timestamp = self.data._sim_timestamp
+ self.data._reset_body_com_pose_b_dependents()
# Set into simulation, note that when updating "model" properties with PhysX we need to do it on CPU.
# Convert from wp.transformf to flat (N, M, 7) array for PhysX
cpu_env_ids = self._get_cpu_env_ids(env_ids)
diff --git a/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation_data.py b/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation_data.py
index b0a6be457c08..1be67ac9698c 100644
--- a/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation_data.py
+++ b/source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation_data.py
@@ -196,6 +196,32 @@ def _reset_velocity(self, from_com: bool = True) -> None:
)
self._fk_timestamp = -1.0
+ def _reset_body_com_pose_b_dependents(self) -> None:
+ """Reset cached properties derived from body-frame center-of-mass offsets."""
+ reset_timestamps(
+ [
+ self._root_com_pose_w,
+ self._root_com_vel_w,
+ self._root_link_vel_w,
+ self._body_com_pose_w,
+ self._body_com_vel_w,
+ self._body_link_vel_w,
+ self._root_link_lin_vel_b,
+ self._root_link_ang_vel_b,
+ self._root_com_lin_vel_b,
+ self._root_com_ang_vel_b,
+ self._root_state_w,
+ self._root_link_state_w,
+ self._root_com_state_w,
+ self._body_state_w,
+ self._body_link_state_w,
+ self._body_com_state_w,
+ self._body_com_jacobian_w,
+ self._mass_matrix,
+ self._gravity_compensation_forces,
+ ]
+ )
+
"""
Names.
"""
@@ -914,8 +940,8 @@ def body_com_pose_b(self) -> ProxyArray:
This quantity is the pose of the center of mass frame of the rigid body relative to the body's link frame.
The orientation is provided in (x, y, z, w) format.
"""
- if self._body_com_pose_b.timestamp < self._sim_timestamp:
- # set the buffer data and timestamp
+ if self._body_com_pose_b.timestamp < 0.0:
+ # Body-frame CoM offsets are model properties; cache them until an explicit CoM write updates them.
self._body_com_pose_b.data.assign(self._root_view.get_coms().view(wp.transformf))
self._body_com_pose_b.timestamp = self._sim_timestamp
diff --git a/source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py b/source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py
index 6fa530c52514..5eecd87242b9 100644
--- a/source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py
+++ b/source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py
@@ -22,6 +22,7 @@
from isaaclab.app.settings_manager import get_settings_manager
from isaaclab.renderers import BaseRenderer, RenderBufferKind, RenderBufferSpec
from isaaclab.renderers.camera_render_spec import CameraRenderSpec
+from isaaclab.utils.renderers import isaac_rtx_per_env_scene_partition_enabled
from isaaclab.utils.version import get_isaac_sim_version
from isaaclab.utils.warp.kernels import reshape_tiled_image
from isaaclab.utils.warp.warp_math import clamp_depth_to_inf_wp, replace_inf_depth_wp
@@ -187,12 +188,28 @@ def supported_output_types(self) -> dict[RenderBufferKind, RenderBufferSpec]:
def prepare_stage(self, stage: Usd.Stage, num_envs: int) -> None:
"""Author per-env ``omni:scenePartition`` attributes for RTX cull-by-env rendering.
- For each ``/World/envs/env_{i}`` root, writes the inheriting primvar
+ Authoring is only performed when
+ ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` is set.
+ When the variable is absent the method is a no-op and no ``primvars:omni:scenePartition``
+ or ``omni:scenePartition`` attributes are written to the stage.
+
+ When enabled, for each ``/World/envs/env_{i}`` root, writes the inheriting primvar
``primvars:omni:scenePartition`` (token ``env_{i}``) on the root and the matching
non-primvar ``omni:scenePartition`` token on every :class:`UsdGeom.Camera` descendant.
RTX honors primvar inheritance, so the env-root primvar propagates to all descendant
geometry and isolates each env's render tile.
See :meth:`~isaaclab.renderers.base_renderer.BaseRenderer.prepare_stage`."""
+
+ if not isaac_rtx_per_env_scene_partition_enabled():
+ return
+
+ logger.debug(
+ "Per-environment RTX scene partitioning is enabled"
+ " (ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1)."
+ " Authoring primvars:omni:scenePartition on %d env(s).",
+ num_envs,
+ )
+
root_layer = stage.GetRootLayer()
token_type = Sdf.ValueTypeNames.Token
with Sdf.ChangeBlock():
diff --git a/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.py b/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.py
index 47f0b1e8ae93..8892ccc6b593 100644
--- a/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.py
+++ b/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.py
@@ -5,6 +5,25 @@
"""Sub-module containing PhysX schema configuration exports."""
+from isaaclab.sim.schemas._backend_hooks import register_joint_drive_skip_predicate
from isaaclab.utils.module import lazy_export
lazy_export()
+
+
+def _is_physx_tendon_child(prim) -> bool:
+ """Return whether ``prim`` is a non-root PhysX fixed-tendon member.
+
+ A tendon-child joint carries the multi-instance ``PhysxTendonAxisAPI`` without the
+ ``PhysxTendonAxisRootAPI`` root instance. Applied-schema *type* names are compared exactly (the
+ part before the ``:`` instance suffix), so this is robust to schema-name changes. A drive must
+ not be authored on such joints -- the tendon controls them.
+ """
+ types = {schema.split(":", 1)[0] for schema in prim.GetAppliedSchemas()}
+ return "PhysxTendonAxisAPI" in types and "PhysxTendonAxisRootAPI" not in types
+
+
+# Keep PhysX tendon knowledge out of core: register the detector with the core joint-drive writers so
+# they skip tendon-controlled joints. Registered on import of this package (which a caller does to
+# construct PhysX schema fragments), inverting the dependency so core carries no PhysX schema name.
+register_joint_drive_skip_predicate(_is_physx_tendon_child)
diff --git a/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.pyi b/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.pyi
index b542edf9f454..754d009af3a7 100644
--- a/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.pyi
+++ b/source/isaaclab_physx/isaaclab_physx/sim/schemas/__init__.pyi
@@ -4,6 +4,9 @@
# SPDX-License-Identifier: BSD-3-Clause
__all__ = [
+ "apply_physx_joint",
+ "apply_fixed_tendon",
+ "apply_spatial_tendon",
"define_deformable_body_properties",
"modify_deformable_body_properties",
"ArticulationRootPropertiesCfg",
@@ -16,17 +19,27 @@ __all__ = [
"MeshCollisionPropertiesCfg",
"OmniPhysicsDeformableBodyPropertiesCfg",
"PhysxArticulationRootPropertiesCfg",
+ "PhysxCollisionCfg",
"PhysxCollisionPropertiesCfg",
+ "PhysxConvexDecompositionCfg",
"PhysxConvexDecompositionPropertiesCfg",
+ "PhysxConvexHullCfg",
"PhysxConvexHullPropertiesCfg",
"PhysxDeformableBodyPropertiesCfg",
"PhysxDeformableCollisionPropertiesCfg",
+ "PhysxFixedTendonCfg",
"PhysxFixedTendonPropertiesCfg",
+ "PhysxJointCfg",
"PhysxJointDrivePropertiesCfg",
+ "PhysxRigidBodyCfg",
"PhysxRigidBodyPropertiesCfg",
+ "PhysxSDFMeshCfg",
"PhysxSDFMeshPropertiesCfg",
+ "PhysxSpatialTendonCfg",
"PhysxSpatialTendonPropertiesCfg",
+ "PhysxTriangleMeshCfg",
"PhysxTriangleMeshPropertiesCfg",
+ "PhysxTriangleMeshSimplificationCfg",
"PhysxTriangleMeshSimplificationPropertiesCfg",
"RigidBodyPropertiesCfg",
"SDFMeshPropertiesCfg",
@@ -36,6 +49,9 @@ __all__ = [
]
from .schemas import (
+ apply_physx_joint,
+ apply_fixed_tendon,
+ apply_spatial_tendon,
define_deformable_body_properties,
modify_deformable_body_properties,
)
@@ -50,17 +66,27 @@ from .schemas_cfg import (
MeshCollisionPropertiesCfg,
OmniPhysicsDeformableBodyPropertiesCfg,
PhysxArticulationRootPropertiesCfg,
+ PhysxCollisionCfg,
PhysxCollisionPropertiesCfg,
+ PhysxConvexDecompositionCfg,
PhysxConvexDecompositionPropertiesCfg,
+ PhysxConvexHullCfg,
PhysxConvexHullPropertiesCfg,
PhysxDeformableBodyPropertiesCfg,
PhysxDeformableCollisionPropertiesCfg,
+ PhysxFixedTendonCfg,
PhysxFixedTendonPropertiesCfg,
+ PhysxJointCfg,
PhysxJointDrivePropertiesCfg,
+ PhysxRigidBodyCfg,
PhysxRigidBodyPropertiesCfg,
+ PhysxSDFMeshCfg,
PhysxSDFMeshPropertiesCfg,
+ PhysxSpatialTendonCfg,
PhysxSpatialTendonPropertiesCfg,
+ PhysxTriangleMeshCfg,
PhysxTriangleMeshPropertiesCfg,
+ PhysxTriangleMeshSimplificationCfg,
PhysxTriangleMeshSimplificationPropertiesCfg,
RigidBodyPropertiesCfg,
SDFMeshPropertiesCfg,
diff --git a/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas.py b/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas.py
index 713c1cc3264c..24af90b2e504 100644
--- a/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas.py
+++ b/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas.py
@@ -3,12 +3,170 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-"""Compatibility wrappers for deformable schema writers.
+"""PhysX schema-fragment appliers and compatibility wrappers.
The deformable schema writers are backend-aware but remain unified in
-:mod:`isaaclab.sim.schemas`.
+:mod:`isaaclab.sim.schemas`. This module additionally hosts the PhysX-specific fragment
+applier funcs that override :attr:`~isaaclab.sim.schemas.SchemaFragment.func` for the
+joint-drive and multi-instance tendon schemas, keeping the backend func out of the core package.
"""
-from isaaclab.sim.schemas.schemas import define_deformable_body_properties, modify_deformable_body_properties
+from __future__ import annotations
-__all__ = ["define_deformable_body_properties", "modify_deformable_body_properties"]
+import dataclasses
+import math
+
+from pxr import Usd, UsdPhysics
+
+from isaaclab.sim.schemas.schemas import (
+ define_deformable_body_properties,
+ modify_deformable_body_properties,
+)
+from isaaclab.sim.utils import safe_set_attribute_on_usd_prim
+from isaaclab.sim.utils.stage import get_current_stage
+from isaaclab.utils.string import to_camel_case
+
+from .schemas_cfg import PhysxFixedTendonCfg, PhysxSpatialTendonCfg
+
+__all__ = [
+ "apply_fixed_tendon",
+ "apply_physx_joint",
+ "apply_spatial_tendon",
+ "define_deformable_body_properties",
+ "modify_deformable_body_properties",
+]
+
+
+def apply_physx_joint(cfg, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Apply a :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` fragment to a joint prim.
+
+ Like :func:`~isaaclab.sim.schemas.apply_namespaced`, this applies ``PhysxJointAPI`` and writes
+ each non-``None`` field under the ``physxJoint:`` namespace. It additionally reproduces the
+ legacy joint-drive unit convention: for angular (revolute) joints, ``max_joint_velocity`` is
+ converted from rad/s to deg/s, since PhysX stores angular joint velocity limits in degrees.
+
+ Args:
+ cfg: The :class:`~isaaclab_physx.sim.schemas.PhysxJointCfg` fragment.
+ prim_path: The prim path of the joint.
+ stage: The stage where to find the prim. Defaults to None, in which case the current
+ stage is used.
+
+ Returns:
+ True if the properties were successfully set.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ prim = stage.GetPrimAtPath(prim_path)
+ namespace = type(cfg)._usd_namespace
+ applied = type(cfg)._usd_applied_schema
+ if applied and applied not in prim.GetAppliedSchemas():
+ prim.AddAppliedSchema(applied)
+ # angular (revolute) joints store velocity limits in degrees; linear (prismatic) in meters.
+ is_angular = prim.IsA(UsdPhysics.RevoluteJoint)
+ for f in dataclasses.fields(cfg):
+ if f.name == "func":
+ continue
+ value = getattr(cfg, f.name)
+ if value is None:
+ continue
+ if f.name == "max_joint_velocity" and is_angular:
+ value = value * 180.0 / math.pi # rad/s -> deg/s
+ safe_set_attribute_on_usd_prim(prim, f"{namespace}:{to_camel_case(f.name, 'cC')}", value, camel_case=False)
+ return True
+
+
+def _strip_fragment_fields(cfg) -> dict:
+ """Collect a fragment's non-``None`` data fields, excluding the ``func`` plumbing field.
+
+ Args:
+ cfg: The fragment instance to read fields from.
+
+ Returns:
+ A mapping of set field names to their values, ready to author as namespaced USD attributes.
+ """
+ return {
+ f.name: getattr(cfg, f.name)
+ for f in dataclasses.fields(cfg)
+ if f.name != "func" and getattr(cfg, f.name) is not None
+ }
+
+
+def _tune_multi_instance_tendon(cfg, prim_path: str, stage: Usd.Stage | None, markers: tuple[str, ...]) -> bool:
+ """Tune every multi-instance tendon schema (matching one of ``markers``) under ``prim_path``.
+
+ Shared backend for :func:`apply_fixed_tendon` / :func:`apply_spatial_tendon`. These schemas are
+ *tune-not-apply* (instances are authored in the source asset) and are typically applied on the
+ descendant joint prims rather than the ``prim_path`` the spawner targets, so this descends the
+ whole subtree (matching the legacy ``apply_nested`` traversal) and writes each set fragment field
+ as ``:`` on every prim carrying a matching instance. Applies no
+ schema. The fragment's ``_usd_namespace`` is unused (these are not flat-namespace fragments); the
+ schema marker is matched explicitly via ``markers``.
+
+ Args:
+ cfg: The tendon fragment whose set fields are written.
+ prim_path: The prim path (or articulation root) whose subtree carries the schemas.
+ stage: The stage to resolve the prim on. Defaults to the current stage.
+ markers: Substrings identifying the applied schema(s) to tune (e.g. ``("PhysxTendonAxisRootAPI",)``).
+
+ Returns:
+ True if at least one matching instance was tuned, False if none is applied.
+ """
+ if stage is None:
+ stage = get_current_stage()
+ root = stage.GetPrimAtPath(prim_path)
+ if not root.IsValid():
+ raise ValueError(f"Prim path '{prim_path}' is not valid.")
+ values = _strip_fragment_fields(cfg)
+ found = False
+ for prim in Usd.PrimRange(root):
+ applied_schemas = prim.GetAppliedSchemas()
+ if not any(m in s for s in applied_schemas for m in markers):
+ continue
+ found = True
+ for schema_name in applied_schemas:
+ if not any(m in schema_name for m in markers):
+ continue
+ for attr_name, value in values.items():
+ safe_set_attribute_on_usd_prim(
+ prim, f"{schema_name}:{to_camel_case(attr_name, 'cC')}", value, camel_case=False
+ )
+ return found
+
+
+def apply_fixed_tendon(cfg: PhysxFixedTendonCfg, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Tune the multi-instance ``PhysxTendonAxisRootAPI`` schemas on a prim.
+
+ Custom ``func`` override for :class:`PhysxFixedTendonCfg`. The fixed-tendon schema is
+ multi-instance and *tune-not-apply* (instances are authored in the source asset), so this
+ writes each set fragment field as ``:`` across every applied
+ ``PhysxTendonAxisRootAPI`` instance and applies no schema. Writes nothing for the ``mjc:``
+ Mujoco path — a separate ``MjcTendon``-aware Newton fragment handles that path.
+
+ Args:
+ cfg: The :class:`PhysxFixedTendonCfg` fragment to apply.
+ prim_path: The prim path carrying the fixed-tendon schemas.
+ stage: The stage where to find the prim. Defaults to the current stage.
+
+ Returns:
+ True if at least one ``PhysxTendonAxisRootAPI`` instance was tuned, False if none is applied.
+ """
+ return _tune_multi_instance_tendon(cfg, prim_path, stage, ("PhysxTendonAxisRootAPI",))
+
+
+def apply_spatial_tendon(cfg: PhysxSpatialTendonCfg, prim_path: str, stage: Usd.Stage | None = None) -> bool:
+ """Tune the multi-instance ``PhysxTendonAttachment{Root,Leaf}API`` schemas on a prim.
+
+ Custom ``func`` override for :class:`PhysxSpatialTendonCfg`. Writes each set fragment field
+ across every applied attachment-root and attachment-leaf instance and applies no schema.
+
+ Args:
+ cfg: The :class:`PhysxSpatialTendonCfg` fragment to apply.
+ prim_path: The prim path carrying the spatial-tendon schemas.
+ stage: The stage where to find the prim. Defaults to the current stage.
+
+ Returns:
+ True if at least one attachment instance was tuned, False if none is applied.
+ """
+ return _tune_multi_instance_tendon(
+ cfg, prim_path, stage, ("PhysxTendonAttachmentRootAPI", "PhysxTendonAttachmentLeafAPI")
+ )
diff --git a/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py b/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py
index 2eacd969e949..75c25c83826b 100644
--- a/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py
+++ b/source/isaaclab_physx/isaaclab_physx/sim/schemas/schemas_cfg.py
@@ -6,15 +6,23 @@
from __future__ import annotations
import warnings
+from collections.abc import Callable
from typing import ClassVar
from isaaclab.sim.schemas.schemas_cfg import (
ArticulationRootBaseCfg,
CollisionBaseCfg,
+ CollisionFragment,
DeformableBodyPropertiesBaseCfg,
+ FixedTendonFragment,
JointDriveBaseCfg,
+ JointDriveFragment,
MeshCollisionBaseCfg,
+ MeshCollisionFragment,
RigidBodyBaseCfg,
+ RigidBodyFragment,
+ SpatialTendonFragment,
+ _deprecate_field_alias,
)
from isaaclab.utils.configclass import configclass
@@ -261,6 +269,64 @@ class PhysxRigidBodyPropertiesCfg(RigidBodyBaseCfg):
"""The mass-normalized kinetic energy threshold below which an actor may participate in stabilization."""
+@configclass
+class PhysxRigidBodyCfg(RigidBodyFragment):
+ """``physxRigidBody:*`` rigid-body attributes from `PhysxRigidBodyAPI`_.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) for the
+ PhysX rigid-body add-on schema. Applied alongside :class:`~isaaclab.sim.schemas.UsdPhysicsRigidBodyCfg`
+ via :func:`~isaaclab.sim.schemas.apply_rigid_body_properties`.
+
+ .. _PhysxRigidBodyAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_rigid_body_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxRigidBody"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxRigidBodyAPI"
+
+ linear_damping: float | None = None
+ """Linear damping coefficient for the body [1/s]."""
+
+ angular_damping: float | None = None
+ """Angular damping coefficient for the body [1/s]."""
+
+ max_linear_velocity: float | None = None
+ """Maximum linear velocity for the body [m/s]."""
+
+ max_angular_velocity: float | None = None
+ """Maximum angular velocity for the body [deg/s]."""
+
+ max_depenetration_velocity: float | None = None
+ """Maximum depenetration velocity permitted to be introduced by the solver [m/s]."""
+
+ max_contact_impulse: float | None = None
+ """The limit on the impulse that may be applied at a contact [N·s]."""
+
+ enable_gyroscopic_forces: bool | None = None
+ """Enables computation of gyroscopic forces on the rigid body."""
+
+ retain_accelerations: bool | None = None
+ """Carries over forces/accelerations over sub-steps."""
+
+ solver_position_iteration_count: int | None = None
+ """Solver position iteration counts for the body."""
+
+ solver_velocity_iteration_count: int | None = None
+ """Solver velocity iteration counts for the body."""
+
+ sleep_threshold: float | None = None
+ """Mass-normalized kinetic energy threshold below which an actor may go to sleep [m²/s²]."""
+
+ stabilization_threshold: float | None = None
+ """Mass-normalized kinetic energy threshold below which an actor may participate in stabilization [m²/s²]."""
+
+ disable_gravity: bool | None = None
+ """Disable gravity for the body.
+
+ PhysX honors this per-body via ``physxRigidBody:disableGravity``: setting True excludes the
+ body from world gravity integration.
+ """
+
+
@configclass
class RigidBodyPropertiesCfg(PhysxRigidBodyPropertiesCfg):
"""Deprecated: use :class:`PhysxRigidBodyPropertiesCfg` or :class:`~isaaclab.sim.schemas.RigidBodyBaseCfg`.
@@ -284,6 +350,56 @@ def __post_init__(self):
super().__post_init__()
+@configclass
+class PhysxJointCfg(JointDriveFragment):
+ """``physxJoint:*`` joint attributes from `PhysxJointAPI`_.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) for the
+ PhysX joint add-on schema. Applied alongside :class:`~isaaclab.sim.schemas.UsdPhysicsDriveCfg`
+ via :func:`~isaaclab.sim.schemas.apply_joint_drive_properties`. Written with the dedicated
+ :func:`~isaaclab_physx.sim.schemas.apply_physx_joint` writer, which converts
+ :attr:`max_joint_velocity` from rad/s to deg/s for angular (revolute) joints.
+
+ .. _PhysxJointAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_joint_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxJoint"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxJointAPI"
+ # Override the generic applier: ``max_joint_velocity`` needs joint-type-aware rad->deg
+ # conversion for angular joints, which ``apply_namespaced`` cannot do.
+ func: Callable | str = "isaaclab_physx.sim.schemas:apply_physx_joint"
+
+ def __post_init__(self):
+ # Deprecation alias: ``max_velocity`` -> ``max_joint_velocity`` (the USD attr is
+ # ``maxJointVelocity``). Mirrors the legacy :class:`JointDriveBaseCfg` alias forwarding.
+ _deprecate_field_alias(self, "max_velocity", "max_joint_velocity")
+
+ max_joint_velocity: float | None = None
+ """Maximum velocity of the joint [m/s for linear joints, rad/s for angular joints].
+
+ Notes:
+ Today this writes ``physxJoint:maxJointVelocity`` (a PhysX add-on schema attribute).
+ Newton's USD importer consumes the same attribute via its PhysX-bridge resolver and
+ populates ``Model.joint_velocity_limit``; the PhysX engine consumes it natively.
+
+ .. note::
+ Authored in rad/s; :func:`~isaaclab_physx.sim.schemas.apply_physx_joint` converts it to
+ deg/s for angular (revolute) joints (PhysX's angular convention) and writes linear
+ (prismatic) joints unchanged, matching the legacy
+ :func:`~isaaclab.sim.schemas.modify_joint_drive_properties`.
+ """
+
+ max_velocity: float | None = None
+ """Deprecated alias for :attr:`max_joint_velocity`.
+
+ .. deprecated:: 4.6.25
+ Use :attr:`max_joint_velocity` instead. The cfg field is renamed so its snake_case name
+ maps identity-style to the USD camelCase attribute (``physxJoint:maxJointVelocity``). The
+ alias is forwarded to :attr:`max_joint_velocity` in :meth:`__post_init__` and will be
+ removed in 4.0.
+ """
+
+
@configclass
class PhysxJointDrivePropertiesCfg(JointDriveBaseCfg):
"""PhysX-specific joint drive properties.
@@ -332,6 +448,58 @@ def __post_init__(self):
super().__post_init__()
+@configclass
+class PhysxCollisionCfg(CollisionFragment):
+ """``physxCollision:*`` collision attributes from `PhysxCollisionAPI`_.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) for the
+ PhysX collision add-on schema. Applied alongside
+ :class:`~isaaclab.sim.schemas.UsdPhysicsCollisionCfg` via
+ :func:`~isaaclab.sim.schemas.apply_collision_properties`.
+
+ The :attr:`contact_offset` / :attr:`rest_offset` knobs live here as plain
+ ``physxCollision:*`` fields. Newton's USD importer consumes the same attributes via its
+ PhysX-bridge resolver, so they are not duplicated on the Newton collision fragment.
+
+ .. _PhysxCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxCollision"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxCollisionAPI"
+
+ contact_offset: float | None = None
+ """Contact offset for the collision shape [m].
+
+ The collision detector generates contact points as soon as two shapes get closer than the sum
+ of their contact offsets. This quantity should be non-negative, which means contact generation
+ can potentially start before the shapes actually penetrate.
+
+ Writes ``physxCollision:contactOffset``. Newton's USD importer consumes the same attribute via
+ its PhysX-bridge resolver.
+ """
+
+ rest_offset: float | None = None
+ """Rest offset for the collision shape [m].
+
+ The rest offset quantifies how close a shape gets to others at rest. At rest, the distance
+ between two vertically stacked objects is the sum of their rest offsets. If a pair of shapes
+ have a positive rest offset, the shapes will be separated at rest by an air gap.
+
+ Writes ``physxCollision:restOffset``. Newton's USD importer consumes the same attribute via its
+ PhysX-bridge resolver.
+ """
+
+ torsional_patch_radius: float | None = None
+ """Radius of the contact patch for applying torsional friction [m].
+
+ It is used to approximate rotational friction introduced by the compression of contacting
+ surfaces. If the radius is zero, no torsional friction is applied.
+ """
+
+ min_torsional_patch_radius: float | None = None
+ """Minimum radius of the contact patch for applying torsional friction [m]."""
+
+
@configclass
class PhysxCollisionPropertiesCfg(CollisionBaseCfg):
"""PhysX-specific rigid-body collision properties.
@@ -476,6 +644,171 @@ def __post_init__(self):
super().__post_init__()
+# -------------------------------------------------------------------------------------
+# Mesh-collision cooking fragments (single-namespace; PhysX cooking add-on schemas).
+#
+# Each fragment owns one ``physx*Collision:*`` namespace + applied schema; its
+# ``mesh_approximation_name`` default encodes the ``physics:approximation`` token its cooking
+# schema implies. The token is written by the family writer
+# ``isaaclab.sim.schemas.apply_mesh_collision_properties``; tuning attrs go via ``apply_namespaced``.
+# -------------------------------------------------------------------------------------
+
+
+@configclass
+class PhysxConvexHullCfg(MeshCollisionFragment):
+ """``physxConvexHullCollision:*`` mesh-cooking attributes from `PhysxConvexHullCollisionAPI`_.
+
+ A single-namespace fragment (see :class:`~isaaclab.sim.schemas.SchemaFragment`) for the PhysX
+ convex-hull cooking schema. The ``convexHull`` token is written to ``physics:approximation`` by
+ :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+
+ .. _PhysxConvexHullCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_convex_hull_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxConvexHullCollision"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxConvexHullCollisionAPI"
+
+ mesh_approximation_name: str = "convexHull"
+ """Name of mesh collision approximation method. Default: "convexHull"."""
+
+ hull_vertex_limit: int | None = None
+ """Convex hull vertex limit used for convex hull cooking [dimensionless]. Defaults to 64."""
+
+ min_thickness: float | None = None
+ """Convex hull min thickness [m]. Range: [0, inf). Default value is 0.001."""
+
+
+@configclass
+class PhysxConvexDecompositionCfg(MeshCollisionFragment):
+ """``physxConvexDecompositionCollision:*`` mesh-cooking attributes from `PhysxConvexDecompositionCollisionAPI`_.
+
+ A single-namespace fragment for the PhysX convex-decomposition cooking schema. The
+ ``convexDecomposition`` token is written to ``physics:approximation`` by
+ :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+
+ .. _PhysxConvexDecompositionCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_convex_decomposition_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxConvexDecompositionCollision"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxConvexDecompositionCollisionAPI"
+
+ mesh_approximation_name: str = "convexDecomposition"
+ """Name of mesh collision approximation method. Default: "convexDecomposition"."""
+
+ hull_vertex_limit: int | None = None
+ """Convex hull vertex limit used for convex hull cooking [dimensionless]. Defaults to 64."""
+
+ max_convex_hulls: int | None = None
+ """Maximum of convex hulls created during convex decomposition [dimensionless]. Default value is 32."""
+
+ min_thickness: float | None = None
+ """Convex hull min thickness [m]. Range: [0, inf). Default value is 0.001."""
+
+ voxel_resolution: int | None = None
+ """Voxel resolution used for convex decomposition [dimensionless]. Defaults to 500,000 voxels."""
+
+ error_percentage: float | None = None
+ """Convex decomposition error percentage parameter [%]. Defaults to 10 percent."""
+
+ shrink_wrap: bool | None = None
+ """Attempts to adjust the convex hull points so that they are projected onto the surface of the
+ original graphics mesh. Defaults to False.
+ """
+
+
+@configclass
+class PhysxTriangleMeshCfg(MeshCollisionFragment):
+ """``physxTriangleMeshCollision:*`` mesh-cooking attributes from `PhysxTriangleMeshCollisionAPI`_.
+
+ A single-namespace fragment for the PhysX triangle-mesh cooking schema (PhysX-only colliders).
+
+ .. _PhysxTriangleMeshCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_triangle_mesh_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxTriangleMeshCollision"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxTriangleMeshCollisionAPI"
+
+ mesh_approximation_name: str = "none"
+ """Name of mesh collision approximation method. Default: "none" (uses triangle mesh)."""
+
+ weld_tolerance: float | None = None
+ """Mesh weld tolerance controlling the distance at which vertices are welded [m].
+
+ Default ``-inf`` autocomputes the welding tolerance from the mesh size; ``0`` disables welding.
+ Range: [0, inf).
+ """
+
+
+@configclass
+class PhysxTriangleMeshSimplificationCfg(MeshCollisionFragment):
+ """``physxTriangleMeshSimplificationCollision:*`` attributes from `PhysxTriangleMeshSimplificationCollisionAPI`_.
+
+ A single-namespace fragment for the PhysX triangle-mesh-simplification cooking schema. The
+ ``meshSimplification`` token is written to ``physics:approximation`` by
+ :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+
+ .. _PhysxTriangleMeshSimplificationCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_triangle_mesh_simplification_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxTriangleMeshSimplificationCollision"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxTriangleMeshSimplificationCollisionAPI"
+
+ mesh_approximation_name: str = "meshSimplification"
+ """Name of mesh collision approximation method. Default: "meshSimplification"."""
+
+ simplification_metric: float | None = None
+ """Mesh simplification accuracy [dimensionless]. Defaults to 0.55."""
+
+ weld_tolerance: float | None = None
+ """Mesh weld tolerance controlling the distance at which vertices are welded [m].
+
+ Default ``-inf`` autocomputes the welding tolerance from the mesh size; ``0`` disables welding.
+ Range: [0, inf).
+ """
+
+
+@configclass
+class PhysxSDFMeshCfg(MeshCollisionFragment):
+ """``physxSDFMeshCollision:*`` mesh-cooking attributes from `PhysxSDFMeshCollisionAPI`_.
+
+ A single-namespace fragment for the PhysX signed-distance-field cooking schema (PhysX-only
+ colliders). The ``sdf`` token is written to ``physics:approximation`` by
+ :func:`~isaaclab.sim.schemas.apply_mesh_collision_properties`.
+
+ .. _PhysxSDFMeshCollisionAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/latest/class_physx_schema_physx_s_d_f_mesh_collision_a_p_i.html
+ """
+
+ _usd_namespace: ClassVar[str | None] = "physxSDFMeshCollision"
+ _usd_applied_schema: ClassVar[str | None] = "PhysxSDFMeshCollisionAPI"
+
+ mesh_approximation_name: str = "sdf"
+ """Name of mesh collision approximation method. Default: "sdf"."""
+
+ sdf_margin: float | None = None
+ """Margin to increase the size of the SDF relative to the mesh bounding-box diagonal [dimensionless].
+
+ Scale-independent (fraction of the bounding-box diagonal). Default value is 0.01. Range: [0, inf).
+ """
+
+ sdf_narrow_band_thickness: float | None = None
+ """Size of the narrow band around the mesh surface with high-resolution SDF samples [dimensionless].
+
+ Scale-independent (fraction of the bounding-box diagonal). Default value is 0.01. Range: [0, 1].
+ """
+
+ sdf_resolution: int | None = None
+ """Uniform SDF sampling resolution (largest AABB extent divided by this value) [dimensionless].
+
+ Default value is 256. Range: (1, inf).
+ """
+
+ sdf_subgrid_resolution: int | None = None
+ """Subgrid resolution enabling SDF sparsity; ``0`` selects a dense SDF [dimensionless].
+
+ Default value is 6. Range: [0, inf).
+ """
+
+
@configclass
class PhysxConvexHullPropertiesCfg(MeshCollisionBaseCfg):
"""PhysX convex-hull cooking properties for a mesh collider.
@@ -911,3 +1244,96 @@ def __post_init__(self):
stacklevel=2,
)
super().__post_init__()
+
+
+@configclass
+class PhysxFixedTendonCfg(FixedTendonFragment):
+ """PhysX fixed-tendon attributes from `PhysxTendonAxisRootAPI`_.
+
+ A fixed-tendon fragment (see :class:`~isaaclab.sim.schemas.FixedTendonFragment`) for the
+ PhysX fixed-tendon schema. Unlike single-namespace fragments, this is a *tune-not-apply*
+ fragment: the multi-instance ``PhysxTendonAxisRootAPI:`` schemas already exist on the
+ prim (authored in the source asset), so the fragment overrides
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func` with :func:`apply_fixed_tendon`, which
+ descends the prim subtree and tunes every existing ``PhysxTendonAxisRootAPI:`` instance
+ directly.
+
+ Dispatched via :func:`~isaaclab.sim.schemas.apply_fixed_tendon_properties`.
+
+ .. _PhysxTendonAxisRootAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_tendon_axis_root_a_p_i.html
+ """
+
+ # Not namespace-driven: the custom applier matches the multi-instance schema explicitly, so
+ # ``_usd_namespace`` stays ``None`` -- this also guards against accidentally routing the fragment
+ # through the generic ``apply_namespaced`` (which would raise on a missing namespace).
+ _usd_namespace: ClassVar[str | None] = None
+ # override ``func``: writer iterates multi-instance ``PhysxTendonAxisRootAPI`` schemas; ``apply_namespaced`` cannot.
+ func: Callable | str = "isaaclab_physx.sim.schemas:apply_fixed_tendon"
+
+ tendon_enabled: bool | None = None
+ """Whether to enable or disable the tendon."""
+
+ stiffness: float | None = None
+ """Spring stiffness term acting on the tendon's length [N/m]."""
+
+ damping: float | None = None
+ """The damping term acting on both the tendon length and the tendon-length limits [N·s/m]."""
+
+ limit_stiffness: float | None = None
+ """Limit stiffness term acting on the tendon's length limits [N/m]."""
+
+ offset: float | None = None
+ """Length offset term for the tendon [m].
+
+ It defines an amount to be added to the accumulated length computed for the tendon. This allows the application
+ to actuate the tendon by shortening or lengthening it.
+ """
+
+ rest_length: float | None = None
+ """Spring rest length of the tendon [m]."""
+
+
+@configclass
+class PhysxSpatialTendonCfg(SpatialTendonFragment):
+ """PhysX spatial-tendon attributes from `PhysxTendonAttachmentRootAPI`_.
+
+ A spatial-tendon fragment (see :class:`~isaaclab.sim.schemas.SpatialTendonFragment`) for the
+ PhysX spatial-tendon schema. Unlike single-namespace fragments, this is a *tune-not-apply*
+ fragment: the multi-instance ``PhysxTendonAttachmentRootAPI:`` /
+ ``PhysxTendonAttachmentLeafAPI:`` schemas already exist on the prim (authored in the
+ source asset), so the fragment overrides
+ :attr:`~isaaclab.sim.schemas.SchemaFragment.func` with :func:`apply_spatial_tendon`, which
+ descends the prim subtree and tunes every existing ``PhysxTendonAttachmentRootAPI:`` /
+ ``PhysxTendonAttachmentLeafAPI:`` instance directly.
+
+ Dispatched via :func:`~isaaclab.sim.schemas.apply_spatial_tendon_properties`.
+
+ .. _PhysxTendonAttachmentRootAPI: https://docs.omniverse.nvidia.com/kit/docs/omni_usd_schema_physics/104.2/class_physx_schema_physx_tendon_attachment_root_a_p_i.html
+ """
+
+ # Not namespace-driven: the custom applier matches the multi-instance schemas explicitly, so
+ # ``_usd_namespace`` stays ``None`` -- this also guards against accidentally routing the fragment
+ # through the generic ``apply_namespaced`` (which would raise on a missing namespace).
+ _usd_namespace: ClassVar[str | None] = None
+ # override ``func``: writer iterates multi-instance ``PhysxTendonAttachment{Root,Leaf}API``
+ # schemas, which the generic ``apply_namespaced`` cannot.
+ func: Callable | str = "isaaclab_physx.sim.schemas:apply_spatial_tendon"
+
+ tendon_enabled: bool | None = None
+ """Whether to enable or disable the tendon."""
+
+ stiffness: float | None = None
+ """Spring stiffness term acting on the tendon's length [N/m]."""
+
+ damping: float | None = None
+ """The damping term acting on both the tendon length and the tendon-length limits [N·s/m]."""
+
+ limit_stiffness: float | None = None
+ """Limit stiffness term acting on the tendon's length limits [N/m]."""
+
+ offset: float | None = None
+ """Length offset term for the tendon [m].
+
+ It defines an amount to be added to the accumulated length computed for the tendon. This allows the application
+ to actuate the tendon by shortening or lengthening it.
+ """
diff --git a/source/isaaclab_physx/pyproject.toml b/source/isaaclab_physx/pyproject.toml
index f63c83809f95..938bc4079cd6 100644
--- a/source/isaaclab_physx/pyproject.toml
+++ b/source/isaaclab_physx/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab_physx"
-version = "2.0.2"
+version = "2.4.0"
description = "Extension providing IsaacLab with PhysX specific abstractions."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
@@ -24,7 +24,7 @@ Repository = "https://github.com/isaac-sim/IsaacLab"
[project.optional-dependencies]
newton = [
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
]
[tool.setuptools]
diff --git a/source/isaaclab_physx/test/assets/test_articulation.py b/source/isaaclab_physx/test/assets/test_articulation.py
index af36a365cb66..ac4755962a95 100644
--- a/source/isaaclab_physx/test/assets/test_articulation.py
+++ b/source/isaaclab_physx/test/assets/test_articulation.py
@@ -1753,8 +1753,9 @@ def test_body_root_state(sim, num_articulations, device, with_offset):
link_offset = [1.0, 0.0, 0.0] # the offset from CenterPivot to Arm frames
new_com = torch.tensor(offset, device=device).repeat(num_articulations, 1, 1)
com[:, arm_idx, :3] = new_com.squeeze(-2)
- articulation.root_view.set_coms(
- wp.from_torch(com.cpu(), dtype=wp.float32), wp.from_torch(env_idx.cpu(), dtype=wp.int32)
+ articulation.set_coms_index(
+ coms=wp.from_torch(com.to(device).contiguous(), dtype=wp.transformf),
+ env_ids=wp.from_torch(env_idx, dtype=wp.int32),
)
# check they are set
@@ -1869,8 +1870,9 @@ def test_write_root_state(sim, num_articulations, device, with_offset, state_loc
com = wp.to_torch(articulation.root_view.get_coms())
new_com = offset
com[:, 0, :3] = new_com.squeeze(-2)
- articulation.root_view.set_coms(
- wp.from_torch(com.cpu(), dtype=wp.float32), wp.from_torch(env_idx.cpu(), dtype=wp.int32)
+ articulation.set_coms_index(
+ coms=wp.from_torch(com.to(device).contiguous(), dtype=wp.transformf),
+ env_ids=wp.from_torch(env_idx, dtype=wp.int32),
)
# check they are set
diff --git a/source/isaaclab_physx/test/renderers/test_isaac_rtx_renderer_scene_partitioning.py b/source/isaaclab_physx/test/renderers/test_isaac_rtx_renderer_scene_partitioning.py
index c54bf9ee85ef..22c3ae59a75f 100644
--- a/source/isaaclab_physx/test/renderers/test_isaac_rtx_renderer_scene_partitioning.py
+++ b/source/isaaclab_physx/test/renderers/test_isaac_rtx_renderer_scene_partitioning.py
@@ -17,6 +17,12 @@
``isaacsim_ci`` test file in its own app, so keeping these tests isolated here gives them
a clean renderer and exercises the real single-scene use case.
+Per-env scene partitioning is gated behind the
+``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION`` environment variable and is off
+by default. Tests that verify partitioning is *active* use the ``enable_scene_partition``
+fixture, which sets the variable for the duration of the test and restores the previous
+state afterwards.
+
Launch Isaac Sim Simulator first.
"""
@@ -32,6 +38,7 @@
import pytest
import torch
import warp as wp
+from isaaclab_physx.renderers.isaac_rtx_renderer import IsaacRtxRenderer, IsaacRtxRendererCfg
import isaaclab.sim as sim_utils
from isaaclab.assets import ArticulationCfg, AssetBaseCfg, RigidObjectCfg
@@ -42,9 +49,42 @@
from isaaclab_assets.robots.kuka_allegro import KUKA_ALLEGRO_CFG
+_ENV_VAR = "ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION"
+
+
+@pytest.fixture()
+def enable_scene_partition(monkeypatch):
+ """Set ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` for the duration of one test."""
+ monkeypatch.setenv(_ENV_VAR, "1")
+
+
+@pytest.mark.isaacsim_ci
+def test_partitioning_disabled_by_default(monkeypatch):
+ """``primvars:omni:scenePartition`` must NOT be authored when the env var is absent.
+
+ The feature is off by default; this test confirms that :meth:`IsaacRtxRenderer.prepare_stage`
+ is a no-op without ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1``.
+ """
+ from pxr import Usd
+
+ monkeypatch.delenv(_ENV_VAR, raising=False)
+
+ stage = Usd.Stage.CreateInMemory()
+ world = stage.DefinePrim("/World", "Xform") # noqa: F841
+ env0 = stage.DefinePrim("/World/envs/env_0", "Xform") # noqa: F841
+
+ renderer = object.__new__(IsaacRtxRenderer)
+ renderer.cfg = IsaacRtxRendererCfg()
+ renderer.prepare_stage(stage, num_envs=1)
+
+ prim = stage.GetPrimAtPath("/World/envs/env_0")
+ assert not prim.HasAttribute("primvars:omni:scenePartition"), (
+ "primvars:omni:scenePartition must not be authored when partitioning is disabled."
+ )
+
@pytest.mark.isaacsim_ci
-def test_partitioning_isolates_rigid_object():
+def test_partitioning_isolates_rigid_object(enable_scene_partition):
"""Per-env :class:`~isaaclab.assets.RigidObject` instances at unique world positions render
as visibly different per-env tiles when RTX honors ``primvars:omni:scenePartition``."""
@@ -111,7 +151,7 @@ class _Scene(InteractiveSceneCfg):
@pytest.mark.isaacsim_ci
-def test_partitioning_isolates_articulation():
+def test_partitioning_isolates_articulation(enable_scene_partition):
"""Per-env :class:`~isaaclab.assets.Articulation` instances driven to wildly different joint
poses render as visibly different per-env tiles when RTX honors top-level scene partitions."""
diff --git a/source/isaaclab_tasks/changelog.d/jmart-cartpole-rtx.rst b/source/isaaclab_tasks/changelog.d/jmart-cartpole-rtx.rst
deleted file mode 100644
index c25a345722f7..000000000000
--- a/source/isaaclab_tasks/changelog.d/jmart-cartpole-rtx.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-Fixed
-^^^^^
-
-* Fixed the camera-based Cartpole task failing to converge under Newton physics with the RTX
- ``depth``, ``albedo``, and ``simple_shading`` AOV observations. These AOVs bypass DLSS temporal
- accumulation, so the observation carried no temporal cue for the policy to infer velocity from
- (Newton's symplectic integrator has no implicit damping). The ``frame_stack`` default resolver
- now enables 2-frame stacking for these Newton + RTX AOVs, matching the existing Newton + Warp
- behavior; Newton + RTX ``rgb`` keeps single-frame observations as DLSS already supplies the cue.
- The resolver reads backend capability classmethods
- (:meth:`~isaaclab.physics.physics_manager.PhysicsManager.provides_implicit_damping`,
- :meth:`~isaaclab.renderers.base_renderer.BaseRenderer.provides_temporal_camera_data`) resolved
- from the configs, instead of hard-coding backend types in the task.
diff --git a/source/isaaclab_tasks/config/extension.toml b/source/isaaclab_tasks/config/extension.toml
index 781b51f6cca7..aa7d9ee1374f 100644
--- a/source/isaaclab_tasks/config/extension.toml
+++ b/source/isaaclab_tasks/config/extension.toml
@@ -1,7 +1,7 @@
[package]
# Note: Semantic Versioning is used: https://semver.org/
-version = "8.0.4"
+version = "8.1.0"
# Description
title = "Isaac Lab Environments"
diff --git a/source/isaaclab_tasks/docs/CHANGELOG.rst b/source/isaaclab_tasks/docs/CHANGELOG.rst
index 540363429b2c..669832006f3b 100644
--- a/source/isaaclab_tasks/docs/CHANGELOG.rst
+++ b/source/isaaclab_tasks/docs/CHANGELOG.rst
@@ -1,6 +1,115 @@
Changelog
---------
+8.1.0 (2026-06-27)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added ``Isaac-Stack-Cube-SO101-v0`` and ``Isaac-Stack-Cube-SO101-IK-Abs-v0`` cube-stacking
+ environments for the SO-101 5-DOF arm. The IK-Abs variant uses absolute task-space
+ differential inverse kinematics and is seated on the table.
+* Generalized the cube-stack MDP gripper observations and terminations to support single-jaw
+ grippers in addition to two-finger parallel grippers.
+* Added XR teleoperation for ``Isaac-Stack-Cube-SO101-IK-Abs-v0`` via an IsaacTeleop retargeting
+ pipeline built from the SO-101 retargeters in ``isaacteleop.retargeters``. Controller poses are
+ rebased into the robot base frame upstream via
+ :attr:`~isaaclab_teleop.IsaacTeleopCfg.target_frame_prim_path` (set to the seated, +90 deg-yawed
+ base prim), so the retargeters work directly in the IK command frame. End-effector motion is
+ clutch-rebased around the pose captured on engage: the clutch latches on the first running frame
+ (the headset "Play") and seeds its home from a static reset-origin (the gripper's pose in the
+ base frame at the seated init pose) so engaging with a steady controller does not move the arm,
+ then keeps a running home so a mid-task re-clutch resumes from the last commanded pose. The
+ gripper jaw tracks the controller trigger continuously (analog).
+
+Changed
+^^^^^^^
+
+* **Breaking:** Reworked the ``Isaac-Stack-Cube-SO101-IK-Abs-v0`` teleop control to command the
+ full end-effector SE3 pose. The arm action is now an 8-D
+ ``[pos_x, pos_y, pos_z, quat_x, quat_y, quat_z, quat_w, gripper]`` (orientation xyzw),
+ replacing the previous 6-D ``[pos_x, pos_y, pos_z, pitch, roll, gripper]``. A single
+ full-pose differential IK (``SO101PoseIKController``, ``command_type="pose"``) now solves all
+ **5** arm joints (``shoulder_pan``, ``shoulder_lift``, ``elbow_flex``, ``wrist_flex``,
+ ``wrist_roll``) over a 6-row task: 3 linear rows track position exactly (weight 1) and 3
+ orientation rows are soft-weighted by the core controller's ``orientation_weight`` (default
+ ``0.5``). This replaces the reduced 4-row ``[x, y, z, pitch]`` IK over 4 joints plus a separate
+ ``wrist_roll`` action. The manipulability-aware damped least squares
+ (``ik_method="adaptive_dls"``) and null-space joint-limit avoidance are now provided by the core
+ :class:`~isaaclab.controllers.DifferentialIKController`; ``SO101PoseIKController`` only adds the
+ wrist-only orientation joint mask (restricting orientation to ``wrist_flex`` / ``wrist_roll`` so
+ ``shoulder_pan`` stays position-only) on top.
+
+ Migration: the controller / action classes were renamed
+ ``SO101PositionPitchIK{Controller,ControllerCfg,Action,ActionCfg}`` ->
+ ``SO101PoseIK{...}`` (modules ``position_pitch_ik_{controller,action}.py`` ->
+ ``pose_ik_{controller,action}.py``), the cfg field ``pitch_task_weight`` ->
+ ``orientation_weight``, and the ``wrist_roll_action`` term was removed (``wrist_roll`` is
+ now solved by the IK). The SO-101 ``SO101WristRetargeter`` (and its ``SO101RollRetargeter``
+ alias) was removed from ``isaacteleop.retargeters``; the clutch retargeter now drives the full
+ pose with a fixed orientation calibration offset.
+* Refactored the cube-stack scaffolding so the SO-101 config no longer depends on Franka. The
+ cube setup, table/ground/robot semantics, end-effector frame builder, and reset events were
+ promoted to the robot-neutral :class:`~isaaclab_tasks.contrib.stack.stack_env_cfg.StackEnvCfg`
+ base, and the Franka and SO-101 joint-position configs are now override-only. The generic stack
+ event functions moved to ``isaaclab_tasks.contrib.stack.mdp.stack_events`` (``franka_stack_events``
+ re-exports them for backward compatibility), and ``randomize_joint_by_gaussian_offset`` now holds
+ the gripper joints fixed by resolving them from the env's ``gripper_joint_names`` rather than
+ assuming the last two joints are the gripper.
+
+
+8.0.7 (2026-06-26)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added ``"normals"`` to the rendering correctness validation suite. The ``normals`` data type
+ (float32 surface normal vectors in ``[-1, 1]``) is now included in
+ :data:`~rendering_test_utils._DEFAULT_SENSOR_DATA_TYPES` for all RTX-based renderer
+ combinations and as an explicit parameter for the Newton Warp renderer.
+
+Changed
+^^^^^^^
+
+* Changed :class:`~isaaclab_tasks.utils.presets.MultiBackendRendererCfg` to
+ expose automatic ``rtx`` selection through ``renderer=rtx``.
+
+
+8.0.6 (2026-06-25)
+~~~~~~~~~~~~~~~~~~
+
+Added
+^^^^^
+
+* Added golden-image rendering tests for ``distance_to_camera`` and ``distance_to_image_plane``
+ AOV types across the Cartpole, DexSuite Kuka, and Shadow Hand camera environments.
+ Test-local subclasses of the relevant env and camera configs are used so the production
+ task API remains unchanged.
+* Added ``enable_scene_partition`` pytest fixture and enabled Isaac RTX per-environment scene
+ partitioning in rendering correctness tests for cartpole and registered camera tasks as a
+ temporary workaround.
+
+
+8.0.5 (2026-06-24)
+~~~~~~~~~~~~~~~~~~
+
+Fixed
+^^^^^
+
+* Fixed the camera-based Cartpole task failing to converge under Newton physics with the RTX
+ ``depth``, ``albedo``, and ``simple_shading`` AOV observations. These AOVs bypass DLSS temporal
+ accumulation, so the observation carried no temporal cue for the policy to infer velocity from
+ (Newton's symplectic integrator has no implicit damping). The ``frame_stack`` default resolver
+ now enables 2-frame stacking for these Newton + RTX AOVs, matching the existing Newton + Warp
+ behavior; Newton + RTX ``rgb`` keeps single-frame observations as DLSS already supplies the cue.
+ The resolver reads backend capability classmethods
+ (:meth:`~isaaclab.physics.physics_manager.PhysicsManager.provides_implicit_damping`,
+ :meth:`~isaaclab.renderers.base_renderer.BaseRenderer.provides_temporal_camera_data`) resolved
+ from the configs, instead of hard-coding backend types in the task.
+
+
8.0.4 (2026-06-23)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/franka/stack_joint_pos_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/franka/stack_joint_pos_env_cfg.py
index 0bb1a635b921..7cc2ce66d2af 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/franka/stack_joint_pos_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/franka/stack_joint_pos_env_cfg.py
@@ -3,24 +3,20 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-from isaaclab.assets import ArticulationCfg, RigidObjectCfg
-from isaaclab.managers import EventTermCfg as EventTerm
-from isaaclab.managers import SceneEntityCfg
-from isaaclab.sensors import FrameTransformerCfg
-from isaaclab.sensors.frame_transformer.frame_transformer_cfg import OffsetCfg
-from isaaclab.sim.schemas.schemas_cfg import RigidBodyPropertiesCfg
-from isaaclab.sim.spawners.from_files.from_files_cfg import UsdFileCfg
-from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
+from isaaclab.assets import ArticulationCfg
from isaaclab.utils.configclass import configclass
from isaaclab_tasks.contrib.stack import mdp
-from isaaclab_tasks.contrib.stack.mdp import franka_stack_events
-from isaaclab_tasks.contrib.stack.stack_env_cfg import StackEnvCfg
+from isaaclab_tasks.contrib.stack.stack_env_cfg import (
+ StackEnvCfg,
+ StackEventCfg,
+ apply_default_semantics,
+ make_ee_frame_cfg,
+)
##
# Pre-defined configs
##
-from isaaclab.markers.config import FRAME_MARKER_CFG # isort: skip
from isaaclab_assets.robots.franka import FRANKA_PANDA_CFG # isort: skip
# Default arm + gripper joint pose
@@ -36,41 +32,22 @@
}
-@configclass
-class EventCfg:
- """Configuration for events."""
-
- randomize_franka_joint_state = EventTerm(
- func=franka_stack_events.randomize_joint_by_gaussian_offset,
- mode="reset",
- params={
- "mean": 0.0,
- "std": 0.02,
- "asset_cfg": SceneEntityCfg("robot"),
- },
- )
-
- randomize_cube_positions = EventTerm(
- func=franka_stack_events.randomize_object_pose,
- mode="reset",
- params={
- "pose_range": {"x": (0.4, 0.6), "y": (-0.10, 0.10), "z": (0.0203, 0.0203), "yaw": (-1.0, 1, 0)},
- "min_separation": 0.1,
- "asset_cfgs": [SceneEntityCfg("cube_1"), SceneEntityCfg("cube_2"), SceneEntityCfg("cube_3")],
- },
- )
-
-
@configclass
class FrankaCubeStackEnvCfg(StackEnvCfg):
- """Configuration for the Franka Cube Stack Environment."""
+ """Configuration for the Franka Cube Stack Environment.
+
+ Uses the robot-neutral stack scaffolding (cubes, semantics, ee-frame builder, reset events)
+ from :mod:`~isaaclab_tasks.contrib.stack.stack_env_cfg`; the default cube transforms and
+ workspace there match the Franka layout, so only the robot, actions/gripper, and end-effector
+ frame prim paths are set here.
+ """
def __post_init__(self):
# post init of parent
super().__post_init__()
- # Set events
- self.events = EventCfg()
+ # Set robot-neutral reset events (default cube workspace matches the Franka layout).
+ self.events = StackEventCfg()
# Set Franka as robot
self.scene.robot = FRANKA_PANDA_CFG.replace(
@@ -78,14 +55,8 @@ def __post_init__(self):
init_state=ArticulationCfg.InitialStateCfg(joint_pos=_FRANKA_STACK_IK_REL_INIT_JOINT_POS),
)
- # Add semantics to table
- self.scene.table.spawn.semantic_tags = [("class", "table")]
-
- # Add semantics to ground
- self.scene.plane.semantic_tags = [("class", "ground")]
-
- # Add semantics to robot
- self.scene.robot.spawn.semantic_tags = [("class", "robot")]
+ # Tag the table / ground / robot semantic classes.
+ apply_default_semantics(self.scene)
# Set actions for the specific robot type (franka)
self.actions.arm_action = mdp.JointPositionActionCfg(
@@ -102,77 +73,13 @@ def __post_init__(self):
self.gripper_open_val = 0.04
self.gripper_threshold = 0.005
- # Rigid body properties of each cube
- cube_properties = RigidBodyPropertiesCfg(
- solver_position_iteration_count=16,
- solver_velocity_iteration_count=1,
- max_angular_velocity=1000.0,
- max_linear_velocity=1000.0,
- max_depenetration_velocity=5.0,
- disable_gravity=False,
- )
-
- # Set each stacking cube deterministically
- self.scene.cube_1 = RigidObjectCfg(
- prim_path="{ENV_REGEX_NS}/Cube_1",
- init_state=RigidObjectCfg.InitialStateCfg(pos=[0.4, 0.0, 0.0203], rot=[0, 0, 0, 1]),
- spawn=UsdFileCfg(
- usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/blue_block.usd",
- scale=(1.0, 1.0, 1.0),
- rigid_props=cube_properties,
- semantic_tags=[("class", "cube_1")],
- ),
- )
- self.scene.cube_2 = RigidObjectCfg(
- prim_path="{ENV_REGEX_NS}/Cube_2",
- init_state=RigidObjectCfg.InitialStateCfg(pos=[0.55, 0.05, 0.0203], rot=[0, 0, 0, 1]),
- spawn=UsdFileCfg(
- usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/red_block.usd",
- scale=(1.0, 1.0, 1.0),
- rigid_props=cube_properties,
- semantic_tags=[("class", "cube_2")],
- ),
- )
- self.scene.cube_3 = RigidObjectCfg(
- prim_path="{ENV_REGEX_NS}/Cube_3",
- init_state=RigidObjectCfg.InitialStateCfg(pos=[0.60, -0.1, 0.0203], rot=[0, 0, 0, 1]),
- spawn=UsdFileCfg(
- usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/green_block.usd",
- scale=(1.0, 1.0, 1.0),
- rigid_props=cube_properties,
- semantic_tags=[("class", "cube_3")],
- ),
- )
-
- # Listens to the required transforms
- marker_cfg = FRAME_MARKER_CFG.copy()
- marker_cfg.markers["frame"].scale = (0.1, 0.1, 0.1)
- marker_cfg.prim_path = "/Visuals/FrameTransformer"
- self.scene.ee_frame = FrameTransformerCfg(
- prim_path="{ENV_REGEX_NS}/Robot/panda_link0",
- debug_vis=False,
- visualizer_cfg=marker_cfg,
- target_frames=[
- FrameTransformerCfg.FrameCfg(
- prim_path="{ENV_REGEX_NS}/Robot/panda_hand",
- name="end_effector",
- offset=OffsetCfg(
- pos=[0.0, 0.0, 0.1034],
- ),
- ),
- FrameTransformerCfg.FrameCfg(
- prim_path="{ENV_REGEX_NS}/Robot/panda_rightfinger",
- name="tool_rightfinger",
- offset=OffsetCfg(
- pos=(0.0, 0.0, 0.046),
- ),
- ),
- FrameTransformerCfg.FrameCfg(
- prim_path="{ENV_REGEX_NS}/Robot/panda_leftfinger",
- name="tool_leftfinger",
- offset=OffsetCfg(
- pos=(0.0, 0.0, 0.046),
- ),
- ),
+ # End-effector frame (the shared cubes/spawns come from the base scene).
+ self.scene.ee_frame = make_ee_frame_cfg(
+ base_prim_path="{ENV_REGEX_NS}/Robot/panda_link0",
+ target_specs=[
+ ("{ENV_REGEX_NS}/Robot/panda_hand", "end_effector", (0.0, 0.0, 0.1034)),
+ ("{ENV_REGEX_NS}/Robot/panda_rightfinger", "tool_rightfinger", (0.0, 0.0, 0.046)),
+ ("{ENV_REGEX_NS}/Robot/panda_leftfinger", "tool_leftfinger", (0.0, 0.0, 0.046)),
],
+ marker_scale=(0.1, 0.1, 0.1),
)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/__init__.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/__init__.py
new file mode 100644
index 000000000000..98851798edd5
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/__init__.py
@@ -0,0 +1,35 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+import gymnasium as gym
+
+##
+# Register Gym environments.
+##
+
+##
+# Joint Position Control
+##
+
+gym.register(
+ id="IsaacContrib-Stack-Cube-SO101-v0",
+ entry_point="isaaclab.envs:ManagerBasedRLEnv",
+ kwargs={
+ "env_cfg_entry_point": f"{__name__}.stack_joint_pos_env_cfg:SO101CubeStackEnvCfg",
+ },
+ disable_env_checker=True,
+)
+
+##
+# Inverse Kinematics - Absolute Pose Control
+##
+
+gym.register(
+ id="IsaacContrib-Stack-Cube-SO101-IK-Abs-v0",
+ entry_point="isaaclab.envs:ManagerBasedRLEnv",
+ kwargs={
+ "env_cfg_entry_point": f"{__name__}.stack_ik_abs_env_cfg:SO101CubeStackEnvCfg",
+ },
+ disable_env_checker=True,
+)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_action.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_action.py
new file mode 100644
index 000000000000..fdac999d3488
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_action.py
@@ -0,0 +1,44 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Configuration for the SO-101 full-pose SE3 IK action term.
+
+This module is pure data: it must stay importable without Kit so ``load_cfg_from_registry`` can
+construct the env cfg before deciding whether to launch the simulator (see
+``test/core/test_env_cfg_no_forbidden_imports.py``). The live term lives in
+:mod:`.pose_ik_action_term` because subclassing
+:class:`~isaaclab.envs.mdp.actions.task_space_actions.DifferentialInverseKinematicsAction` forces an
+eager ``from pxr import UsdPhysics`` import. We therefore reference the term lazily via a
+``"{DIR}.pose_ik_action_term:SO101PoseIKAction"`` string ``class_type`` (resolved by
+:meth:`cfg.validate` after Kit has launched), mirroring the base
+:class:`~isaaclab.envs.mdp.actions.actions_cfg.DifferentialInverseKinematicsActionCfg`.
+
+.. note::
+ :attr:`~isaaclab.envs.mdp.actions.actions_cfg.DifferentialInverseKinematicsActionCfg.clip`
+ is not supported for this subclass. The base clips by action-dim axis using joint-name
+ keys, but this term's action layout is the task-space pose ``[pos_xyz, quat_xyzw]``, which
+ does not map to joint names. Setting ``clip`` raises :exc:`NotImplementedError`.
+"""
+
+from __future__ import annotations
+
+from dataclasses import MISSING
+from typing import TYPE_CHECKING
+
+from isaaclab.envs.mdp.actions.actions_cfg import DifferentialInverseKinematicsActionCfg
+from isaaclab.utils.configclass import configclass
+
+from .pose_ik_controller import SO101PoseIKControllerCfg
+
+if TYPE_CHECKING:
+ from .pose_ik_action_term import SO101PoseIKAction
+
+
+@configclass
+class SO101PoseIKActionCfg(DifferentialInverseKinematicsActionCfg):
+ """Configuration for :class:`~.pose_ik_action_term.SO101PoseIKAction`."""
+
+ class_type: type[SO101PoseIKAction] | str = "{DIR}.pose_ik_action_term:SO101PoseIKAction"
+ controller: SO101PoseIKControllerCfg = MISSING
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_action_term.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_action_term.py
new file mode 100644
index 000000000000..a7e7cecfb1de
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_action_term.py
@@ -0,0 +1,69 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Runtime action term for the SO-101 full-pose SE3 IK controller.
+
+This module hosts the live :class:`SO101PoseIKAction` term. It is intentionally **separate**
+from :mod:`.pose_ik_action` (which holds the pure-data :class:`~.pose_ik_action.SO101PoseIKActionCfg`)
+because subclassing :class:`~isaaclab.envs.mdp.actions.task_space_actions.DifferentialInverseKinematicsAction`
+forces an eager ``from pxr import UsdPhysics`` at import time. The env cfg must be constructable
+without Kit (see ``test/core/test_env_cfg_no_forbidden_imports.py``), so the cfg only references
+this term lazily via a ``"{DIR}.pose_ik_action_term:SO101PoseIKAction"`` string ``class_type`` that
+:meth:`cfg.validate` resolves after Kit has launched.
+"""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+import torch
+
+from isaaclab.envs.mdp.actions.task_space_actions import DifferentialInverseKinematicsAction
+
+from .pose_ik_controller import SO101PoseIKController
+
+if TYPE_CHECKING:
+ from isaaclab.envs import ManagerBasedEnv
+
+ from .pose_ik_action import SO101PoseIKActionCfg
+
+
+class SO101PoseIKAction(DifferentialInverseKinematicsAction):
+ """IK action term that uses the SO-101 full-pose SE3 controller."""
+
+ cfg: SO101PoseIKActionCfg
+
+ def __init__(self, cfg: SO101PoseIKActionCfg, env: ManagerBasedEnv):
+ super().__init__(cfg, env)
+ # Swap the base differential-IK controller for the SO-101 one. The two share the same 7D
+ # ``[pos, quat_xyzw]`` action layout, so the base-allocated buffers/scale stay valid; the
+ # SO-101 controller only adds the orientation joint mask on top of the core adaptive-DLS +
+ # orientation-weighting + JLA controller. Null-space joint-limit injection now comes from
+ # the base term (gated on ``joint_limit_avoidance_gain > 0``), so it is not repeated here.
+ self._ik_controller = SO101PoseIKController(cfg=self.cfg.controller, num_envs=self.num_envs, device=self.device)
+ # Restrict the orientation task to a subset of joints if configured (e.g. the SO-101 wrist),
+ # so the other joints (shoulder_pan, ...) serve position only and the base does not swing to
+ # track orientation. Resolve the names against ``self._joint_names`` (asset-ordered, matching
+ # the Jacobian columns the controller receives) so the pushed mask is order-proof.
+ ori_names = self.cfg.controller.orientation_joint_names
+ if ori_names is not None:
+ missing = set(ori_names) - set(self._joint_names)
+ if missing:
+ raise ValueError(
+ f"orientation_joint_names {sorted(missing)} are not among this action's joints {self._joint_names}."
+ )
+ ori_mask = torch.tensor(
+ [1.0 if name in ori_names else 0.0 for name in self._joint_names], device=self.device
+ )
+ self._ik_controller.set_orientation_joint_mask(ori_mask)
+ # Action clipping is not supported for this term: the base clips by action-dim axis using
+ # joint-name keys, but this term's action layout is the task-space pose
+ # [pos_xyz, quat_xyzw], which does not map to joint names. Refuse rather than silently
+ # clip the wrong axis.
+ if self.cfg.clip is not None:
+ raise NotImplementedError(
+ "clip is not supported for SO101PoseIKAction (task-space [pos, quat] action "
+ "does not map to joint-name clip keys)."
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_controller.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_controller.py
new file mode 100644
index 000000000000..5491a5e129b3
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/pose_ik_controller.py
@@ -0,0 +1,102 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Wrist-only-orientation differential IK for the SO-101.
+
+The SO-101 is a 5-DOF arm, so a full 6-DOF pose target is over-determined by one DOF. This is
+handled with features that now live in the core :class:`~isaaclab.controllers.DifferentialIKController`:
+
+* ``ik_method="adaptive_dls"`` -- manipulability-aware damped least squares.
+* ``orientation_weight`` -- per-axis soft weighting of the orientation task rows.
+* ``joint_limit_avoidance_gain`` / ``joint_limit_avoidance_margin`` -- null-space joint-limit avoidance.
+
+The only SO-101-specific behavior left here is the **orientation joint mask**: restricting which
+joints serve the orientation rows so the base (``shoulder_pan``) stays position-only and the wrist
+serves orientation. See :attr:`SO101PoseIKControllerCfg.orientation_joint_names`.
+
+.. note::
+ The quaternion convention is **xyzw** (scalar-last), matching the IsaacLab asset convention and
+ :func:`isaaclab.utils.math.compute_pose_error`. The core controller renormalizes the commanded
+ quaternion in :meth:`~isaaclab.controllers.DifferentialIKController.set_command`.
+"""
+
+from __future__ import annotations
+
+import torch
+
+from isaaclab.controllers.differential_ik import DifferentialIKController
+from isaaclab.controllers.differential_ik_cfg import DifferentialIKControllerCfg
+from isaaclab.utils.configclass import configclass
+
+
+@configclass
+class SO101PoseIKControllerCfg(DifferentialIKControllerCfg):
+ """Core differential-IK config plus the SO-101 wrist-only orientation joint mask.
+
+ Adaptive-DLS damping (``ik_method="adaptive_dls"`` with ``ik_params`` ``lambda_min`` /
+ ``lambda_max`` / ``sigma_thresh``), per-axis :attr:`~DifferentialIKControllerCfg.orientation_weight`,
+ and null-space joint-limit avoidance (:attr:`~DifferentialIKControllerCfg.joint_limit_avoidance_gain` /
+ :attr:`~DifferentialIKControllerCfg.joint_limit_avoidance_margin`) are inherited from the core config.
+ """
+
+ orientation_joint_names: tuple[str, ...] | None = None
+ """Names of the joints permitted to serve the orientation task rows. When set, every other
+ joint's orientation-Jacobian columns are zeroed, so those joints serve **position only** while
+ orientation is solved purely by the listed joints (position still uses all joints). ``None``
+ (default) lets all joints serve orientation.
+
+ For the SO-101's down-pointing gripper this is set to the wrist joints
+ ``("wrist_flex", "wrist_roll")``: ``wrist_roll`` takes the gripper spin about the (vertical)
+ approach axis -- the DOF otherwise redundant with ``shoulder_pan`` -- and ``wrist_flex`` takes
+ the tilt, leaving ``shoulder_pan`` free to serve position (heading) so the base never swings to
+ satisfy a commanded orientation. The action term resolves these names to Jacobian columns
+ (asset-ordered, so the mask is order-proof) and pushes the column mask via
+ :meth:`SO101PoseIKController.set_orientation_joint_mask`."""
+
+
+class SO101PoseIKController(DifferentialIKController):
+ """Core differential-IK controller plus an optional wrist-only orientation joint mask.
+
+ All of the heavy lifting -- adaptive-DLS damping, per-axis orientation weighting, and
+ null-space joint-limit avoidance -- is inherited from
+ :class:`~isaaclab.controllers.DifferentialIKController`. This subclass only adds the orientation
+ joint mask: zeroing the orientation-Jacobian columns of the masked-out joints so they serve
+ position only (see :attr:`SO101PoseIKControllerCfg.orientation_joint_names`).
+ """
+
+ cfg: SO101PoseIKControllerCfg
+
+ def __init__(self, cfg: SO101PoseIKControllerCfg, num_envs: int, device: str):
+ super().__init__(cfg, num_envs, device)
+ # Column mask (1 = joint may serve the orientation rows) over the IK joints, pushed by the
+ # action term once it has resolved ``orientation_joint_names`` to Jacobian columns. ``None``
+ # leaves all joints free to serve orientation (the default).
+ self._ori_joint_mask: torch.Tensor | None = None
+
+ def set_orientation_joint_mask(self, mask: torch.Tensor) -> None:
+ """Restrict which joints serve the orientation task rows.
+
+ Args:
+ mask: Per-IK-joint multiplier [dimensionless], shape (num_joints,), in the controller's
+ joint (Jacobian-column) order: 1 for joints allowed to serve orientation, 0 for
+ joints that should serve position only. See
+ :attr:`SO101PoseIKControllerCfg.orientation_joint_names`.
+ """
+ self._ori_joint_mask = mask.to(self._device)
+
+ def _compute_pose_task(
+ self, ee_pos: torch.Tensor, ee_quat: torch.Tensor, jacobian: torch.Tensor
+ ) -> tuple[torch.Tensor, torch.Tensor]:
+ """Build the core (orientation-weighted) pose task, then mask the orientation columns.
+
+ Zeroing the orientation rows of the masked-out joints means only the allowed joints can
+ reduce the orientation error, so the base (``shoulder_pan``) serves position only and the
+ redundant spin-about-vertical DOF is routed to ``wrist_roll``. Position rows are untouched.
+ """
+ task_jacobian, task_error = super()._compute_pose_task(ee_pos, ee_quat, jacobian)
+ if self._ori_joint_mask is not None:
+ task_jacobian = task_jacobian.clone()
+ task_jacobian[:, 3:6, :] = task_jacobian[:, 3:6, :] * self._ori_joint_mask.view(1, 1, -1)
+ return task_jacobian, task_error
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_ik_abs_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_ik_abs_env_cfg.py
new file mode 100644
index 000000000000..39f9f01f370a
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_ik_abs_env_cfg.py
@@ -0,0 +1,298 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+from dataclasses import MISSING
+
+import numpy as np
+from isaaclab_teleop import IsaacTeleopCfg
+
+from isaaclab.actuators import ImplicitActuatorCfg
+from isaaclab.utils.configclass import configclass
+
+from isaaclab_tasks.contrib.stack import mdp
+
+from . import stack_joint_pos_env_cfg
+from .pose_ik_action import SO101PoseIKActionCfg
+from .pose_ik_controller import SO101PoseIKControllerCfg
+from .stack_joint_pos_env_cfg import SO101_GRIPPER_CLOSE, SO101_GRIPPER_OPEN
+
+##
+# Pre-defined configs
+##
+from isaaclab_assets.robots.so101 import SO101_HIGH_PD_CFG # isort: skip
+
+# ``isaaclab_teleop`` imports cleanly without the optional ``isaacteleop`` package (the heavy
+# import is deferred to session start), so no import guard is needed here. This lightweight
+# marker lets the env test suite categorize this as a teleop env (see
+# ``isaaclab_tasks/test/env_test_utils.py::_is_teleop_env``).
+_TELEOP_AVAILABLE = True
+
+# Analog-gripper action affine: ``joint = offset + scale * closedness`` maps the retargeter's
+# closedness ``c in [0, 1]`` to a ``gripper`` joint target [rad]. ``offset == OPEN`` (so ``c=0``
+# is fully open) and ``offset + scale == CLOSE`` (so ``c=1`` is fully closed). Tied to the
+# single source of truth in ``stack_joint_pos_env_cfg`` so the endpoints cannot drift.
+_SO101_GRIPPER_OFFSET = SO101_GRIPPER_OPEN # [rad] closedness c=0 -> open
+_SO101_GRIPPER_SCALE = SO101_GRIPPER_CLOSE - SO101_GRIPPER_OPEN # [rad] c=1 -> close
+
+# Clutch EE reset-origin home: the ``base_T_ee`` transform [m] for the gripper's pose in the
+# robot base frame at the seated reset pose. The clutch seeds its home from this on reset / first
+# engage (no live end-effector is read; the base rebase is handled upstream by
+# ``target_frame_prim_path`` and the EE state forward is the clutch's own running home). The robot
+# ``init_state`` MUST forward-kinematics to this value, or engaging snaps the arm -- this is the
+# forward kinematics of the seated ``_SO101_STACK_INIT_JOINT_POS`` measured in sim, so re-measure
+# (read ``ee_frame.data.target_pos_source`` at reset) if those init joints change. Only the
+# translation drives the IK position command; the orientation command is the live controller grip
+# orientation composed with the clutch's fixed calibration offset, not this transform's rotation.
+_BASE_T_GRIPPER_HOME = np.eye(4, dtype=np.float32)
+_BASE_T_GRIPPER_HOME[:3, 3] = (0.01918, -0.18852, 0.18887)
+
+# Fixed controller-grip -> gripper_link orientation calibration offset [x, y, z, w] (xyzw),
+# passed to the clutch as a body-frame right multiply. ``None`` uses the clutch default (Rz(pi)).
+# Derivation: with ``q_grip`` the controller grip orientation and ``q_G0`` the gripper_link
+# orientation in the base frame (both xyzw) at the reset pose, the offset is
+# ``quat_inv(q_grip) (x) q_G0`` (xyzw); tuning it here needs no Teleop rebuild.
+# Set to RPY (roll, pitch, yaw) = (-90, 0, 60) degrees (intrinsic XYZ), i.e.
+# ``Rotation.from_euler("XYZ", [-90, 0, 60], degrees=True).as_quat()``.
+_SO101_ORIENTATION_OFFSET_XYZW: tuple[float, float, float, float] | None = (
+ -0.61237244,
+ 0.35355339,
+ 0.35355339,
+ 0.61237244,
+)
+
+
+def _build_so101_stack_pipeline():
+ """Build an IsaacTeleop retargeting pipeline for SO-101 cube stacking.
+
+ Creates a SO101ClutchRetargeter for right-hand clutch-rebased full-pose tracking and a
+ SO101GripperRetargeter for right-hand analog gripper control, flattened into a single action
+ tensor via TensorReorderer.
+
+ The SO-101 is 5-DOF and driven by a full-SE3-pose IK over all 5 arm joints (shoulder_pan,
+ shoulder_lift, elbow_flex, wrist_flex, wrist_roll): the clutch emits the controller pose
+ (position + grip orientation composed with a fixed calibration offset) and the IK tracks
+ position exactly while best-effort tracking orientation (soft-weighted). The gripper jaw
+ tracks the trigger proportionally (analog), and the EE position is clutch-rebased around a
+ captured origin so engaging teleop does not teleport the arm.
+
+ Returns:
+ OutputCombiner with a single "action" output containing the flattened
+ 8D action tensor: [pos_x, pos_y, pos_z, quat_x, quat_y, quat_z, quat_w, gripper].
+ """
+ from isaacteleop.retargeters import (
+ SO101ClutchRetargeter,
+ SO101GripperRetargeter,
+ TensorReorderer,
+ )
+ from isaacteleop.retargeters.SO101.gripper_retargeter import GRIPPER_COMMAND_KEY, GRIPPER_ELEMENT_LABEL
+ from isaacteleop.retargeting_engine.deviceio_source_nodes import ControllersSource
+ from isaacteleop.retargeting_engine.interface import OutputCombiner, ValueInput
+ from isaacteleop.retargeting_engine.tensor_types import TransformMatrix
+
+ # Create input sources (trackers are auto-discovered from pipeline)
+ controllers = ControllersSource(name="controllers")
+
+ # External input: the anchor transform 4x4 provided by IsaacTeleopDevice. With
+ # ``target_frame_prim_path`` set to the robot base (see the cfg below) the device feeds
+ # ``base_T_world @ world_T_anchor``, so the transformed controller stream below arrives
+ # already in the robot base frame -- the IK command's root frame.
+ transform_input = ValueInput("world_T_anchor", TransformMatrix())
+
+ # Rebase controller poses into the robot base frame so the downstream clutch retargeter
+ # receives base-frame data matching the absolute-pose IK command frame.
+ transformed_controllers = controllers.transformed(transform_input.output(ValueInput.VALUE))
+
+ # Clutch (relative-origin) EE-pose retargeter (right hand). Emits the same absolute 7D
+ # "ee_pose" contract as Se3AbsRetargeter (node name + output key "ee_pose"), but rebases
+ # controller motion around an origin captured on engage. It seeds the home from the static
+ # ``home_base_T_ee`` reset-origin on reset / first engage and keeps its own running home
+ # thereafter (so a mid-task re-clutch resumes from the last commanded pose). The robot
+ # ``init_state`` must reset the arm to ``_BASE_T_GRIPPER_HOME`` so the first engage does not
+ # jump. The full pose (position + orientation) drives the 5-joint SE3 IK below.
+ clutch = SO101ClutchRetargeter(
+ name="ee_pose",
+ input_device=ControllersSource.RIGHT,
+ home_base_T_ee=_BASE_T_GRIPPER_HOME,
+ orientation_offset=(
+ np.array(_SO101_ORIENTATION_OFFSET_XYZW, dtype=np.float64)
+ if _SO101_ORIENTATION_OFFSET_XYZW is not None
+ else None
+ ),
+ )
+ connected_clutch = clutch.connect(
+ {
+ ControllersSource.RIGHT: transformed_controllers.output(ControllersSource.RIGHT),
+ }
+ )
+
+ # Analog Gripper Retargeter (right hand). Emits a proportional jaw closedness in [0, 1]
+ # from the controller trigger; the node name "gripper" matches its gripper_command/
+ # gripper_value channel and the gripper_action term.
+ gripper = SO101GripperRetargeter(name="gripper", input_device=ControllersSource.RIGHT)
+ connected_gripper = gripper.connect(
+ {
+ ControllersSource.RIGHT: transformed_controllers.output(ControllersSource.RIGHT),
+ }
+ )
+
+ # TensorReorderer to flatten into a single action vector
+ # SO101ClutchRetargeter outputs a 7D NDArray (pos xyz + quat xyzw)
+ # SO101GripperRetargeter outputs a single float (gripper closedness)
+ ee_pose_elements = ["pos_x", "pos_y", "pos_z", "quat_x", "quat_y", "quat_z", "quat_w"]
+ gripper_elements = [GRIPPER_ELEMENT_LABEL]
+
+ reorderer = TensorReorderer(
+ input_config={
+ "ee_pose": ee_pose_elements,
+ GRIPPER_COMMAND_KEY: gripper_elements,
+ },
+ # Full-pose SE3 IK: pass the whole 7D pose (xyz + quat xyzw) through, then the gripper.
+ # Output order: [pos_xyz, quat_xyzw, gripper] — the positional contract with the
+ # SO101PoseIKAction (7D arm: pos + quat) + gripper.
+ output_order=ee_pose_elements + gripper_elements,
+ name="action_reorderer",
+ input_types={
+ "ee_pose": "array",
+ GRIPPER_COMMAND_KEY: "scalar",
+ },
+ )
+ connected_reorderer = reorderer.connect(
+ {
+ "ee_pose": connected_clutch.output("ee_pose"),
+ GRIPPER_COMMAND_KEY: connected_gripper.output(GRIPPER_COMMAND_KEY),
+ }
+ )
+
+ return OutputCombiner({"action": connected_reorderer.output("output")})
+
+
+@configclass
+class SO101IkActionsCfg:
+ """Action terms for SO-101 IK-Abs teleop, ordered to match the pipeline ``output_order``.
+
+ This is a fresh (non-inheriting) action container declared in field order
+ ``[arm_action, gripper_action]`` so the flattened action concatenates as
+ ``[pos_x, pos_y, pos_z, quat_x, quat_y, quat_z, quat_w, gripper]`` — the positional contract
+ with the teleop pipeline's ``output_order`` in :func:`_build_so101_stack_pipeline`. The arm
+ action covers 7 dimensions (pos xyz + quat xyzw); gripper covers 1. Inheriting from the base
+ ``ActionsCfg`` would append new fields after the base's and mis-order the concat.
+ """
+
+ arm_action: SO101PoseIKActionCfg = MISSING
+ gripper_action: mdp.JointPositionActionCfg = MISSING
+
+
+@configclass
+class SO101CubeStackEnvCfg(stack_joint_pos_env_cfg.SO101CubeStackEnvCfg):
+ """SO-101 cube-stack environment with absolute task-space (IK) control.
+
+ The SO-101 has only 5 actuated arm DOF, so a full 6-DOF pose target is over-determined by
+ one DOF. We command an absolute end-effector **SE3 pose** via a full-pose differential IK
+ over all 5 arm joints (``shoulder_pan``, ``shoulder_lift``, ``elbow_flex``, ``wrist_flex``,
+ ``wrist_roll``): the 3 linear task rows track position exactly (weight 1) and the
+ orientation rows are soft-weighted (``orientation_weight``) so orientation is
+ best-effort and never leaks error into position. Orientation is further restricted to the wrist
+ (``orientation_joint_names=("wrist_flex", "wrist_roll")``): ``wrist_roll`` takes the gripper
+ spin about the (vertical) approach axis and ``wrist_flex`` the tilt, while ``shoulder_pan``
+ serves position only -- so the base never swings to satisfy a commanded orientation. The
+ resulting action is
+ ``[pos_x, pos_y, pos_z, quat_x, quat_y, quat_z, quat_w, gripper]`` (orientation xyzw). The IK
+ is kept well-conditioned near singularities via the soft orientation weight,
+ manipulability-aware damped least squares (adaptive lambda keyed off the full weighted task
+ Jacobian, so it is coupled to the orientation weight), and null-space joint-limit avoidance.
+ """
+
+ def __post_init__(self):
+ # post init of parent
+ super().__post_init__()
+
+ # Switch to a stiffer PD controller so the arm tracks IK targets well. SO101_HIGH_PD_CFG
+ # carries only the so101.py asset default init_state (zeros, no root pos), so ``replace``
+ # would DISCARD the parent's seated + stack-posed init_state. Preserve it explicitly so
+ # the IK-Abs task is also seated on the table and starts in the stack joint pose.
+ #
+ # Also soften the gripper to mimic the Franka panda_hand's grasp feel. The SO-101 jaw asset
+ # default (effort 10 N·m, velocity 10 rad/s) snaps shut fast and hard, pushing through the
+ # cube and ejecting it. The Franka panda_hand (effort 200 N, stiffness 2e3) is a *prismatic*
+ # finger pair, so its gains do not transfer to this *revolute* jaw [N·m, rad]; instead we
+ # behavior-match by capping the closing speed and grip torque so it closes gently and holds
+ # without penetrating. ``effort_limit_sim`` is the "strength" knob and ``velocity_limit_sim``
+ # the "speed" knob; stiffness/damping keep the asset defaults. Tune in-sim (lower effort if
+ # it still pushes through; raise it if the cube drops).
+ self.scene.robot = SO101_HIGH_PD_CFG.replace(
+ prim_path="{ENV_REGEX_NS}/Robot",
+ init_state=self.scene.robot.init_state,
+ actuators={
+ "arm": SO101_HIGH_PD_CFG.actuators["arm"],
+ "gripper": ImplicitActuatorCfg(
+ joint_names_expr=["gripper"],
+ effort_limit_sim=1.0, # was 10.0 -- cap grip torque so it can't push through
+ velocity_limit_sim=2.0, # was 10.0 -- close gently instead of snapping shut
+ stiffness=17.8,
+ damping=0.60,
+ ),
+ },
+ )
+
+ # Replace the actions container. The 2-field order here is the positional contract
+ # with the pipeline ``output_order`` ([arm pos+quat, gripper]); a true action_dim check
+ # needs the loaded articulation, so the sim-free test is the real guard.
+ self.actions = SO101IkActionsCfg(
+ # Full-pose SE3 IK over all 5 arm joints (including wrist_roll). Solves a 6-row
+ # pose task [pos_xyz, ori_xyz]; the 3 orientation rows are soft-weighted.
+ arm_action=SO101PoseIKActionCfg(
+ asset_name="robot",
+ joint_names=["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll"],
+ body_name="gripper",
+ scale=1.0,
+ controller=SO101PoseIKControllerCfg(
+ command_type="pose",
+ use_relative_mode=False,
+ # Manipulability-aware damped least squares keeps the 5-DOF arm well-conditioned
+ # near singularities (adaptive lambda keyed off the smallest task-Jacobian
+ # singular value).
+ ik_method="adaptive_dls",
+ ik_params={"lambda_min": 0.05, "lambda_max": 0.2, "sigma_thresh": 0.02},
+ # Track all 3 orientation axes (including spin about the vertical approach
+ # axis), but restrict orientation to the wrist via ``orientation_joint_names``
+ # below so the base never serves it: ``wrist_roll`` takes the spin (controller
+ # twist about vertical / stage Z) and ``wrist_flex`` the tilt, while
+ # ``shoulder_pan`` stays position-only (heading to the target).
+ orientation_weight=0.5,
+ # Orientation is a wrist-only task (see above). Position still uses all 5 joints.
+ orientation_joint_names=("wrist_flex", "wrist_roll"),
+ # Null-space joint-limit avoidance (0 disables it).
+ joint_limit_avoidance_gain=0.5,
+ joint_limit_avoidance_margin=0.3,
+ ),
+ ),
+ # Analog gripper: continuous JointPositionActionCfg mapping the retargeter's
+ # closedness c in [0, 1] to a ``gripper`` joint target [rad] via the affine
+ # ``joint = offset + scale * c`` (offset == OPEN, offset + scale == CLOSE). This
+ # replaces the joint-pos task's BinaryJointPositionActionCfg with proportional
+ # control. ``use_default_offset=False`` so the offset is the absolute open angle.
+ gripper_action=mdp.JointPositionActionCfg(
+ asset_name="robot",
+ joint_names=["gripper"],
+ scale=_SO101_GRIPPER_SCALE,
+ offset=_SO101_GRIPPER_OFFSET,
+ use_default_offset=False,
+ ),
+ )
+
+ # IsaacTeleop-based teleoperation pipeline
+ self.isaac_teleop = IsaacTeleopCfg(
+ pipeline_builder=_build_so101_stack_pipeline,
+ sim_device=self.sim.device,
+ xr_cfg=self.xr,
+ # Rebase all teleop output poses into the robot base frame: the device reads this
+ # prim's world transform each frame and left-multiplies its inverse onto the XR
+ # anchor (``base_T_world @ world_T_anchor``), so the clutch retargeter works
+ # in the base frame -- the IK command's root frame (the FrameTransformer source
+ # also uses ``Robot/base``). The clutch's reset-origin home (_BASE_T_GRIPPER_HOME)
+ # provides the engage seed, so no live end-effector feed is needed. Teleop runs a
+ # single env (env_0).
+ target_frame_prim_path="/World/envs/env_0/Robot/base",
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py
new file mode 100644
index 000000000000..0190ef1c0ae1
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/config/so101/stack_joint_pos_env_cfg.py
@@ -0,0 +1,129 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+from isaaclab.assets import ArticulationCfg, RigidObjectCfg
+from isaaclab.utils.configclass import configclass
+
+from isaaclab_tasks.contrib.stack import mdp
+from isaaclab_tasks.contrib.stack.stack_env_cfg import (
+ StackEnvCfg,
+ StackEventCfg,
+ apply_default_semantics,
+ make_ee_frame_cfg,
+)
+
+##
+# Pre-defined configs
+##
+from isaaclab_assets.robots.so101 import SO101_CFG # isort: skip
+
+# Default arm + gripper joint pose [rad].
+# NOTE: kept mid-range (elbow/wrist bent) to avoid the boundary singularity of a fully
+# extended 5-DOF arm. Tune in-sim so the gripper starts above the cube workspace pointing
+# down for top-down grasps.
+_SO101_STACK_INIT_JOINT_POS: dict[str, float] = {
+ "shoulder_pan": 0.0,
+ "shoulder_lift": -0.6,
+ "elbow_flex": 0.8,
+ "wrist_flex": 0.6,
+ "wrist_roll": 0.0,
+ "gripper": 0.0,
+}
+
+# Gripper jaw extremes [rad]. The SO-101 jaw is a single revolute joint; USD limits are
+# roughly [-10 deg, 100 deg]. ``open`` ~= jaw fully open, ``close`` ~= jaw shut.
+# Confirm sign/magnitude against the spawned articulation.
+SO101_GRIPPER_OPEN = 1.745
+SO101_GRIPPER_CLOSE = 0.0
+
+# Base seat pose authoring the SO-101 root transform explicitly (it replaces the asset's baked-in
+# default xform, not stacks on it). Load-bearing constraints:
+# - ``_SO101_MOUNT_Z = -0.03008`` [m]: downward base correction that plants the column foot on the
+# tabletop (table-top surface is at world z~=0). Adjust only the root z; do NOT x-shift the base
+# (the cubes live at world x in [0.18, 0.30] and an x-shift would break reachability).
+# - ``_SO101_BASE_SEAT_ROT`` [quat (x, y, z, w)]: 90 deg about +Z, matching the table's
+# ``rot=[0, 0, 0.707, 0.707]`` so the arm faces the cube workspace.
+_SO101_MOUNT_Z = -0.03008
+_SO101_BASE_SEAT_POS = (0.0, 0.0, _SO101_MOUNT_Z)
+_SO101_BASE_SEAT_ROT = (0.0, 0.0, 0.70710678, 0.70710678)
+
+
+@configclass
+class SO101CubeStackEnvCfg(StackEnvCfg):
+ """Configuration for the SO-101 Cube Stack Environment (joint-position control).
+
+ Reuses the robot-neutral stack scaffolding (cubes, semantics, ee-frame builder, reset events)
+ from :mod:`~isaaclab_tasks.contrib.stack.stack_env_cfg` and overrides only the SO-101-specific
+ bits: the seated robot, its actions/gripper, the cube transforms (shrunk to the arm's reach),
+ and the end-effector frame prim paths.
+ """
+
+ def __post_init__(self):
+ # post init of parent
+ super().__post_init__()
+
+ # Robot-neutral reset events, with the cube workspace shrunk to the SO-101's ~0.3 m reach
+ # (Franka uses x in [0.4, 0.6]). The joint-randomization term holds the ``gripper`` joint
+ # via ``gripper_joint_names`` below (so ``wrist_roll`` is still randomized).
+ self.events = StackEventCfg()
+ self.events.randomize_cube_positions.params["pose_range"] = {
+ "x": (0.15, 0.30),
+ "y": (-0.10, 0.10),
+ "z": (0.0203, 0.0203),
+ "yaw": (-1.0, 1.0),
+ }
+ self.events.randomize_cube_positions.params["min_separation"] = 0.06
+
+ # Set SO-101 as robot. Seat the base on the table-top and face it toward the cube
+ # workspace (see ``_SO101_MOUNT_Z`` / ``_SO101_BASE_SEAT_ROT``).
+ self.scene.robot = SO101_CFG.replace(
+ prim_path="{ENV_REGEX_NS}/Robot",
+ init_state=ArticulationCfg.InitialStateCfg(
+ pos=_SO101_BASE_SEAT_POS,
+ rot=_SO101_BASE_SEAT_ROT,
+ joint_pos=_SO101_STACK_INIT_JOINT_POS,
+ ),
+ )
+
+ # Tag the table / ground / robot semantic classes.
+ apply_default_semantics(self.scene)
+
+ # Set actions for the specific robot type (so101)
+ self.actions.arm_action = mdp.JointPositionActionCfg(
+ asset_name="robot",
+ joint_names=["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll"],
+ scale=0.5,
+ use_default_offset=True,
+ )
+ self.actions.gripper_action = mdp.BinaryJointPositionActionCfg(
+ asset_name="robot",
+ joint_names=["gripper"],
+ open_command_expr={"gripper": SO101_GRIPPER_OPEN},
+ close_command_expr={"gripper": SO101_GRIPPER_CLOSE},
+ )
+ # utilities for gripper status check
+ self.gripper_joint_names = ["gripper"]
+ self.gripper_open_val = SO101_GRIPPER_OPEN
+ self.gripper_threshold = 0.2
+
+ # Place the shared cubes within the SO-101 workspace (override transforms only; the cube
+ # spawn/properties/semantics come from the base scene).
+ self.scene.cube_1.init_state = RigidObjectCfg.InitialStateCfg(pos=[0.18, 0.0, 0.0203], rot=[0, 0, 0, 1])
+ self.scene.cube_2.init_state = RigidObjectCfg.InitialStateCfg(pos=[0.24, 0.06, 0.0203], rot=[0, 0, 0, 1])
+ self.scene.cube_3.init_state = RigidObjectCfg.InitialStateCfg(pos=[0.27, -0.07, 0.0203], rot=[0, 0, 0, 1])
+
+ # End-effector frame. SO-101 link chain (verified against the so101_new_calib USD):
+ # base -> shoulder -> upper_arm -> lower_arm -> wrist -> gripper -> moving_jaw_so101_v1.
+ # ``gripper`` is the static wrist/gripper body (the IK target); ``moving_jaw_so101_v1`` is
+ # the actuated jaw. The ``end_effector`` offset should be set to the actual grasp point
+ # (between the jaws); it is left at the gripper-link origin for now.
+ self.scene.ee_frame = make_ee_frame_cfg(
+ base_prim_path="{ENV_REGEX_NS}/Robot/base",
+ target_specs=[
+ ("{ENV_REGEX_NS}/Robot/gripper", "end_effector", (0.0, 0.0, 0.0)),
+ ("{ENV_REGEX_NS}/Robot/moving_jaw_so101_v1", "tool_jaw", (0.0, 0.0, 0.0)),
+ ],
+ marker_scale=(0.05, 0.05, 0.05),
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/franka_stack_events.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/franka_stack_events.py
index 4d148d6ba216..48b0c86128b7 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/franka_stack_events.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/franka_stack_events.py
@@ -3,336 +3,32 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-
-from __future__ import annotations
-
-import math
-import random
-from typing import TYPE_CHECKING
-
-import torch
-import warp as wp
-
-import isaaclab.utils.math as math_utils
-from isaaclab.managers import SceneEntityCfg
-
-if TYPE_CHECKING:
- from isaaclab.assets import Articulation, AssetBase
- from isaaclab.envs import ManagerBasedEnv
-
-
-def set_default_joint_pose(
- env: ManagerBasedEnv,
- env_ids: torch.Tensor,
- default_pose: torch.Tensor,
- asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"),
-):
- # Set the default pose for robots in all envs
- asset = env.scene[asset_cfg.name]
- # Convert default_pose to 1D array and create joint indices
- default_pose_1d = torch.tensor(default_pose, device=env.device).repeat(env.num_envs, 1).flatten()
- num_joints = len(default_pose)
- joint_ids = torch.arange(num_joints, device=env.device, dtype=torch.int32)
- # Use update_default_joint_values kernel to update all joints for all environments
- from isaaclab_physx.assets.articulation.kernels import update_default_joint_values
-
- wp.launch(
- update_default_joint_values,
- dim=(env.num_envs, num_joints),
- inputs=[
- default_pose_1d,
- joint_ids,
- ],
- outputs=[asset.data.default_joint_pos],
- device=env.device,
- )
-
-
-def randomize_joint_by_gaussian_offset(
- env: ManagerBasedEnv,
- env_ids: torch.Tensor,
- mean: float,
- std: float,
- asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"),
-):
- asset: Articulation = env.scene[asset_cfg.name]
-
- # Add gaussian noise to joint states
- joint_pos = asset.data.default_joint_pos.torch[env_ids].clone()
- joint_vel = asset.data.default_joint_vel.torch[env_ids].clone()
- joint_pos += math_utils.sample_gaussian(mean, std, joint_pos.shape, joint_pos.device)
-
- # Clamp joint pos to limits
- joint_pos_limits = asset.data.soft_joint_pos_limits.torch[env_ids]
- joint_pos = joint_pos.clamp_(joint_pos_limits[..., 0], joint_pos_limits[..., 1])
-
- # Don't noise the gripper poses
- joint_pos[:, -2:] = asset.data.default_joint_pos.torch[env_ids, -2:]
-
- # Set into the physics simulation
- asset.set_joint_position_target_index(target=joint_pos, env_ids=env_ids)
- asset.set_joint_velocity_target_index(target=joint_vel, env_ids=env_ids)
- asset.write_joint_position_to_sim_index(position=joint_pos, env_ids=env_ids)
- asset.write_joint_velocity_to_sim_index(velocity=joint_vel, env_ids=env_ids)
-
-
-def sample_random_color(base=(0.75, 0.75, 0.75), variation=0.1):
- """
- Generates a randomized color that stays close to the base color while preserving overall brightness.
- The relative balance between the R, G, and B components is maintained by ensuring that
- the sum of random offsets is zero.
-
- Parameters:
- base (tuple): The base RGB color with each component between 0 and 1.
- variation (float): Maximum deviation to sample for each channel before balancing.
-
- Returns:
- tuple: A new RGB color with balanced random variation.
- """
- # Generate random offsets for each channel in the range [-variation, variation]
- offsets = [random.uniform(-variation, variation) for _ in range(3)]
- # Compute the average offset
- avg_offset = sum(offsets) / 3
- # Adjust offsets so their sum is zero (maintaining brightness)
- balanced_offsets = [offset - avg_offset for offset in offsets]
-
- # Apply the balanced offsets to the base color and clamp each channel between 0 and 1
- new_color = tuple(max(0, min(1, base_component + offset)) for base_component, offset in zip(base, balanced_offsets))
-
- return new_color
-
-
-def randomize_scene_lighting_domelight(
- env: ManagerBasedEnv,
- env_ids: torch.Tensor,
- intensity_range: tuple[float, float],
- color_variation: float,
- textures: list[str],
- default_intensity: float = 3000.0,
- default_color: tuple[float, float, float] = (0.75, 0.75, 0.75),
- default_texture: str = "",
- asset_cfg: SceneEntityCfg = SceneEntityCfg("light"),
-):
- asset: AssetBase = env.scene[asset_cfg.name]
- light_prim = asset.prims[0]
-
- intensity_attr = light_prim.GetAttribute("inputs:intensity")
- intensity_attr.Set(default_intensity)
-
- color_attr = light_prim.GetAttribute("inputs:color")
- color_attr.Set(default_color)
-
- texture_file_attr = light_prim.GetAttribute("inputs:texture:file")
- texture_file_attr.Set(default_texture)
-
- if not hasattr(env.cfg, "eval_mode") or not env.cfg.eval_mode:
- return
-
- if env.cfg.eval_type in ["light_intensity", "all"]:
- # Sample new light intensity
- new_intensity = random.uniform(intensity_range[0], intensity_range[1])
- # Set light intensity to light prim
- intensity_attr.Set(new_intensity)
-
- if env.cfg.eval_type in ["light_color", "all"]:
- # Sample new light color
- new_color = sample_random_color(base=default_color, variation=color_variation)
- # Set light color to light prim
- color_attr.Set(new_color)
-
- if env.cfg.eval_type in ["light_texture", "all"]:
- # Sample new light texture (background)
- new_texture = random.sample(textures, 1)[0]
- # Set light texture to light prim
- texture_file_attr.Set(new_texture)
-
-
-def sample_object_poses(
- num_objects: int,
- min_separation: float = 0.0,
- pose_range: dict[str, tuple[float, float]] = {},
- max_sample_tries: int = 5000,
-):
- range_list = [pose_range.get(key, (0.0, 0.0)) for key in ["x", "y", "z", "roll", "pitch", "yaw"]]
- pose_list = []
-
- for i in range(num_objects):
- for j in range(max_sample_tries):
- sample = [random.uniform(range[0], range[1]) for range in range_list]
-
- # Accept pose if it is the first one, or if reached max num tries
- if len(pose_list) == 0 or j == max_sample_tries - 1:
- pose_list.append(sample)
- break
-
- # Check if pose of object is sufficiently far away from all other objects
- separation_check = [math.dist(sample[:3], pose[:3]) > min_separation for pose in pose_list]
- if False not in separation_check:
- pose_list.append(sample)
- break
-
- return pose_list
-
-
-def randomize_object_pose(
- env: ManagerBasedEnv,
- env_ids: torch.Tensor,
- asset_cfgs: list[SceneEntityCfg],
- min_separation: float = 0.0,
- pose_range: dict[str, tuple[float, float]] = {},
- max_sample_tries: int = 5000,
-):
- if env_ids is None:
- return
-
- # Randomize poses in each environment independently
- for cur_env in env_ids.tolist():
- pose_list = sample_object_poses(
- num_objects=len(asset_cfgs),
- min_separation=min_separation,
- pose_range=pose_range,
- max_sample_tries=max_sample_tries,
- )
-
- # Randomize pose for each object
- for i in range(len(asset_cfgs)):
- asset_cfg = asset_cfgs[i]
- asset = env.scene[asset_cfg.name]
-
- # Write pose to simulation
- pose_tensor = torch.tensor([pose_list[i]], device=env.device)
- positions = pose_tensor[:, 0:3] + env.scene.env_origins[cur_env, 0:3]
- orientations = math_utils.quat_from_euler_xyz(pose_tensor[:, 3], pose_tensor[:, 4], pose_tensor[:, 5])
- asset.write_root_pose_to_sim_index(
- root_pose=torch.cat([positions, orientations], dim=-1),
- env_ids=torch.tensor([cur_env], device=env.device),
- )
- asset.write_root_velocity_to_sim_index(
- root_velocity=torch.zeros(1, 6, device=env.device), env_ids=torch.tensor([cur_env], device=env.device)
- )
-
-
-def randomize_rigid_objects_in_focus(
- env: ManagerBasedEnv,
- env_ids: torch.Tensor,
- asset_cfgs: list[SceneEntityCfg],
- out_focus_state: torch.Tensor,
- min_separation: float = 0.0,
- pose_range: dict[str, tuple[float, float]] = {},
- max_sample_tries: int = 5000,
-):
- if env_ids is None:
- return
-
- # List of rigid objects in focus for each env (dim = [num_envs, num_rigid_objects])
- env.rigid_objects_in_focus = []
-
- for cur_env in env_ids.tolist():
- # Sample in focus object poses
- pose_list = sample_object_poses(
- num_objects=len(asset_cfgs),
- min_separation=min_separation,
- pose_range=pose_range,
- max_sample_tries=max_sample_tries,
- )
-
- selected_ids = []
- for asset_idx in range(len(asset_cfgs)):
- asset_cfg = asset_cfgs[asset_idx]
- asset = env.scene[asset_cfg.name]
-
- # Randomly select an object to bring into focus
- object_id = random.randint(0, asset.num_bodies - 1)
- selected_ids.append(object_id)
-
- # Create object state tensor with shape (num_envs, num_objects, state_dim)
- # Since we're updating one environment, we need shape (1, num_objects, state_dim)
- object_states = torch.stack([out_focus_state] * asset.num_bodies).to(device=env.device).unsqueeze(0)
- pose_tensor = torch.tensor([pose_list[asset_idx]], device=env.device)
- positions = pose_tensor[:, 0:3] + env.scene.env_origins[cur_env, 0:3]
- orientations = math_utils.quat_from_euler_xyz(pose_tensor[:, 3], pose_tensor[:, 4], pose_tensor[:, 5])
- object_states[0, object_id, 0:3] = positions.squeeze(0)
- object_states[0, object_id, 3:7] = orientations.squeeze(0)
-
- asset.write_body_pose_to_sim_index(
- body_poses=object_states[:, :, :7], env_ids=torch.tensor([cur_env], device=env.device)
- )
- asset.write_body_link_velocity_to_sim_index(
- body_velocities=object_states[:, :, 7:], env_ids=torch.tensor([cur_env], device=env.device)
- )
-
- env.rigid_objects_in_focus.append(selected_ids)
-
-
-def randomize_visual_texture_material(
- env: ManagerBasedEnv,
- env_ids: torch.Tensor,
- asset_cfg: SceneEntityCfg,
- textures: list[str],
- default_texture: str = "",
- texture_rotation: tuple[float, float] = (0.0, 0.0),
-):
- """Randomize the visual texture of bodies on an asset using Replicator API.
-
- This function randomizes the visual texture of the bodies of the asset using the Replicator API.
- The function samples random textures from the given texture paths and applies them to the bodies
- of the asset. The textures are projected onto the bodies and rotated by the given angles.
-
- .. note::
- The function assumes that the asset follows the prim naming convention as:
- "{asset_prim_path}/{body_name}/visuals" where the body name is the name of the body to
- which the texture is applied. This is the default prim ordering when importing assets
- from the asset converters in Isaac Lab.
-
- .. note::
- When randomizing the texture of individual assets, please make sure to set
- :attr:`isaaclab.scene.InteractiveSceneCfg.replicate_physics` to False. This ensures that physics
- parser will parse the individual asset properties separately.
- """
- if hasattr(env.cfg, "eval_mode") and (
- not env.cfg.eval_mode or env.cfg.eval_type not in [f"{asset_cfg.name}_texture", "all"]
- ):
- return
- # textures = [default_texture]
-
- # enable replicator extension if not already enabled
- from isaacsim.core.experimental.utils.app import enable_extension
-
- enable_extension("omni.replicator.core")
- # we import the module here since we may not always need the replicator
- import omni.replicator.core as rep
-
- # check to make sure replicate_physics is set to False, else raise error
- # note: We add an explicit check here since texture randomization can happen outside of 'prestartup' mode
- # and the event manager doesn't check in that case.
- if env.cfg.scene.replicate_physics:
- raise RuntimeError(
- "Unable to randomize visual texture material with scene replication enabled."
- " For stable USD-level randomization, please disable scene replication"
- " by setting 'replicate_physics' to False in 'InteractiveSceneCfg'."
- )
-
- # convert from radians to degrees
- texture_rotation = tuple(math.degrees(angle) for angle in texture_rotation)
-
- # obtain the asset entity
- asset = env.scene[asset_cfg.name]
-
- # join all bodies in the asset
- body_names = asset_cfg.body_names
- if isinstance(body_names, str):
- body_names_regex = body_names
- elif isinstance(body_names, list):
- body_names_regex = "|".join(body_names)
- else:
- body_names_regex = ".*"
-
- if not hasattr(asset, "cfg"):
- prims_group = rep.get.prims(path_pattern=f"{asset.prim_paths[0]}/visuals")
- else:
- prims_group = rep.get.prims(path_pattern=f"{asset.cfg.prim_path}/{body_names_regex}/visuals")
-
- with prims_group:
- rep.randomizer.texture(
- textures=textures, project_uvw=True, texture_rotate=rep.distribution.uniform(*texture_rotation)
- )
+"""Backward-compatible re-exports of the (now robot-neutral) stack event functions.
+
+These functions used to live here but are robot-agnostic and shared by every stack robot config,
+so they were moved to :mod:`.stack_events`. This module re-exports them so existing imports
+(``from isaaclab_tasks.contrib.stack.mdp import franka_stack_events``) keep working. New configs
+should import from :mod:`.stack_events` directly.
+"""
+
+from .stack_events import (
+ randomize_joint_by_gaussian_offset,
+ randomize_object_pose,
+ randomize_rigid_objects_in_focus,
+ randomize_scene_lighting_domelight,
+ randomize_visual_texture_material,
+ sample_object_poses,
+ sample_random_color,
+ set_default_joint_pose,
+)
+
+__all__ = [
+ "randomize_joint_by_gaussian_offset",
+ "randomize_object_pose",
+ "randomize_rigid_objects_in_focus",
+ "randomize_scene_lighting_domelight",
+ "randomize_visual_texture_material",
+ "sample_object_poses",
+ "sample_random_color",
+ "set_default_joint_pose",
+]
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/observations.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/observations.py
index 1269ef260ff5..94adf1b6453f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/observations.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/observations.py
@@ -292,7 +292,12 @@ def gripper_pos(
else:
if hasattr(env.cfg, "gripper_joint_names"):
gripper_joint_ids, _ = robot.find_joints(env.cfg.gripper_joint_names)
- assert len(gripper_joint_ids) == 2, "Observation gripper_pos only support parallel gripper for now"
+ if len(gripper_joint_ids) == 1:
+ # single-jaw gripper (e.g. SO-101)
+ return robot.data.joint_pos.torch[:, gripper_joint_ids[0]].clone().unsqueeze(1)
+ assert len(gripper_joint_ids) == 2, (
+ "Observation gripper_pos only supports single- or parallel-jaw (2-joint) grippers for now"
+ )
finger_joint_1 = robot.data.joint_pos.torch[:, gripper_joint_ids[0]].clone().unsqueeze(1)
finger_joint_2 = -1 * robot.data.joint_pos.torch[:, gripper_joint_ids[1]].clone().unsqueeze(1)
return torch.cat((finger_joint_1, finger_joint_2), dim=1)
@@ -326,24 +331,17 @@ def object_grasped(
else:
if hasattr(env.cfg, "gripper_joint_names"):
gripper_joint_ids, _ = robot.find_joints(env.cfg.gripper_joint_names)
- assert len(gripper_joint_ids) == 2, "Observations only support parallel gripper for now"
-
- grasped = torch.logical_and(
- pose_diff < diff_threshold,
- torch.abs(
- robot.data.joint_pos.torch[:, gripper_joint_ids[0]]
- - torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device)
- )
- > env.cfg.gripper_threshold,
- )
- grasped = torch.logical_and(
- grasped,
- torch.abs(
- robot.data.joint_pos.torch[:, gripper_joint_ids[1]]
- - torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device)
+ assert len(gripper_joint_ids) >= 1, "Observations require at least one gripper joint"
+
+ # Grasped: the end-effector is close to the object and every gripper joint has moved
+ # away from the open position (i.e. the jaws have closed on the object).
+ open_val = torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device)
+ grasped = pose_diff < diff_threshold
+ for joint_id in gripper_joint_ids:
+ grasped = torch.logical_and(
+ grasped,
+ torch.abs(robot.data.joint_pos.torch[:, joint_id] - open_val) > env.cfg.gripper_threshold,
)
- > env.cfg.gripper_threshold,
- )
return grasped
@@ -378,25 +376,19 @@ def object_stacked(
else:
if hasattr(env.cfg, "gripper_joint_names"):
gripper_joint_ids, _ = robot.find_joints(env.cfg.gripper_joint_names)
- assert len(gripper_joint_ids) == 2, "Observations only support parallel gripper for now"
- stacked = torch.logical_and(
- torch.isclose(
- robot.data.joint_pos.torch[:, gripper_joint_ids[0]],
- torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device),
- atol=1e-4,
- rtol=1e-4,
- ),
- stacked,
- )
- stacked = torch.logical_and(
- torch.isclose(
- robot.data.joint_pos.torch[:, gripper_joint_ids[1]],
- torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device),
- atol=1e-4,
- rtol=1e-4,
- ),
- stacked,
- )
+ assert len(gripper_joint_ids) >= 1, "Observations require at least one gripper joint"
+ # Stacked also requires the gripper to be released (every jaw back at the open value).
+ open_val = torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device)
+ for joint_id in gripper_joint_ids:
+ stacked = torch.logical_and(
+ torch.isclose(
+ robot.data.joint_pos.torch[:, joint_id],
+ open_val,
+ atol=1e-4,
+ rtol=1e-4,
+ ),
+ stacked,
+ )
else:
raise ValueError("No gripper_joint_names found in environment config")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/stack_events.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/stack_events.py
new file mode 100644
index 000000000000..5bc7186a3a57
--- /dev/null
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/stack_events.py
@@ -0,0 +1,363 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Robot-neutral event functions shared by the cube-stacking tasks.
+
+These were previously defined in ``franka_stack_events.py``; they are robot-agnostic and are used
+by every stack robot config, so they live here and ``franka_stack_events`` re-exports them for
+backward compatibility.
+"""
+
+from __future__ import annotations
+
+import math
+import random
+from typing import TYPE_CHECKING
+
+import torch
+import warp as wp
+
+import isaaclab.utils.math as math_utils
+from isaaclab.managers import SceneEntityCfg
+
+if TYPE_CHECKING:
+ from isaaclab.assets import Articulation, AssetBase
+ from isaaclab.envs import ManagerBasedEnv
+
+
+def set_default_joint_pose(
+ env: ManagerBasedEnv,
+ env_ids: torch.Tensor,
+ default_pose: torch.Tensor,
+ asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"),
+):
+ # Set the default pose for robots in all envs
+ asset = env.scene[asset_cfg.name]
+ # Convert default_pose to 1D array and create joint indices
+ default_pose_1d = torch.tensor(default_pose, device=env.device).repeat(env.num_envs, 1).flatten()
+ num_joints = len(default_pose)
+ joint_ids = torch.arange(num_joints, device=env.device, dtype=torch.int32)
+ # Use update_default_joint_values kernel to update all joints for all environments
+ from isaaclab_physx.assets.articulation.kernels import update_default_joint_values
+
+ wp.launch(
+ update_default_joint_values,
+ dim=(env.num_envs, num_joints),
+ inputs=[
+ default_pose_1d,
+ joint_ids,
+ ],
+ outputs=[asset.data.default_joint_pos],
+ device=env.device,
+ )
+
+
+def randomize_joint_by_gaussian_offset(
+ env: ManagerBasedEnv,
+ env_ids: torch.Tensor,
+ mean: float,
+ std: float,
+ asset_cfg: SceneEntityCfg = SceneEntityCfg("robot"),
+):
+ """Add Gaussian noise to the (non-gripper) joints of an asset on reset.
+
+ The gripper joints are restored to their default pose rather than noised. They are resolved
+ generically from ``env.cfg.gripper_joint_names`` (the same names the stack observations and
+ terminations already use) instead of assuming the last two joints are the gripper -- the latter
+ is Franka-specific and wrong for, e.g., the single-jaw SO-101 gripper or a UR10 surface gripper.
+
+ Behavior of ``env.cfg.gripper_joint_names``:
+
+ * a non-empty list -> those joints are held at their default pose (everything else is noised);
+ * an empty list -> no gripper joints to hold, so every joint is noised (e.g. surface grippers);
+ * unset / ``None`` -> backward-compatible fallback that holds the last two joints.
+ """
+ asset: Articulation = env.scene[asset_cfg.name]
+
+ # Add gaussian noise to joint states
+ joint_pos = asset.data.default_joint_pos.torch[env_ids].clone()
+ joint_vel = asset.data.default_joint_vel.torch[env_ids].clone()
+ joint_pos += math_utils.sample_gaussian(mean, std, joint_pos.shape, joint_pos.device)
+
+ # Clamp joint pos to limits
+ joint_pos_limits = asset.data.soft_joint_pos_limits.torch[env_ids]
+ joint_pos = joint_pos.clamp_(joint_pos_limits[..., 0], joint_pos_limits[..., 1])
+
+ # Don't noise the gripper joints (resolved generically; see the docstring).
+ gripper_joint_names = getattr(env.cfg, "gripper_joint_names", None)
+ if gripper_joint_names is None:
+ # Backward-compatible fallback for callers that do not configure gripper joint names.
+ joint_pos[:, -2:] = asset.data.default_joint_pos.torch[env_ids, -2:]
+ elif gripper_joint_names:
+ gripper_ids, _ = asset.find_joints(gripper_joint_names)
+ joint_pos[:, gripper_ids] = asset.data.default_joint_pos.torch[env_ids][:, gripper_ids]
+
+ # Set into the physics simulation
+ asset.set_joint_position_target_index(target=joint_pos, env_ids=env_ids)
+ asset.set_joint_velocity_target_index(target=joint_vel, env_ids=env_ids)
+ asset.write_joint_position_to_sim_index(position=joint_pos, env_ids=env_ids)
+ asset.write_joint_velocity_to_sim_index(velocity=joint_vel, env_ids=env_ids)
+
+
+def sample_random_color(base=(0.75, 0.75, 0.75), variation=0.1):
+ """
+ Generates a randomized color that stays close to the base color while preserving overall brightness.
+ The relative balance between the R, G, and B components is maintained by ensuring that
+ the sum of random offsets is zero.
+
+ Parameters:
+ base (tuple): The base RGB color with each component between 0 and 1.
+ variation (float): Maximum deviation to sample for each channel before balancing.
+
+ Returns:
+ tuple: A new RGB color with balanced random variation.
+ """
+ # Generate random offsets for each channel in the range [-variation, variation]
+ offsets = [random.uniform(-variation, variation) for _ in range(3)]
+ # Compute the average offset
+ avg_offset = sum(offsets) / 3
+ # Adjust offsets so their sum is zero (maintaining brightness)
+ balanced_offsets = [offset - avg_offset for offset in offsets]
+
+ # Apply the balanced offsets to the base color and clamp each channel between 0 and 1
+ new_color = tuple(max(0, min(1, base_component + offset)) for base_component, offset in zip(base, balanced_offsets))
+
+ return new_color
+
+
+def randomize_scene_lighting_domelight(
+ env: ManagerBasedEnv,
+ env_ids: torch.Tensor,
+ intensity_range: tuple[float, float],
+ color_variation: float,
+ textures: list[str],
+ default_intensity: float = 3000.0,
+ default_color: tuple[float, float, float] = (0.75, 0.75, 0.75),
+ default_texture: str = "",
+ asset_cfg: SceneEntityCfg = SceneEntityCfg("light"),
+):
+ asset: AssetBase = env.scene[asset_cfg.name]
+ light_prim = asset.prims[0]
+
+ intensity_attr = light_prim.GetAttribute("inputs:intensity")
+ intensity_attr.Set(default_intensity)
+
+ color_attr = light_prim.GetAttribute("inputs:color")
+ color_attr.Set(default_color)
+
+ texture_file_attr = light_prim.GetAttribute("inputs:texture:file")
+ texture_file_attr.Set(default_texture)
+
+ if not hasattr(env.cfg, "eval_mode") or not env.cfg.eval_mode:
+ return
+
+ if env.cfg.eval_type in ["light_intensity", "all"]:
+ # Sample new light intensity
+ new_intensity = random.uniform(intensity_range[0], intensity_range[1])
+ # Set light intensity to light prim
+ intensity_attr.Set(new_intensity)
+
+ if env.cfg.eval_type in ["light_color", "all"]:
+ # Sample new light color
+ new_color = sample_random_color(base=default_color, variation=color_variation)
+ # Set light color to light prim
+ color_attr.Set(new_color)
+
+ if env.cfg.eval_type in ["light_texture", "all"]:
+ # Sample new light texture (background)
+ new_texture = random.sample(textures, 1)[0]
+ # Set light texture to light prim
+ texture_file_attr.Set(new_texture)
+
+
+def sample_object_poses(
+ num_objects: int,
+ min_separation: float = 0.0,
+ pose_range: dict[str, tuple[float, float]] = {},
+ max_sample_tries: int = 5000,
+):
+ range_list = [pose_range.get(key, (0.0, 0.0)) for key in ["x", "y", "z", "roll", "pitch", "yaw"]]
+ pose_list = []
+
+ for i in range(num_objects):
+ for j in range(max_sample_tries):
+ sample = [random.uniform(range[0], range[1]) for range in range_list]
+
+ # Accept pose if it is the first one, or if reached max num tries
+ if len(pose_list) == 0 or j == max_sample_tries - 1:
+ pose_list.append(sample)
+ break
+
+ # Check if pose of object is sufficiently far away from all other objects
+ separation_check = [math.dist(sample[:3], pose[:3]) > min_separation for pose in pose_list]
+ if False not in separation_check:
+ pose_list.append(sample)
+ break
+
+ return pose_list
+
+
+def randomize_object_pose(
+ env: ManagerBasedEnv,
+ env_ids: torch.Tensor,
+ asset_cfgs: list[SceneEntityCfg],
+ min_separation: float = 0.0,
+ pose_range: dict[str, tuple[float, float]] = {},
+ max_sample_tries: int = 5000,
+):
+ if env_ids is None:
+ return
+
+ # Randomize poses in each environment independently
+ for cur_env in env_ids.tolist():
+ pose_list = sample_object_poses(
+ num_objects=len(asset_cfgs),
+ min_separation=min_separation,
+ pose_range=pose_range,
+ max_sample_tries=max_sample_tries,
+ )
+
+ # Randomize pose for each object
+ for i in range(len(asset_cfgs)):
+ asset_cfg = asset_cfgs[i]
+ asset = env.scene[asset_cfg.name]
+
+ # Write pose to simulation
+ pose_tensor = torch.tensor([pose_list[i]], device=env.device)
+ positions = pose_tensor[:, 0:3] + env.scene.env_origins[cur_env, 0:3]
+ orientations = math_utils.quat_from_euler_xyz(pose_tensor[:, 3], pose_tensor[:, 4], pose_tensor[:, 5])
+ asset.write_root_pose_to_sim_index(
+ root_pose=torch.cat([positions, orientations], dim=-1),
+ env_ids=torch.tensor([cur_env], device=env.device),
+ )
+ asset.write_root_velocity_to_sim_index(
+ root_velocity=torch.zeros(1, 6, device=env.device), env_ids=torch.tensor([cur_env], device=env.device)
+ )
+
+
+def randomize_rigid_objects_in_focus(
+ env: ManagerBasedEnv,
+ env_ids: torch.Tensor,
+ asset_cfgs: list[SceneEntityCfg],
+ out_focus_state: torch.Tensor,
+ min_separation: float = 0.0,
+ pose_range: dict[str, tuple[float, float]] = {},
+ max_sample_tries: int = 5000,
+):
+ if env_ids is None:
+ return
+
+ # List of rigid objects in focus for each env (dim = [num_envs, num_rigid_objects])
+ env.rigid_objects_in_focus = []
+
+ for cur_env in env_ids.tolist():
+ # Sample in focus object poses
+ pose_list = sample_object_poses(
+ num_objects=len(asset_cfgs),
+ min_separation=min_separation,
+ pose_range=pose_range,
+ max_sample_tries=max_sample_tries,
+ )
+
+ selected_ids = []
+ for asset_idx in range(len(asset_cfgs)):
+ asset_cfg = asset_cfgs[asset_idx]
+ asset = env.scene[asset_cfg.name]
+
+ # Randomly select an object to bring into focus
+ object_id = random.randint(0, asset.num_bodies - 1)
+ selected_ids.append(object_id)
+
+ # Create object state tensor with shape (num_envs, num_objects, state_dim)
+ # Since we're updating one environment, we need shape (1, num_objects, state_dim)
+ object_states = torch.stack([out_focus_state] * asset.num_bodies).to(device=env.device).unsqueeze(0)
+ pose_tensor = torch.tensor([pose_list[asset_idx]], device=env.device)
+ positions = pose_tensor[:, 0:3] + env.scene.env_origins[cur_env, 0:3]
+ orientations = math_utils.quat_from_euler_xyz(pose_tensor[:, 3], pose_tensor[:, 4], pose_tensor[:, 5])
+ object_states[0, object_id, 0:3] = positions.squeeze(0)
+ object_states[0, object_id, 3:7] = orientations.squeeze(0)
+
+ asset.write_body_pose_to_sim_index(
+ body_poses=object_states[:, :, :7], env_ids=torch.tensor([cur_env], device=env.device)
+ )
+ asset.write_body_link_velocity_to_sim_index(
+ body_velocities=object_states[:, :, 7:], env_ids=torch.tensor([cur_env], device=env.device)
+ )
+
+ env.rigid_objects_in_focus.append(selected_ids)
+
+
+def randomize_visual_texture_material(
+ env: ManagerBasedEnv,
+ env_ids: torch.Tensor,
+ asset_cfg: SceneEntityCfg,
+ textures: list[str],
+ default_texture: str = "",
+ texture_rotation: tuple[float, float] = (0.0, 0.0),
+):
+ """Randomize the visual texture of bodies on an asset using Replicator API.
+
+ This function randomizes the visual texture of the bodies of the asset using the Replicator API.
+ The function samples random textures from the given texture paths and applies them to the bodies
+ of the asset. The textures are projected onto the bodies and rotated by the given angles.
+
+ .. note::
+ The function assumes that the asset follows the prim naming convention as:
+ "{asset_prim_path}/{body_name}/visuals" where the body name is the name of the body to
+ which the texture is applied. This is the default prim ordering when importing assets
+ from the asset converters in Isaac Lab.
+
+ .. note::
+ When randomizing the texture of individual assets, please make sure to set
+ :attr:`isaaclab.scene.InteractiveSceneCfg.replicate_physics` to False. This ensures that physics
+ parser will parse the individual asset properties separately.
+ """
+ if hasattr(env.cfg, "eval_mode") and (
+ not env.cfg.eval_mode or env.cfg.eval_type not in [f"{asset_cfg.name}_texture", "all"]
+ ):
+ return
+ # textures = [default_texture]
+
+ # enable replicator extension if not already enabled
+ from isaacsim.core.experimental.utils.app import enable_extension
+
+ enable_extension("omni.replicator.core")
+ # we import the module here since we may not always need the replicator
+ import omni.replicator.core as rep
+
+ # check to make sure replicate_physics is set to False, else raise error
+ # note: We add an explicit check here since texture randomization can happen outside of 'prestartup' mode
+ # and the event manager doesn't check in that case.
+ if env.cfg.scene.replicate_physics:
+ raise RuntimeError(
+ "Unable to randomize visual texture material with scene replication enabled."
+ " For stable USD-level randomization, please disable scene replication"
+ " by setting 'replicate_physics' to False in 'InteractiveSceneCfg'."
+ )
+
+ # convert from radians to degrees
+ texture_rotation = tuple(math.degrees(angle) for angle in texture_rotation)
+
+ # obtain the asset entity
+ asset = env.scene[asset_cfg.name]
+
+ # join all bodies in the asset
+ body_names = asset_cfg.body_names
+ if isinstance(body_names, str):
+ body_names_regex = body_names
+ elif isinstance(body_names, list):
+ body_names_regex = "|".join(body_names)
+ else:
+ body_names_regex = ".*"
+
+ if not hasattr(asset, "cfg"):
+ prims_group = rep.get.prims(path_pattern=f"{asset.prim_paths[0]}/visuals")
+ else:
+ prims_group = rep.get.prims(path_pattern=f"{asset.cfg.prim_path}/{body_names_regex}/visuals")
+
+ with prims_group:
+ rep.randomizer.texture(
+ textures=textures, project_uvw=True, texture_rotate=rep.distribution.uniform(*texture_rotation)
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/terminations.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/terminations.py
index e709821972cf..bcfa202e258a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/terminations.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/terminations.py
@@ -77,26 +77,19 @@ def cubes_stacked(
else:
if hasattr(env.cfg, "gripper_joint_names"):
gripper_joint_ids, _ = robot.find_joints(env.cfg.gripper_joint_names)
- assert len(gripper_joint_ids) == 2, "Terminations only support parallel gripper for now"
-
- stacked = torch.logical_and(
- torch.isclose(
- robot.data.joint_pos.torch[:, gripper_joint_ids[0]],
- torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device),
- atol=atol,
- rtol=rtol,
- ),
- stacked,
- )
- stacked = torch.logical_and(
- torch.isclose(
- robot.data.joint_pos.torch[:, gripper_joint_ids[1]],
- torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device),
- atol=atol,
- rtol=rtol,
- ),
- stacked,
- )
+ assert len(gripper_joint_ids) >= 1, "Terminations require at least one gripper joint"
+ # Success also requires the gripper to be released (every jaw back at the open value).
+ open_val = torch.tensor(env.cfg.gripper_open_val, dtype=torch.float32).to(env.device)
+ for joint_id in gripper_joint_ids:
+ stacked = torch.logical_and(
+ torch.isclose(
+ robot.data.joint_pos.torch[:, joint_id],
+ open_val,
+ atol=atol,
+ rtol=rtol,
+ ),
+ stacked,
+ )
else:
raise ValueError("No gripper_joint_names found in environment config")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py
index 654d9e57aca8..690cebab54b1 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/stack/stack_env_cfg.py
@@ -9,15 +9,18 @@
from isaaclab_physx.physics import PhysxCfg
import isaaclab.sim as sim_utils
-from isaaclab.assets import ArticulationCfg, AssetBaseCfg
+from isaaclab.assets import ArticulationCfg, AssetBaseCfg, RigidObjectCfg
from isaaclab.devices.openxr import XrCfg
from isaaclab.envs import ManagerBasedRLEnvCfg
+from isaaclab.managers import EventTermCfg as EventTerm
from isaaclab.managers import ObservationGroupCfg as ObsGroup
from isaaclab.managers import ObservationTermCfg as ObsTerm
from isaaclab.managers import SceneEntityCfg
from isaaclab.managers import TerminationTermCfg as DoneTerm
+from isaaclab.markers.config import FRAME_MARKER_CFG
from isaaclab.scene import InteractiveSceneCfg
-from isaaclab.sensors.frame_transformer.frame_transformer_cfg import FrameTransformerCfg
+from isaaclab.sensors.frame_transformer.frame_transformer_cfg import FrameTransformerCfg, OffsetCfg
+from isaaclab.sim.schemas.schemas_cfg import RigidBodyPropertiesCfg
from isaaclab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg, UsdFileCfg
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.utils.configclass import configclass
@@ -25,6 +28,60 @@
from isaaclab_tasks.utils import PresetCfg
from . import mdp
+from .mdp import stack_events
+
+# Shared rigid-body properties for the three stacking cubes (robot-neutral).
+_CUBE_PROPERTIES = RigidBodyPropertiesCfg(
+ solver_position_iteration_count=16,
+ solver_velocity_iteration_count=1,
+ max_angular_velocity=1000.0,
+ max_linear_velocity=1000.0,
+ max_depenetration_velocity=5.0,
+ disable_gravity=False,
+)
+
+
+def make_ee_frame_cfg(
+ base_prim_path: str,
+ target_specs: list[tuple[str, str, tuple[float, float, float]]],
+ marker_scale: tuple[float, float, float] = (0.1, 0.1, 0.1),
+) -> FrameTransformerCfg:
+ """Build the stacking end-effector :class:`FrameTransformerCfg` with the shared marker setup.
+
+ The marker boilerplate is identical across robots; only the source/target prim paths and
+ offsets are robot-specific, so those are passed in.
+
+ Args:
+ base_prim_path: Source-frame prim path (the robot base link).
+ target_specs: List of ``(prim_path, name, offset_pos)`` tuples, one per target frame.
+ marker_scale: Visualization marker scale.
+
+ Returns:
+ The configured :class:`FrameTransformerCfg`.
+ """
+ marker_cfg = FRAME_MARKER_CFG.copy()
+ marker_cfg.markers["frame"].scale = marker_scale
+ marker_cfg.prim_path = "/Visuals/FrameTransformer"
+ return FrameTransformerCfg(
+ prim_path=base_prim_path,
+ debug_vis=False,
+ visualizer_cfg=marker_cfg,
+ target_frames=[
+ FrameTransformerCfg.FrameCfg(prim_path=prim_path, name=name, offset=OffsetCfg(pos=pos))
+ for (prim_path, name, pos) in target_specs
+ ],
+ )
+
+
+def apply_default_semantics(scene: "ObjectTableSceneCfg") -> None:
+ """Tag the table, ground, and robot with their semantic classes.
+
+ Call this from a robot env cfg's ``__post_init__`` after the robot has been set (the robot is
+ populated by the derived cfg, so it cannot be tagged in the base ``__post_init__``).
+ """
+ scene.table.spawn.semantic_tags = [("class", "table")]
+ scene.plane.semantic_tags = [("class", "ground")]
+ scene.robot.spawn.semantic_tags = [("class", "robot")]
##
@@ -62,6 +119,39 @@ class ObjectTableSceneCfg(InteractiveSceneCfg):
spawn=sim_utils.DomeLightCfg(color=(0.75, 0.75, 0.75), intensity=3000.0),
)
+ # Three stacking cubes (blue / red / green). Derived robot cfgs override only the per-cube
+ # ``init_state`` (transforms) to place them within the robot's reach.
+ cube_1 = RigidObjectCfg(
+ prim_path="{ENV_REGEX_NS}/Cube_1",
+ init_state=RigidObjectCfg.InitialStateCfg(pos=[0.4, 0.0, 0.0203], rot=[0, 0, 0, 1]),
+ spawn=UsdFileCfg(
+ usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/blue_block.usd",
+ scale=(1.0, 1.0, 1.0),
+ rigid_props=_CUBE_PROPERTIES,
+ semantic_tags=[("class", "cube_1")],
+ ),
+ )
+ cube_2 = RigidObjectCfg(
+ prim_path="{ENV_REGEX_NS}/Cube_2",
+ init_state=RigidObjectCfg.InitialStateCfg(pos=[0.55, 0.05, 0.0203], rot=[0, 0, 0, 1]),
+ spawn=UsdFileCfg(
+ usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/red_block.usd",
+ scale=(1.0, 1.0, 1.0),
+ rigid_props=_CUBE_PROPERTIES,
+ semantic_tags=[("class", "cube_2")],
+ ),
+ )
+ cube_3 = RigidObjectCfg(
+ prim_path="{ENV_REGEX_NS}/Cube_3",
+ init_state=RigidObjectCfg.InitialStateCfg(pos=[0.60, -0.1, 0.0203], rot=[0, 0, 0, 1]),
+ spawn=UsdFileCfg(
+ usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Blocks/green_block.usd",
+ scale=(1.0, 1.0, 1.0),
+ rigid_props=_CUBE_PROPERTIES,
+ semantic_tags=[("class", "cube_3")],
+ ),
+ )
+
##
# MDP settings
@@ -75,6 +165,37 @@ class ActionsCfg:
gripper_action: mdp.BinaryJointPositionActionCfg = MISSING
+@configclass
+class StackEventCfg:
+ """Robot-neutral reset events shared by the stacking tasks.
+
+ Derived robot cfgs typically override the cube ``pose_range`` / ``min_separation`` to match the
+ robot's reachable workspace. The joint-randomization term holds the gripper joints fixed,
+ resolving them from the env's ``gripper_joint_names`` (see
+ :func:`~isaaclab_tasks.contrib.stack.mdp.stack_events.randomize_joint_by_gaussian_offset`).
+ """
+
+ randomize_joint_state = EventTerm(
+ func=stack_events.randomize_joint_by_gaussian_offset,
+ mode="reset",
+ params={
+ "mean": 0.0,
+ "std": 0.02,
+ "asset_cfg": SceneEntityCfg("robot"),
+ },
+ )
+
+ randomize_cube_positions = EventTerm(
+ func=stack_events.randomize_object_pose,
+ mode="reset",
+ params={
+ "pose_range": {"x": (0.4, 0.6), "y": (-0.10, 0.10), "z": (0.0203, 0.0203), "yaw": (-1.0, 1.0)},
+ "min_separation": 0.1,
+ "asset_cfgs": [SceneEntityCfg("cube_1"), SceneEntityCfg("cube_2"), SceneEntityCfg("cube_3")],
+ },
+ )
+
+
@configclass
class ObservationsCfg:
"""Observation specifications for the MDP."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/dexsuite/dexsuite_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/dexsuite/dexsuite_env_cfg.py
index 019f1c9e07f4..9330f3b225ba 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/dexsuite/dexsuite_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/dexsuite/dexsuite_env_cfg.py
@@ -470,7 +470,7 @@ class DexsuiteReorientEnvCfg(ManagerBasedEnvCfg):
def validate_config(self):
"""Check for invalid preset combinations after resolution."""
- warp_supported = {"rgb", "depth", "distance_to_image_plane"}
+ warp_supported = {"rgb", "depth", "distance_to_image_plane", "normals"}
for cam_attr in ("base_camera", "wrist_camera"):
cam = getattr(self.scene, cam_attr, None)
if cam is None:
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_env_cfg.py
index 9811bfa8526e..243cc7cbfadc 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_env_cfg.py
@@ -124,7 +124,7 @@ class ShadowHandCameraEnvCfg(ShadowHandEnvCfg):
def validate_config(self):
"""Check renderer/data-type and feature-extractor compatibility."""
renderer_type = getattr(self.tiled_camera.renderer_cfg, "renderer_type", None)
- warp_supported = {"rgb", "depth"}
+ warp_supported = {"rgb", "depth", "normals"}
if renderer_type == "newton_warp":
unsupported = set(self.tiled_camera.data_types) - warp_supported
if unsupported:
@@ -134,7 +134,10 @@ def validate_config(self):
"Choose a compatible preset, e.g. presets=newton_renderer,rgb."
)
- if set(self.tiled_camera.data_types) == {"depth"} and self.feature_extractor.enabled:
+ non_depth_data_types = set(self.tiled_camera.data_types).difference(
+ {"depth", "distance_to_image_plane", "distance_to_camera"}
+ )
+ if self.tiled_camera.data_types and not non_depth_data_types and self.feature_extractor.enabled:
raise ValueError(
"Depth-only camera data type is intended for benchmarking only. "
"The keypoint-regression CNN cannot be meaningfully trained from depth alone. "
diff --git a/source/isaaclab_tasks/isaaclab_tasks/utils/presets.py b/source/isaaclab_tasks/isaaclab_tasks/utils/presets.py
index 2aec60cce07f..3d79ce5286e5 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/utils/presets.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/utils/presets.py
@@ -7,14 +7,21 @@
from isaaclab_ov.renderers import OVRTXRendererCfg
from isaaclab_physx.renderers import IsaacRtxRendererCfg
+from isaaclab.renderers.renderer_cfg import RendererCfg
from isaaclab.utils.configclass import configclass
from isaaclab_tasks.utils import PresetCfg
+@configclass
+class _AutoRtxRendererCfg(RendererCfg):
+ renderer_type: str = "auto_rtx"
+
+
@configclass
class MultiBackendRendererCfg(PresetCfg):
default: IsaacRtxRendererCfg = IsaacRtxRendererCfg()
+ rtx: _AutoRtxRendererCfg = _AutoRtxRendererCfg()
newton_renderer: NewtonWarpRendererCfg = NewtonWarpRendererCfg()
ovrtx_renderer: OVRTXRendererCfg = OVRTXRendererCfg()
isaacsim_rtx_renderer = default
diff --git a/source/isaaclab_tasks/pyproject.toml b/source/isaaclab_tasks/pyproject.toml
index 988ef4966925..4e1ebfd167b1 100644
--- a/source/isaaclab_tasks/pyproject.toml
+++ b/source/isaaclab_tasks/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab_tasks"
-version = "8.0.4"
+version = "8.1.0"
description = "Extension containing suite of environments for robot learning."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
diff --git a/source/isaaclab_tasks/test/conftest.py b/source/isaaclab_tasks/test/conftest.py
index 4cc0cca45509..b37173affaa8 100644
--- a/source/isaaclab_tasks/test/conftest.py
+++ b/source/isaaclab_tasks/test/conftest.py
@@ -13,4 +13,12 @@
import os
import sys
+import pytest
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+
+@pytest.fixture()
+def enable_scene_partition(monkeypatch):
+ """Set ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` for the duration of one test."""
+ monkeypatch.setenv("ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION", "1")
diff --git a/source/isaaclab_tasks/test/contrib/stack/test_so101_pose_ik.py b/source/isaaclab_tasks/test/contrib/stack/test_so101_pose_ik.py
new file mode 100644
index 000000000000..10e5086c8f25
--- /dev/null
+++ b/source/isaaclab_tasks/test/contrib/stack/test_so101_pose_ik.py
@@ -0,0 +1,190 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Sim-free unit tests for the SO-101 IK layer.
+
+The SO-101 controller is a thin subclass of the core
+:class:`~isaaclab.controllers.DifferentialIKController`; the only SO-101-specific behavior is the
+wrist-only orientation joint mask. The generic IK features it relies on (the ``adaptive_dls``
+ik-method, per-axis orientation weighting, and null-space joint-limit avoidance) are tested in
+``source/isaaclab/test/controllers/test_differential_ik_features.py``. These tests cover the mask
+plus the IK-Abs env/action wiring with hand-built tensors -- no gym.make, USD, or GPU.
+"""
+
+import dataclasses
+import math
+
+import pytest
+import torch
+
+from isaaclab_tasks.contrib.stack.config.so101.pose_ik_controller import (
+ SO101PoseIKController,
+ SO101PoseIKControllerCfg,
+)
+
+# The SO-101 arm IK acts over 5 joints; the geometric Jacobian is (N, 6, 5).
+_NUM_JOINTS = 5
+_ID_QUAT = [0.0, 0.0, 0.0, 1.0] # xyzw identity
+
+
+def _quat_xyzw(axis: list[float], angle: float) -> list[float]:
+ """Build a unit xyzw quaternion from an axis (need not be unit) and angle [rad]."""
+ norm = math.sqrt(sum(a * a for a in axis)) or 1.0
+ s = math.sin(angle / 2.0)
+ return [axis[0] / norm * s, axis[1] / norm * s, axis[2] / norm * s, math.cos(angle / 2.0)]
+
+
+def _make_controller(
+ num_envs: int = 1,
+ orientation_weight=1.0,
+ joint_limit_avoidance_gain: float = 0.0,
+ joint_limit_avoidance_margin: float = 0.3,
+):
+ cfg = SO101PoseIKControllerCfg(
+ command_type="pose",
+ use_relative_mode=False,
+ ik_method="adaptive_dls",
+ ik_params={"lambda_min": 0.05, "lambda_max": 0.2, "sigma_thresh": 0.02},
+ orientation_weight=orientation_weight,
+ joint_limit_avoidance_gain=joint_limit_avoidance_gain,
+ joint_limit_avoidance_margin=joint_limit_avoidance_margin,
+ )
+ return SO101PoseIKController(cfg=cfg, num_envs=num_envs, device="cpu")
+
+
+def test_action_dim_is_seven():
+ """The controller advertises a 7D pose command: [pos_xyz, quat_xyzw] (inherited from core)."""
+ assert _make_controller().action_dim == 7
+
+
+def test_orientation_joint_mask_zeros_unmasked_orientation_columns():
+ """The SO-101 orientation joint mask zeros the orientation-row columns of the masked-out joints
+ (so they serve position only), while the position rows and the task error are unchanged.
+
+ This is the only SO-101-specific addition over the core controller: only ``wrist_flex`` /
+ ``wrist_roll`` (the last two columns) may serve orientation, so ``shoulder_pan`` (col 0) never
+ drives it and the base does not swing to track a commanded orientation.
+ """
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ ee_quat = torch.tensor([_ID_QUAT])
+ jac = torch.arange(6 * _NUM_JOINTS, dtype=torch.float32).reshape(1, 6, _NUM_JOINTS)
+ cmd = torch.tensor([[0.31, 0.0, 0.2] + _quat_xyzw([0.3, 0.5, 0.8], 0.7)])
+
+ # weight 1.0 isolates the mask effect (no per-axis scaling on top)
+ c = _make_controller(orientation_weight=1.0)
+ c.set_orientation_joint_mask(torch.tensor([0.0, 0.0, 0.0, 1.0, 1.0])) # wrist joints only
+ c.set_command(cmd)
+ task_jac, err = c._compute_pose_task(ee_pos, ee_quat, jac)
+
+ # position rows keep every joint (unchanged from the raw Jacobian linear block)
+ torch.testing.assert_close(task_jac[:, :3, :], jac[:, 0:3, :])
+ # orientation rows: masked-out joints (cols 0..2) zeroed; allowed wrist joints (cols 3,4) kept
+ torch.testing.assert_close(task_jac[:, 3:6, 0:3], torch.zeros(1, 3, 3))
+ torch.testing.assert_close(task_jac[:, 3:6, 3:5], jac[:, 3:6, 3:5])
+
+ # the mask limits which joints reduce the orientation error; it does not alter the error
+ base = _make_controller(orientation_weight=1.0)
+ base.set_command(cmd)
+ _, eb = base._compute_pose_task(ee_pos, ee_quat, jac)
+ torch.testing.assert_close(err, eb)
+
+
+def test_mask_none_leaves_orientation_unmasked():
+ """Without a mask, the SO-101 pose task matches the (orientation-weighted) core task."""
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ ee_quat = torch.tensor([_ID_QUAT])
+ jac = torch.arange(6 * _NUM_JOINTS, dtype=torch.float32).reshape(1, 6, _NUM_JOINTS)
+ c = _make_controller(orientation_weight=1.0)
+ c.set_command(torch.tensor([[0.31, 0.0, 0.2] + _quat_xyzw([1.0, 0.0, 0.0], 0.5)]))
+ task_jac, _ = c._compute_pose_task(ee_pos, ee_quat, jac)
+ torch.testing.assert_close(task_jac, jac)
+
+
+def test_compute_returns_joint_targets_shape():
+ """End-to-end compute (adaptive DLS + orientation weight + mask + JLA) returns one target per
+ joint."""
+ c = _make_controller(orientation_weight=0.5, joint_limit_avoidance_gain=0.5)
+ c.set_orientation_joint_mask(torch.tensor([0.0, 0.0, 0.0, 1.0, 1.0]))
+ c.set_joint_pos_limits(torch.full((_NUM_JOINTS,), -1.0), torch.full((_NUM_JOINTS,), 1.0))
+ ee_pos = torch.tensor([[0.3, 0.0, 0.2]])
+ ee_quat = torch.tensor([_ID_QUAT])
+ c.set_command(torch.tensor([[0.31, 0.0, 0.2] + _ID_QUAT]))
+ jac = torch.zeros(1, 6, _NUM_JOINTS)
+ for i in range(_NUM_JOINTS):
+ jac[0, i, i] = 1.0
+ out = c.compute(ee_pos, ee_quat, jac, torch.zeros(1, _NUM_JOINTS))
+ assert out.shape == (1, _NUM_JOINTS)
+
+
+def test_action_cfg_points_at_custom_action_and_controller():
+ """The action cfg wires the custom action class and the SO-101 controller cfg."""
+ pytest.importorskip("pxr") # the action term imports UsdPhysics at module load
+ from isaaclab.utils.string import string_to_callable
+
+ from isaaclab_tasks.contrib.stack.config.so101.pose_ik_action import SO101PoseIKActionCfg
+ from isaaclab_tasks.contrib.stack.config.so101.pose_ik_action_term import SO101PoseIKAction
+
+ cfg = SO101PoseIKActionCfg(
+ asset_name="robot",
+ joint_names=["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll"],
+ body_name="gripper",
+ controller=SO101PoseIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="adaptive_dls"),
+ )
+ # ``class_type`` is a lazy ``{DIR}.pose_ik_action_term:SO101PoseIKAction`` string (so the cfg
+ # stays importable without Kit); resolve it to confirm it points at the custom term.
+ assert string_to_callable(str(cfg.class_type)) is SO101PoseIKAction
+ assert isinstance(cfg.controller, SO101PoseIKControllerCfg)
+
+
+def test_action_cfg_accepts_clip_field():
+ """The cfg dataclass accepts a clip value as a plain field (no sim required).
+
+ Verifying that NotImplementedError is raised when clip is set requires constructing the action
+ term, which needs a live articulation (sim). That path is sim-gated and is not tested here.
+ """
+ pytest.importorskip("pxr") # action term imports UsdPhysics at module load
+ from isaaclab_tasks.contrib.stack.config.so101.pose_ik_action import SO101PoseIKActionCfg
+
+ clip_value = {"shoulder_pan": (-1.0, 1.0)}
+ cfg = SO101PoseIKActionCfg(
+ asset_name="robot",
+ joint_names=["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll"],
+ body_name="gripper",
+ controller=SO101PoseIKControllerCfg(command_type="pose", use_relative_mode=False, ik_method="adaptive_dls"),
+ clip=clip_value,
+ )
+ # The cfg stores the value -- the refusal happens at action-term construction (sim-gated).
+ assert cfg.clip == clip_value
+
+
+def test_env_cfg_arm_action_is_pose_and_ordering_matches_pipeline():
+ """The IK-Abs env wires the full-pose arm action, the wrist-only orientation mask, and the
+ 8D action ordering."""
+ pytest.importorskip("pxr")
+ from isaaclab_tasks.contrib.stack.config.so101.pose_ik_action import SO101PoseIKActionCfg
+ from isaaclab_tasks.contrib.stack.config.so101.stack_ik_abs_env_cfg import (
+ SO101CubeStackEnvCfg,
+ SO101IkActionsCfg,
+ )
+
+ cfg = SO101CubeStackEnvCfg()
+ assert isinstance(cfg.actions.arm_action, SO101PoseIKActionCfg)
+ controller = cfg.actions.arm_action.controller
+ assert controller.command_type == "pose"
+ assert controller.ik_method == "adaptive_dls"
+ assert controller.orientation_joint_names == ("wrist_flex", "wrist_roll")
+ assert cfg.actions.arm_action.joint_names == [
+ "shoulder_pan",
+ "shoulder_lift",
+ "elbow_flex",
+ "wrist_flex",
+ "wrist_roll",
+ ]
+ # Field order is the positional contract with the pipeline output_order:
+ # [arm(pos+quat), gripper] -> [pos_xyz, quat_xyzw, gripper].
+ assert [f.name for f in dataclasses.fields(SO101IkActionsCfg)] == [
+ "arm_action",
+ "gripper_action",
+ ]
diff --git a/source/isaaclab_tasks/test/contrib/test_so101_teleop_pipeline.py b/source/isaaclab_tasks/test/contrib/test_so101_teleop_pipeline.py
new file mode 100644
index 000000000000..220dbc29cb7c
--- /dev/null
+++ b/source/isaaclab_tasks/test/contrib/test_so101_teleop_pipeline.py
@@ -0,0 +1,88 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Sim-free tests for the SO-101 XR teleop pipeline wiring.
+
+These tests build the IsaacTeleop pipeline standalone (no ``gym.make``, USD, GPU, or XR
+device) and verify the flattened action width and element order, plus the external-input
+contract the Lab-side device wiring depends on.
+
+The retargeter math itself (trigger -> closedness, clutch rebasing, orientation calibration) is
+unit tested in Isaac Teleop (``test_so101_retargeters.py``); this file guards only the Lab-side
+wiring:
+
+- The pose retargeter emits a fixed 7-element output; the flattened action passes the full pose
+ through and concatenates the gripper channel into the 8D action
+ ``[pos_x, pos_y, pos_z, quat_x, quat_y, quat_z, quat_w, gripper]``.
+- Each entry in ``output_order`` must resolve to a declared element name; an undeclared
+ name resolves silently to a constant 0.0 instead of raising.
+- The clutch declares only the controller input (no ``robot_ee_pos`` / ``robot_base_pos``): the
+ base-frame rebase is handled upstream by ``target_frame_prim_path`` and the engage home is the
+ clutch's static reset-origin config, so no live end-effector or base feed is wired.
+"""
+
+import pytest
+
+pytest.importorskip("isaacteleop")
+
+from isaacteleop.retargeters import SO101ClutchRetargeter
+from isaacteleop.retargeters.SO101.gripper_retargeter import GRIPPER_ELEMENT_LABEL
+from isaacteleop.retargeting_engine.deviceio_source_nodes import ControllersSource
+
+from isaaclab_tasks.contrib.stack.config.so101.stack_ik_abs_env_cfg import _build_so101_stack_pipeline
+
+
+def test_so101_pipeline_action_is_8d():
+ """The SO-101 pipeline flattens to an 8D action ``[pos_xyz, quat_xyzw, gripper]``."""
+ combiner = _build_so101_stack_pipeline()
+
+ action_type = combiner.output_types()["action"].types[0]
+ assert action_type.shape == (8,), f"expected an 8D action, got shape {action_type.shape}"
+
+
+def test_so101_pipeline_output_order():
+ """The action elements resolve to the declared labels in order (not silent 0.0 fillers)."""
+ combiner = _build_so101_stack_pipeline()
+
+ # Walk the OutputCombiner -> subgraph -> TensorReorderer to read the resolved output order.
+ # NOTE: this depends on isaacteleop internals; the width==8 test is the public-API guard.
+ try:
+ reorderer = combiner.output_mapping["action"].module._target_module
+ output_order = reorderer._output_order
+ except AttributeError:
+ pytest.skip("relies on isaacteleop internals; public accessor unavailable")
+
+ expected_order = [
+ "pos_x",
+ "pos_y",
+ "pos_z",
+ "quat_x",
+ "quat_y",
+ "quat_z",
+ "quat_w",
+ GRIPPER_ELEMENT_LABEL,
+ ]
+ assert output_order == expected_order, (
+ f"unexpected output order {output_order}; the pose/gripper elements must resolve to the"
+ f" declared pos/quat/{GRIPPER_ELEMENT_LABEL!r} labels so they do not become silent 0.0"
+ " fillers"
+ )
+
+
+def test_clutch_consumes_controller_only():
+ """The clutch declares only the controller; no ``robot_ee_pos`` / ``robot_base_pos`` inputs.
+
+ The world->base rebase happens upstream in the device via ``target_frame_prim_path`` (set to
+ the robot base), and the engage home is the clutch's static ``home_base_T_ee`` reset-origin, so
+ the clutch needs no live end-effector or base feed. This guards that the builder does not wire
+ inputs the device no longer provides.
+ """
+ clutch = SO101ClutchRetargeter(name="ee_pose")
+ assert list(clutch.input_spec()) == [ControllersSource.RIGHT]
+ assert not hasattr(SO101ClutchRetargeter, "ROBOT_EE_POS_INPUT")
+ assert not hasattr(SO101ClutchRetargeter, "ROBOT_BASE_POS_INPUT")
+ # The builder still flattens to the 8D action contract.
+ combiner = _build_so101_stack_pipeline()
+ assert combiner.output_types()["action"].types[0].shape == (8,)
diff --git a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py
index bed01543053a..e546adeb8e44 100644
--- a/source/isaaclab_tasks/test/core/test_preset_kit_decision.py
+++ b/source/isaaclab_tasks/test/core/test_preset_kit_decision.py
@@ -11,26 +11,42 @@
"""
import sys
+from argparse import Namespace
+
+from isaaclab_ov.renderers import OVRTXRendererCfg
+from isaaclab_physx.renderers import IsaacRtxRendererCfg
from isaaclab.app import scan
import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import resolve_task_config
+from isaaclab_tasks.utils.preset_cli import enumerate_task_presets
+from isaaclab_tasks.utils.preset_target import PresetTarget
_CAMERA_PRESETS_TASK = "Isaac-Cartpole-Camera-Direct"
def _resolve_with_presets(presets: str):
"""Resolve env_cfg with given presets. Modifies sys.argv temporarily."""
+ return _resolve_with_args(f"presets={presets}")
+
+
+def _resolve_with_args(*args: str):
+ """Resolve env_cfg with the given Hydra-style args. Modifies sys.argv temporarily."""
old_argv = sys.argv.copy()
try:
- sys.argv = [sys.argv[0], f"presets={presets}"]
- env_cfg, agent_cfg = resolve_task_config(_CAMERA_PRESETS_TASK, "rl_games_cfg_entry_point")
+ sys.argv = [sys.argv[0], *args]
+ env_cfg, _ = resolve_task_config(_CAMERA_PRESETS_TASK, "rl_games_cfg_entry_point")
return env_cfg
finally:
sys.argv = old_argv
+def _resolve_runtime_renderer(env_cfg, launcher_args=None):
+ """Apply launch-time auto RTX renderer resolution and return the updated scan."""
+ return scan(env_cfg, launcher_args)
+
+
def test_resolve_task_config_applies_plain_scalar_override():
"""Plain ``env.*=value`` overrides should resolve without requiring Hydra composition."""
old_argv = sys.argv.copy()
@@ -43,6 +59,14 @@ def test_resolve_task_config_applies_plain_scalar_override():
assert env_cfg.scene.num_envs == 123
+def test_rtx_is_renderer_selector():
+ """The automatic RTX selector is exposed as ``renderer=rtx``."""
+ preset_map = enumerate_task_presets(_CAMERA_PRESETS_TASK)
+
+ assert preset_map is not None
+ assert "rtx" in preset_map[PresetTarget.RENDERER]
+
+
def test_preset_mjwarp_ovrtx_does_not_need_kit():
"""Newton + OVRTX renderer is kitless — no AppLauncher required."""
env_cfg = _resolve_with_presets("newton_mjwarp,ovrtx_renderer")
@@ -50,6 +74,51 @@ def test_preset_mjwarp_ovrtx_does_not_need_kit():
assert needs_kit is False
+def test_preset_rtx_with_physx_resolves_to_isaac_rtx_and_needs_kit():
+ """The RTX preset uses Isaac RTX when PhysX requires Isaac Sim."""
+ env_cfg = _resolve_with_presets("rtx")
+ config_scan = _resolve_runtime_renderer(env_cfg)
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg)
+ assert config_scan.needs_kit is True
+
+
+def test_renderer_selector_rtx_with_physx_resolves_to_isaac_rtx_and_needs_kit():
+ """The RTX renderer selector uses Isaac RTX when PhysX requires Isaac Sim."""
+ env_cfg = _resolve_with_args("renderer=rtx")
+ config_scan = _resolve_runtime_renderer(env_cfg)
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg)
+ assert config_scan.needs_kit is True
+
+
+def test_preset_mjwarp_rtx_resolves_to_ovrtx_without_kit():
+ """The RTX preset uses OVRTX for a kitless Newton run."""
+ env_cfg = _resolve_with_presets("newton_mjwarp,rtx")
+ config_scan = _resolve_runtime_renderer(env_cfg)
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg)
+ assert config_scan.needs_kit is False
+
+
+def test_preset_mjwarp_rtx_resolves_to_isaac_rtx_with_kit_visualizer():
+ """The RTX preset uses Isaac RTX when the Kit visualizer is requested."""
+ env_cfg = _resolve_with_presets("newton_mjwarp,rtx")
+ config_scan = _resolve_runtime_renderer(env_cfg, Namespace(visualizer="kit"))
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg)
+ assert config_scan.needs_kit is True
+
+
+def test_renderer_selector_mjwarp_rtx_resolves_to_ovrtx_without_kit():
+ """The RTX renderer selector uses OVRTX for a kitless Newton run."""
+ env_cfg = _resolve_with_args("physics=newton_mjwarp", "renderer=rtx")
+ config_scan = _resolve_runtime_renderer(env_cfg)
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg)
+ assert config_scan.needs_kit is False
+
+
def test_preset_mjwarp_newton_renderer_does_not_need_kit():
"""Newton + Newton Warp renderer is kitless."""
env_cfg = _resolve_with_presets("newton_mjwarp,newton_renderer")
diff --git a/source/isaaclab_tasks/test/core/test_rendering_cartpole.py b/source/isaaclab_tasks/test/core/test_rendering_cartpole.py
index 6f10a80a1d4b..5ac49d76df33 100644
--- a/source/isaaclab_tasks/test/core/test_rendering_cartpole.py
+++ b/source/isaaclab_tasks/test/core/test_rendering_cartpole.py
@@ -32,6 +32,6 @@
@pytest.mark.parametrize("physics_backend,renderer,data_type", PHYSICS_RENDERER_AOV_COMBINATIONS)
-def test_rendering_cartpole(physics_backend, renderer, data_type):
+def test_rendering_cartpole(physics_backend, renderer, data_type, enable_scene_partition):
"""Test cartpole environment rendering correctness."""
rendering_test_cartpole(physics_backend, renderer, data_type, _COMPARISON_SCORES)
diff --git a/source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py b/source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py
index e66538c46c1c..fd2f7535a7da 100644
--- a/source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py
+++ b/source/isaaclab_tasks/test/core/test_rendering_registered_tasks.py
@@ -86,7 +86,7 @@ def _collect_camera_outputs(env: object) -> dict[str, dict[str, torch.Tensor]]:
@pytest.mark.parametrize("task_id, presets, env_name", _RENDER_CORRECTNESS_TASK_IDS)
-def test_rendering_registered_tasks(task_id: str, presets: str | None, env_name: str):
+def test_rendering_registered_tasks(task_id: str, presets: str | None, env_name: str, enable_scene_partition):
"""Test registered tasks rendering correctness."""
env = None
diff --git a/source/isaaclab_tasks/test/core/test_runtime_compatibility.py b/source/isaaclab_tasks/test/core/test_runtime_compatibility.py
index e08eab376ad6..7a1fa3140a88 100644
--- a/source/isaaclab_tasks/test/core/test_runtime_compatibility.py
+++ b/source/isaaclab_tasks/test/core/test_runtime_compatibility.py
@@ -16,9 +16,13 @@
import sys
import pytest
+from isaaclab_ov.renderers import OVRTXRendererCfg
+from isaaclab_physx.renderers import IsaacRtxRendererCfg
+import isaaclab.app.sim_launcher as sim_launcher_module
+import isaaclab.utils as isaaclab_utils
from isaaclab.app import scan
-from isaaclab.app.sim_launcher import _validate_runtime
+from isaaclab.app.sim_launcher import _validate_runtime, launch_simulation
import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import resolve_task_config
@@ -28,7 +32,9 @@
def validate_runtime_compatibility(env_cfg, launcher_args=None):
"""Run the single-scan runtime validation for *env_cfg* (test adapter)."""
- _validate_runtime(scan(env_cfg), launcher_args)
+ config_scan = scan(env_cfg, launcher_args)
+ _validate_runtime(config_scan, launcher_args)
+ return config_scan
def _resolve_with_presets(presets: str):
@@ -132,6 +138,58 @@ def test_default_preset_is_valid():
validate_runtime_compatibility(env_cfg)
+def test_rtx_with_default_physx_is_valid_and_resolves_to_isaac_rtx():
+ """The RTX preset chooses the Kit-compatible renderer for PhysX."""
+ env_cfg = _resolve_with_presets("rtx")
+ config_scan = validate_runtime_compatibility(env_cfg)
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg)
+ assert config_scan.needs_kit is True
+
+
+def test_rtx_with_newton_is_valid_and_resolves_to_ovrtx():
+ """The RTX preset chooses OVRTX when no Isaac Sim runtime is needed."""
+ env_cfg = _resolve_with_presets("newton_mjwarp,rtx")
+ config_scan = validate_runtime_compatibility(env_cfg)
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg)
+ assert config_scan.needs_kit is False
+
+
+def test_rtx_with_ovphysx_is_valid_and_resolves_to_ovrtx():
+ """The RTX preset chooses OVRTX for an OvPhysX kitless run."""
+ env_cfg = _resolve_with_presets("ovphysx,rtx")
+ config_scan = validate_runtime_compatibility(env_cfg)
+
+ assert config_scan.has_ovphysx_physics is True
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, OVRTXRendererCfg)
+ assert config_scan.needs_kit is False
+
+
+def test_rtx_with_kit_visualizer_is_valid_and_resolves_to_isaac_rtx():
+ """The RTX preset chooses Isaac RTX when the Kit visualizer is requested."""
+ env_cfg = _resolve_with_presets("newton_mjwarp,rtx")
+ config_scan = validate_runtime_compatibility(env_cfg, argparse.Namespace(visualizer="kit"))
+
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg)
+ assert config_scan.needs_kit is True
+
+
+def test_livestream_rtx_injects_kit_before_auto_rtx_resolution(monkeypatch: pytest.MonkeyPatch):
+ """Livestreaming should make ``presets=newton_mjwarp,rtx`` choose Isaac RTX."""
+ env_cfg = _resolve_with_presets("newton_mjwarp,rtx")
+ launcher_args = argparse.Namespace(livestream=2, visualizer=None, visualizer_explicit=False)
+ monkeypatch.setattr(sim_launcher_module, "_ensure_isaac_sim_available", lambda: None)
+ monkeypatch.setattr(isaaclab_utils, "has_kit", lambda: True)
+
+ with launch_simulation(env_cfg, launcher_args) as physics_cfg:
+ assert type(physics_cfg).__name__ == "NewtonCfg"
+
+ assert launcher_args.visualizer == ["kit"]
+ assert launcher_args.enable_cameras is True
+ assert isinstance(env_cfg.tiled_camera.renderer_cfg, IsaacRtxRendererCfg)
+
+
def test_newton_plus_isaacsim_rtx_is_valid():
"""Newton + Isaac RTX renderer is supported (RTX runs in Kit, Newton syncs to USD)."""
env_cfg = _resolve_with_presets("newton,isaacsim_rtx_renderer")
diff --git a/source/isaaclab_tasks/test/core/test_shadow_hand_camera_presets.py b/source/isaaclab_tasks/test/core/test_shadow_hand_camera_presets.py
index 040f5b2956a6..efcf08d5be6a 100644
--- a/source/isaaclab_tasks/test/core/test_shadow_hand_camera_presets.py
+++ b/source/isaaclab_tasks/test/core/test_shadow_hand_camera_presets.py
@@ -34,6 +34,8 @@
from isaaclab_ov.renderers import OVRTXRendererCfg # noqa: E402
from isaaclab_physx.renderers import IsaacRtxRendererCfg # noqa: E402
+from isaaclab.renderers import RendererCfg # noqa: E402
+
from isaaclab_tasks.core.reorient.config.shadow_hand.shadow_hand_camera_env_cfg import ( # noqa: E402
ShadowHandCameraEnvCfg,
)
@@ -255,10 +257,17 @@ def test_warp_renderer_has_correct_renderer_type(shadow_hand_camera_presets):
assert warp_cfg.renderer_type == "newton_warp"
+def test_rtx_preset_has_auto_renderer_type(shadow_hand_camera_presets):
+ """The ``rtx`` preset is an automatic renderer placeholder resolved at launch."""
+ rtx_cfg = shadow_hand_camera_presets["tiled_camera.renderer_cfg"]["rtx"]
+ assert isinstance(rtx_cfg, RendererCfg)
+ assert rtx_cfg.renderer_type == "auto_rtx"
+
+
def test_all_renderer_presets_present(shadow_hand_camera_presets):
"""Every preset in MultiBackendRendererCfg is discoverable."""
renderer_presets = shadow_hand_camera_presets["tiled_camera.renderer_cfg"]
- expected_names = {"default", "isaacsim_rtx_renderer", "newton_renderer", "ovrtx_renderer"}
+ expected_names = {"default", "rtx", "isaacsim_rtx_renderer", "newton_renderer", "ovrtx_renderer"}
missing = expected_names - set(renderer_presets.keys())
assert not missing, f"Renderer presets missing from collected presets: {missing}"
diff --git a/source/isaaclab_tasks/test/core/test_sim_launcher_visualizer_intent.py b/source/isaaclab_tasks/test/core/test_sim_launcher_visualizer_intent.py
index ad049f11ea96..5f6e6ba29339 100644
--- a/source/isaaclab_tasks/test/core/test_sim_launcher_visualizer_intent.py
+++ b/source/isaaclab_tasks/test/core/test_sim_launcher_visualizer_intent.py
@@ -51,6 +51,7 @@ def __init__(self, launcher_args):
captured["closed"] = False
self.app = types.SimpleNamespace(close=lambda: captured.update({"closed": True}))
+ monkeypatch.setitem(sys.modules, "isaaclab.utils", types.SimpleNamespace(has_kit=lambda: False))
monkeypatch.setitem(sys.modules, "isaaclab.app", types.SimpleNamespace(AppLauncher=_FakeAppLauncher))
monkeypatch.setattr("importlib.util.find_spec", lambda name: object() if name == "omni.kit" else None)
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..0a26486d7f85
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8929af0b155ac73e4dd74dd70dbc502fb78bd962248e5c46f88972a0a7e3e80e
+size 538
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..0387686a7a78
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ea4e6ba2251666e4df0c937fbd123489f2a06939bda9e674d5f84eb5c8831f7d
+size 422
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..64d863531288
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:516de455bbf77ceafc5c8496e5f7ec6e154ac9efb7c3b51ae3d3a144165be69b
+size 764
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-newton_renderer-normals.png
new file mode 100644
index 000000000000..f420406f93a0
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e933536d04c93bc9df198a4ac3fcfa8ff4edc25d7c0ee67f23eaaa9aadb91f59
+size 766
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..0a26486d7f85
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8929af0b155ac73e4dd74dd70dbc502fb78bd962248e5c46f88972a0a7e3e80e
+size 538
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..0387686a7a78
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ea4e6ba2251666e4df0c937fbd123489f2a06939bda9e674d5f84eb5c8831f7d
+size 422
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-normals.png
new file mode 100644
index 000000000000..64d863531288
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/newton-ovrtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:516de455bbf77ceafc5c8496e5f7ec6e154ac9efb7c3b51ae3d3a144165be69b
+size 764
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-newton_renderer-normals.png
new file mode 100644
index 000000000000..f420406f93a0
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e933536d04c93bc9df198a4ac3fcfa8ff4edc25d7c0ee67f23eaaa9aadb91f59
+size 766
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..0a26486d7f85
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8929af0b155ac73e4dd74dd70dbc502fb78bd962248e5c46f88972a0a7e3e80e
+size 538
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..0387686a7a78
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ea4e6ba2251666e4df0c937fbd123489f2a06939bda9e674d5f84eb5c8831f7d
+size 422
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-normals.png
new file mode 100644
index 000000000000..64d863531288
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/ovphysx-ovrtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:516de455bbf77ceafc5c8496e5f7ec6e154ac9efb7c3b51ae3d3a144165be69b
+size 764
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..0a26486d7f85
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8929af0b155ac73e4dd74dd70dbc502fb78bd962248e5c46f88972a0a7e3e80e
+size 538
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..0387686a7a78
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ea4e6ba2251666e4df0c937fbd123489f2a06939bda9e674d5f84eb5c8831f7d
+size 422
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..64d863531288
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/physx-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:516de455bbf77ceafc5c8496e5f7ec6e154ac9efb7c3b51ae3d3a144165be69b
+size 764
diff --git a/source/isaaclab_tasks/test/golden_images/cartpole/physx-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/cartpole/physx-newton_renderer-normals.png
new file mode 100644
index 000000000000..f420406f93a0
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/cartpole/physx-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e933536d04c93bc9df198a4ac3fcfa8ff4edc25d7c0ee67f23eaaa9aadb91f59
+size 766
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..a4626ba44f33
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41ecbb1dbb608dbc9aa4b172fcbff57333a741e36b85ea937930b593eba774c1
+size 588
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..d823d5d96998
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f401da10698c1025957c57b8ca5ee359dab0449a78613941e3d9841df595794
+size 568
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..979c2226c8e2
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33cce7fdc53de5e4629ef9a45dc0ce850afeb3fcc0ed10ac2005442641ec5b6f
+size 1941
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-newton_renderer-normals.png
new file mode 100644
index 000000000000..279d091dc508
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4627d5925011dae9021c1b455030903c1e6145f41ca7cc5d3a720affdd6bfd48
+size 1966
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..d823d5d96998
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f401da10698c1025957c57b8ca5ee359dab0449a78613941e3d9841df595794
+size 568
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..d823d5d96998
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f401da10698c1025957c57b8ca5ee359dab0449a78613941e3d9841df595794
+size 568
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-normals.png
new file mode 100644
index 000000000000..979c2226c8e2
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/newton-ovrtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33cce7fdc53de5e4629ef9a45dc0ce850afeb3fcc0ed10ac2005442641ec5b6f
+size 1941
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..a4626ba44f33
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41ecbb1dbb608dbc9aa4b172fcbff57333a741e36b85ea937930b593eba774c1
+size 588
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..d823d5d96998
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f401da10698c1025957c57b8ca5ee359dab0449a78613941e3d9841df595794
+size 568
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..c1f9ac74ad92
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6d68551c1e2c1deca570da094a0515e700b3a5dcddd324807b228862a09d592e
+size 1940
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-newton_renderer-normals.png
new file mode 100644
index 000000000000..8eb9b708a623
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_hetero/physx-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d1af0e88caf3f25cff399dcab1f8f95a09e2f4890062c5666ca22c009978c16f
+size 1956
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..d87fea10d447
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:084f049a7b700ea75716f77e0c80e307c38f414b5da68be34ebad3c1ebe453a9
+size 551
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..bf4b0e0290dd
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c003b10810539f538464992860c74ee3bf531b8b4e9b6e0ebe84041d42dba643
+size 532
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..e5a5f7909d78
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:011b53a7a713c00dc5e1892285aa4785defe99b2bcbaa7e551dc05b9abe974de
+size 1752
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-newton_renderer-normals.png
new file mode 100644
index 000000000000..9531591c3319
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f3ba7f28c411e39f3094100c03fdd168f48115be28dd882c81a3d193eba50d60
+size 1754
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..bf4b0e0290dd
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c003b10810539f538464992860c74ee3bf531b8b4e9b6e0ebe84041d42dba643
+size 532
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..bf4b0e0290dd
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c003b10810539f538464992860c74ee3bf531b8b4e9b6e0ebe84041d42dba643
+size 532
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-normals.png
new file mode 100644
index 000000000000..e5a5f7909d78
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/newton-ovrtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:011b53a7a713c00dc5e1892285aa4785defe99b2bcbaa7e551dc05b9abe974de
+size 1752
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..d87fea10d447
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:084f049a7b700ea75716f77e0c80e307c38f414b5da68be34ebad3c1ebe453a9
+size 551
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..bf4b0e0290dd
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c003b10810539f538464992860c74ee3bf531b8b4e9b6e0ebe84041d42dba643
+size 532
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..f7e788a96550
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3009f0ef2b7e67bdeeeaef56d1b8bb800bd3159f3782d1c588f227137238f3e3
+size 1754
diff --git a/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-newton_renderer-normals.png
new file mode 100644
index 000000000000..8961b84a3459
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/dexsuite_kuka_homo/physx-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2cf94b13ed7c4246be2b09767d1be41338446bb0e016cdb0ee4534e6275b0e87
+size 1759
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..2b472cbaac9e
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b991b49bc8061c5cb0fa33f4f940547c532919179c7c7fa384b8c6c796dfa949
+size 4039
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..3893ecf7729d
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d249747e56b41ada8e507c138979791ef6f558043eb23c9f65d6826220eac5f1
+size 3752
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..2327fbcd069b
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2d891d4c2e8388e95d7e9afd659e14a35965b2357579b08bfdb965be36f4fd38
+size 10359
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-newton_renderer-normals.png
new file mode 100644
index 000000000000..dfef60e05a58
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e5c94c8085d0f8bbb74418447230b334f5426d5c1400ef3364157d4286dd66b3
+size 10029
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..2b472cbaac9e
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b991b49bc8061c5cb0fa33f4f940547c532919179c7c7fa384b8c6c796dfa949
+size 4039
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..3893ecf7729d
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d249747e56b41ada8e507c138979791ef6f558043eb23c9f65d6826220eac5f1
+size 3752
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-normals.png
new file mode 100644
index 000000000000..b012177673ae
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/newton-ovrtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7792ca32acace98625517017dddad0be21ce30d8373bd7f438f32638649180c2
+size 10434
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-distance_to_camera.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-distance_to_camera.png
new file mode 100644
index 000000000000..0987d3f567ea
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-distance_to_camera.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ace1d37f1fa54bd692808ead80ef19470aa3da2efd4c43d7ef1f3ed1b3155bf7
+size 4025
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-distance_to_image_plane.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
new file mode 100644
index 000000000000..a38beb8f053f
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-distance_to_image_plane.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8ddd7a52ad1de3f636d29d53bb156d04ac222d1318fc9574617712b53d796508
+size 3681
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-normals.png
new file mode 100644
index 000000000000..22caee983dc3
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-isaacsim_rtx_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e4e3743174a4c4bcde9d56b7bf3696fe15e6d5401b846a6c910967b4768bc69a
+size 9152
diff --git a/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-newton_renderer-normals.png b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-newton_renderer-normals.png
new file mode 100644
index 000000000000..0254600c928d
--- /dev/null
+++ b/source/isaaclab_tasks/test/golden_images/shadow_hand/physx-newton_renderer-normals.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7dfc994325bd54c110328a5e79c09eee5cfea3aa2d27ae8e1fd980dcc48b4e2d
+size 9150
diff --git a/source/isaaclab_tasks/test/rendering_test_utils.py b/source/isaaclab_tasks/test/rendering_test_utils.py
index 2e35bc1f0d54..8c186b9d1429 100644
--- a/source/isaaclab_tasks/test/rendering_test_utils.py
+++ b/source/isaaclab_tasks/test/rendering_test_utils.py
@@ -83,6 +83,9 @@
"simple_shading_full_mdl",
"semantic_segmentation",
"depth",
+ "distance_to_camera",
+ "distance_to_image_plane",
+ "normals",
)
@@ -119,6 +122,12 @@ def _make_sensor_data_type_params(
"depth",
id="physx-newton_warp-depth",
),
+ pytest.param(
+ "physx",
+ "newton_renderer",
+ "normals",
+ id="physx-newton_warp-normals",
+ ),
]
KITLESS_PHYSICS_RENDERER_AOV_COMBINATIONS = [
@@ -137,6 +146,12 @@ def _make_sensor_data_type_params(
"depth",
id="ovphysx-newton_warp-depth",
),
+ pytest.param(
+ "ovphysx",
+ "newton_renderer",
+ "normals",
+ id="ovphysx-newton_warp-normals",
+ ),
# newton + newton_renderer (warp)
pytest.param(
"newton",
@@ -150,6 +165,12 @@ def _make_sensor_data_type_params(
"depth",
id="newton-newton_warp-depth",
),
+ pytest.param(
+ "newton",
+ "newton_renderer",
+ "normals",
+ id="newton-newton_warp-normals",
+ ),
]
@@ -227,6 +248,8 @@ def _normalize_tensor(tensor: torch.Tensor, data_type: str) -> torch.Tensor:
normalized = normalized / max_val
elif data_type in {"albedo"}:
normalized = normalized[..., :3] / 255.0
+ elif data_type in {"normals"}:
+ normalized = (normalized + 1.0) * 0.5
else:
normalized = normalized / 255.0
@@ -548,7 +571,7 @@ def validate_camera_outputs(
tensor = output if isinstance(output, torch.Tensor) else output.torch
condition = torch.logical_or(torch.isinf(tensor), torch.isnan(tensor))
corrected = torch.where(condition, torch.zeros_like(tensor), tensor)
- max_val = corrected.max()
+ max_val = corrected.abs().max()
if max_val <= 0:
failed_data_types[data_type] = f"Camera output '{data_type}' has no non-zero pixels."
continue
@@ -621,12 +644,28 @@ def rendering_test_shadow_hand(
if physics_backend == "ovphysx":
pytest.skip("ovphysx is not supported yet.")
+ from isaaclab.utils.configclass import configclass
+
from isaaclab_tasks.core.reorient.config.shadow_hand.shadow_hand_camera_env import ShadowHandCameraEnv
- from isaaclab_tasks.core.reorient.config.shadow_hand.shadow_hand_camera_env_cfg import ShadowHandCameraEnvCfg
+ from isaaclab_tasks.core.reorient.config.shadow_hand.shadow_hand_camera_env_cfg import (
+ ShadowHandCameraEnvCfg,
+ ShadowHandTiledCameraCfg,
+ _ShadowHandBaseTiledCameraCfg,
+ )
+
+ @configclass
+ class _ShadowHandTiledCameraTestCfg(ShadowHandTiledCameraCfg):
+ distance_to_camera = _ShadowHandBaseTiledCameraCfg(data_types=["distance_to_camera"])
+ distance_to_image_plane = _ShadowHandBaseTiledCameraCfg(data_types=["distance_to_image_plane"])
+ normals = _ShadowHandBaseTiledCameraCfg(data_types=["normals"])
+
+ @configclass
+ class _ShadowHandCameraTestEnvCfg(ShadowHandCameraEnvCfg):
+ tiled_camera = _ShadowHandTiledCameraTestCfg()
override_args = [f"presets={_physics_preset_name(physics_backend)},{renderer},{data_type}"]
- env_cfg = ShadowHandCameraEnvCfg()
+ env_cfg = _ShadowHandCameraTestEnvCfg()
env_cfg = _apply_overrides_to_env_cfg(env_cfg, override_args)
env_cfg.scene.num_envs = 4
@@ -634,7 +673,7 @@ def rendering_test_shadow_hand(
if renderer == "ovrtx_renderer":
_redirect_ovrtx_renderer_log_to_stdout(env_cfg)
- if data_type == "depth":
+ if data_type in {"depth", "distance_to_camera", "distance_to_image_plane"}:
# Disable CNN forward pass as it cannot be meaningfully trained from depth alone and will raise a ValueError.
env_cfg.feature_extractor.enabled = False
@@ -667,10 +706,32 @@ def rendering_test_cartpole(
data_type: str,
comparison_scores: list[dict],
) -> None:
+ from isaaclab.utils.configclass import configclass
+
from isaaclab_tasks.core.cartpole.cartpole_direct_camera_env import CartpoleCameraEnv
- from isaaclab_tasks.core.cartpole.cartpole_direct_camera_env_cfg import CartpoleCameraEnvCfg
+ from isaaclab_tasks.core.cartpole.cartpole_direct_camera_env_cfg import CartpoleCameraEnvCfg, CartpoleTiledCameraCfg
+
+ @configclass
+ class _CartpoleTiledCameraTestCfg(CartpoleTiledCameraCfg):
+ distance_to_camera = CartpoleTiledCameraCfg.BaseCartpoleTiledCameraCfg(data_types=["distance_to_camera"])
+ distance_to_image_plane = CartpoleTiledCameraCfg.BaseCartpoleTiledCameraCfg(
+ data_types=["distance_to_image_plane"]
+ )
+ normals = CartpoleTiledCameraCfg.BaseCartpoleTiledCameraCfg(data_types=["normals"])
+
+ @configclass
+ class _CartpoleCameraTestEnvCfg(CartpoleCameraEnvCfg):
+ distance_to_camera = CartpoleCameraEnvCfg.BaseCartpoleCameraEnvCfg(
+ observation_space=[1, 100, 100], tiled_camera=_CartpoleTiledCameraTestCfg()
+ )
+ distance_to_image_plane = CartpoleCameraEnvCfg.BaseCartpoleCameraEnvCfg(
+ observation_space=[1, 100, 100], tiled_camera=_CartpoleTiledCameraTestCfg()
+ )
+ normals = CartpoleCameraEnvCfg.BaseCartpoleCameraEnvCfg(
+ observation_space=[3, 100, 100], tiled_camera=_CartpoleTiledCameraTestCfg()
+ )
- env_cfg = CartpoleCameraEnvCfg()
+ env_cfg = _CartpoleCameraTestEnvCfg()
env_cfg = _apply_overrides_to_env_cfg(
env_cfg, [f"presets={_physics_preset_name(physics_backend)},{renderer},{data_type}"]
)
@@ -713,10 +774,50 @@ def rendering_test_dexsuite_kuka(
pytest.skip("ovphysx is not supported yet.")
from isaaclab.envs import ManagerBasedRLEnv
+ from isaaclab.sensors import CameraCfg
+ from isaaclab.utils.configclass import configclass
+ from isaaclab_tasks.core.dexsuite.config.kuka_allegro.camera_cfg import (
+ BASE_CAMERA_CFG,
+ BaseTiledCameraCfg,
+ SingleCameraObservationsCfg,
+ )
from isaaclab_tasks.core.dexsuite.config.kuka_allegro.dexsuite_kuka_allegro_camera_env_cfg import (
+ _SCENE_KWARGS,
DexsuiteKukaAllegroLiftCameraEnvCfg,
+ SingleCameraSceneCfg,
)
+ from isaaclab_tasks.core.dexsuite.config.kuka_allegro.dexsuite_kuka_allegro_env_cfg import (
+ DexsuiteKukaAllegroLiftEnvCfg,
+ )
+
+ @configclass
+ class _DexsuiteBaseTiledCameraTestCfg(BaseTiledCameraCfg):
+ distance_to_camera64 = BASE_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=64, height=64)
+ distance_to_camera128 = BASE_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=128, height=128)
+ distance_to_camera256 = BASE_CAMERA_CFG.replace(data_types=["distance_to_camera"], width=256, height=256)
+ distance_to_image_plane64 = BASE_CAMERA_CFG.replace(data_types=["distance_to_image_plane"], width=64, height=64)
+ distance_to_image_plane128 = BASE_CAMERA_CFG.replace(
+ data_types=["distance_to_image_plane"], width=128, height=128
+ )
+ distance_to_image_plane256 = BASE_CAMERA_CFG.replace(
+ data_types=["distance_to_image_plane"], width=256, height=256
+ )
+ normals64 = BASE_CAMERA_CFG.replace(data_types=["normals"], width=64, height=64)
+ normals128 = BASE_CAMERA_CFG.replace(data_types=["normals"], width=128, height=128)
+ normals256 = BASE_CAMERA_CFG.replace(data_types=["normals"], width=256, height=256)
+
+ @configclass
+ class _DexsuiteSingleCameraTestSceneCfg(SingleCameraSceneCfg):
+ base_camera: CameraCfg = _DexsuiteBaseTiledCameraTestCfg()
+
+ @configclass
+ class _DexsuiteKukaAllegroLiftCameraTestEnvCfg(DexsuiteKukaAllegroLiftCameraEnvCfg):
+ single_camera = DexsuiteKukaAllegroLiftEnvCfg(
+ scene=_DexsuiteSingleCameraTestSceneCfg(**_SCENE_KWARGS),
+ observations=SingleCameraObservationsCfg(),
+ )
+ default = single_camera
override_arg = f"presets={_physics_preset_name(physics_backend)},{renderer},{data_type}64,single_camera"
@@ -725,7 +826,7 @@ def rendering_test_dexsuite_kuka(
if setup_homogeneous_envs:
override_arg += ",cube"
- env_cfg = DexsuiteKukaAllegroLiftCameraEnvCfg()
+ env_cfg = _DexsuiteKukaAllegroLiftCameraTestEnvCfg()
env_cfg = _apply_overrides_to_env_cfg(env_cfg, [override_arg])
env_cfg.scene.num_envs = 4
diff --git a/source/isaaclab_visualizers/config/extension.toml b/source/isaaclab_visualizers/config/extension.toml
index e02c29a67cad..9ae35ecda750 100644
--- a/source/isaaclab_visualizers/config/extension.toml
+++ b/source/isaaclab_visualizers/config/extension.toml
@@ -1,7 +1,7 @@
[package]
# Semantic Versioning is used: https://semver.org/
-version = "1.0.1"
+version = "1.0.3"
# Description
category = "isaaclab"
diff --git a/source/isaaclab_visualizers/docs/CHANGELOG.rst b/source/isaaclab_visualizers/docs/CHANGELOG.rst
index cd4c8d8a6410..7b673de95fc0 100644
--- a/source/isaaclab_visualizers/docs/CHANGELOG.rst
+++ b/source/isaaclab_visualizers/docs/CHANGELOG.rst
@@ -1,6 +1,30 @@
Changelog
---------
+1.0.3 (2026-06-25)
+~~~~~~~~~~~~~~~~~~
+
+Changed
+^^^^^^^
+
+* Changed :class:`~isaaclab_visualizers.kit.KitVisualizer` to skip authoring the
+ ``omni:scenePartition`` attribute on the viewport camera by default. Set
+ ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1`` to re-enable per-environment
+ scene partitioning for the Kit viewport camera.
+
+
+1.0.2 (2026-06-24)
+~~~~~~~~~~~~~~~~~~
+
+Fixed
+^^^^^
+
+* Fixed the visualizer extras' ``newton[sim]`` dependency pin to use Newton
+ commit ``79e95bf5571d70a0a46c8eaedc80644531d27368``, including the
+ RenderContext triangle-mesh construction fix from `newton-physics/newton#3199
+ `_.
+
+
1.0.1 (2026-06-14)
~~~~~~~~~~~~~~~~~~
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index 1f8bec44fbc4..4aa0d40892d0 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -30,6 +30,7 @@
resolve_tiled_env_indices,
)
from isaaclab.utils.math import create_rotation_matrix_from_view, quat_from_matrix
+from isaaclab.utils.renderers import isaac_rtx_per_env_scene_partition_enabled
from isaaclab.visualizers.base_visualizer import BaseVisualizer
from isaaclab_visualizers.newton_adapter import resolve_visible_env_indices
@@ -513,9 +514,25 @@ def _apply_viewport_camera_scene_partition(self, usd_stage: Usd.Stage, num_envs:
``omni:scenePartition`` token. Interactive viewport cameras live outside
``/World/envs`` and are created by Kit, so they do not inherit the env-root
primvar authored by :class:`~isaaclab.scene.InteractiveScene`.
+
+ This method is a no-op unless ``ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1``,
+ matching the opt-in behaviour of
+ :meth:`~isaaclab_physx.renderers.IsaacRtxRenderer.prepare_stage`.
"""
+
+ if not isaac_rtx_per_env_scene_partition_enabled():
+ return
+
if num_envs <= 0 or self._controlled_camera_path is None:
return
+
+ logger.debug(
+ "[KitVisualizer] Per-environment Isaac RTX scene partitioning is enabled"
+ " (ISAAC_LAB_ENABLE_ISAAC_RTX_PER_ENV_SCENE_PARTITION=1)."
+ " Authoring omni:scenePartition attribute onto viewport camera '%s'.",
+ self._controlled_camera_path,
+ )
+
env_id = self._resolved_visible_env_ids[0] if self._resolved_visible_env_ids else 0
camera_prim = usd_stage.GetPrimAtPath(self._controlled_camera_path)
if not camera_prim.IsValid() or not camera_prim.IsA(UsdGeom.Camera):
diff --git a/source/isaaclab_visualizers/pyproject.toml b/source/isaaclab_visualizers/pyproject.toml
index 9b0aeefcf3e7..3f632d689f04 100644
--- a/source/isaaclab_visualizers/pyproject.toml
+++ b/source/isaaclab_visualizers/pyproject.toml
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "isaaclab-visualizers"
-version = "1.0.1"
+version = "1.0.3"
description = "Visualizer backends for Isaac Lab (Kit, Newton, Rerun, Viser)."
license = {text = "BSD-3-Clause"}
authors = [{name = "Isaac Lab Project Developers"}]
@@ -29,24 +29,24 @@ Repository = "https://github.com/isaac-sim/IsaacLab"
kit = []
newton = [
"warp-lang",
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
"PyOpenGL-accelerate",
"pyglet>=2.1.6,<3",
"imgui-bundle>=1.92.5",
"typing-extensions>=4.15.0",
]
rerun = [
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
"rerun-sdk>=0.29.0",
"pyarrow==22.0.0",
]
viser = [
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
"viser>=1.0.16",
]
all = [
"imgui-bundle>=1.92.5",
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
"PyOpenGL-accelerate",
"pyglet>=2.1.6,<3",
# Match rerun-sdk's supported Arrow stack and avoid resolver drift across environments.
diff --git a/tools/conftest.py b/tools/conftest.py
index a45f8cd9183c..6052ca05b25b 100644
--- a/tools/conftest.py
+++ b/tools/conftest.py
@@ -13,6 +13,7 @@
from dataclasses import dataclass
import pytest
+import tomllib
from junitparser import Error, JUnitXml, TestCase, TestSuite
from prettytable import PrettyTable
@@ -424,6 +425,7 @@ class _PassContext:
timeout: int
startup_deadline: int
env: dict
+ pytest_targets: list[str]
_RESULT_PRIORITY = {
@@ -498,7 +500,7 @@ def _run_one_pass(
cmd += ["-m", "isaacsim_ci"]
if k_expr is not None:
cmd += ["-k", k_expr]
- cmd.append(str(ctx.test_file))
+ cmd += ctx.pytest_targets
# -- Run with retry on startup hang or hard timeout -----------------
returncode, stdout_data, stderr_data, kill_reason = -1, b"", b"", ""
@@ -729,12 +731,13 @@ def _run_one_pass(
)
-def run_individual_tests(test_files, workspace_root, isaacsim_ci):
+def run_individual_tests(test_files, workspace_root, isaacsim_ci, test_node_ids_by_file=None):
"""Run each test file separately, ensuring one finishes before starting the next."""
failed_tests = []
test_status = {}
xml_reports = []
cold_cache_applied = False
+ test_node_ids_by_file = test_node_ids_by_file or {}
for test_file in test_files:
print(f"\n\n🚀 Running {test_file} independently...\n")
@@ -762,6 +765,8 @@ def run_individual_tests(test_files, workspace_root, isaacsim_ci):
extra = COLD_CACHE_BUFFER if is_cold_cache_test else 0
startup_deadline = min(timeout, STARTUP_DEADLINE + extra)
+ pytest_targets = test_node_ids_by_file.get(os.path.normpath(test_file), [str(test_file)])
+
ctx = _PassContext(
test_file=test_file,
file_name=file_name,
@@ -770,6 +775,7 @@ def run_individual_tests(test_files, workspace_root, isaacsim_ci):
timeout=timeout,
startup_deadline=startup_deadline,
env=env,
+ pytest_targets=pytest_targets,
)
if is_device_split_file(test_file, source=test_content):
@@ -865,6 +871,60 @@ def _collect_test_files(
return test_files
+def _load_test_node_ids_from_toml(workspace_root: str) -> list[str]:
+ """Load exact pytest node IDs from a TOML file configured in the environment."""
+ node_ids_file = os.environ.get("TEST_NODE_IDS_FILE")
+ node_ids_key = os.environ.get("TEST_NODE_IDS_KEY")
+ if not (node_ids_file or node_ids_key):
+ return []
+ if not (node_ids_file and node_ids_key):
+ pytest.exit("Both TEST_NODE_IDS_FILE and TEST_NODE_IDS_KEY must be set together", returncode=1)
+
+ path = node_ids_file if os.path.isabs(node_ids_file) else os.path.join(workspace_root, node_ids_file)
+
+ try:
+ with open(os.path.normpath(path), "rb") as stream:
+ node_ids = tomllib.load(stream).get(node_ids_key)
+ except OSError as exc:
+ pytest.exit(f"Could not read TEST_NODE_IDS_FILE {node_ids_file!r}: {exc}", returncode=1)
+ except tomllib.TOMLDecodeError as exc:
+ pytest.exit(f"{node_ids_file}: invalid TOML: {exc}", returncode=1)
+
+ if not node_ids:
+ pytest.exit(f"{node_ids_key!r} not found or empty in {node_ids_file}", returncode=1)
+ if not isinstance(node_ids, list) or not all(isinstance(node_id, str) for node_id in node_ids):
+ pytest.exit(f"{node_ids_key!r} must be a TOML array of strings in {node_ids_file}", returncode=1)
+
+ return node_ids
+
+
+def _collect_test_node_ids_by_file(workspace_root: str) -> dict[str, list[str]]:
+ """Group exact pytest node IDs by absolute test file path."""
+ node_ids = [line.strip() for line in os.environ.get("TEST_NODE_IDS", "").splitlines() if line.strip()]
+ node_ids.extend(_load_test_node_ids_from_toml(workspace_root))
+ if len(node_ids) != len(set(node_ids)):
+ pytest.exit("Configured test node IDs contain duplicates", returncode=1)
+
+ grouped: dict[str, list[str]] = {}
+ for node_id in node_ids:
+ normalized_node_id = node_id.replace("\\", "/")
+ if "::" not in normalized_node_id:
+ pytest.exit(f"Configured test node ID must include '::': {node_id}", returncode=1)
+
+ file_part, test_part = normalized_node_id.split("::", 1)
+ if os.path.isabs(file_part):
+ abs_file = os.path.normpath(file_part)
+ else:
+ abs_file = os.path.normpath(os.path.join(workspace_root, file_part))
+
+ if not os.path.exists(abs_file):
+ pytest.exit(f"Configured test node ID file does not exist: {node_id}", returncode=1)
+
+ grouped.setdefault(abs_file, []).append(f"{normalized_node_id.split('::', 1)[0]}::{test_part}")
+
+ return grouped
+
+
def _write_empty_report():
"""Write an empty JUnit XML report so downstream CI steps find a valid file."""
os.makedirs("tests", exist_ok=True)
@@ -892,6 +952,8 @@ def pytest_sessionstart(session):
isaacsim_ci = os.environ.get("ISAACSIM_CI_SHORT", "false") == "true"
+ test_node_ids_by_file = _collect_test_node_ids_by_file(workspace_root)
+
# Parse include files list (comma-separated paths)
include_files = set()
if include_files_str:
@@ -899,6 +961,7 @@ def pytest_sessionstart(session):
f = f.strip()
if f:
include_files.add(os.path.basename(f))
+ include_files.update(os.path.basename(path) for path in test_node_ids_by_file)
# Also try to get from pytest config
if hasattr(session.config, "option") and hasattr(session.config.option, "filter_pattern"):
@@ -912,11 +975,15 @@ def pytest_sessionstart(session):
print(f"Filter pattern: '{filter_pattern}'")
print(f"Exclude pattern: '{exclude_pattern}'")
print(f"Include files: {include_files if include_files else 'none'}")
+ print(f"Test node IDs: {sum(len(node_ids) for node_ids in test_node_ids_by_file.values())}")
print(f"Quarantined-only mode: {quarantined_only}")
print(f"Curobo-only mode: {curobo_only}")
print(f"TEST_FILTER_PATTERN env var: '{os.environ.get('TEST_FILTER_PATTERN', 'NOT_SET')}'")
print(f"TEST_EXCLUDE_PATTERN env var: '{os.environ.get('TEST_EXCLUDE_PATTERN', 'NOT_SET')}'")
print(f"TEST_INCLUDE_FILES env var: '{os.environ.get('TEST_INCLUDE_FILES', 'NOT_SET')}'")
+ print(f"TEST_NODE_IDS env var: '{'SET' if os.environ.get('TEST_NODE_IDS') else 'NOT_SET'}'")
+ print(f"TEST_NODE_IDS_FILE env var: '{os.environ.get('TEST_NODE_IDS_FILE', 'NOT_SET')}'")
+ print(f"TEST_NODE_IDS_KEY env var: '{os.environ.get('TEST_NODE_IDS_KEY', 'NOT_SET')}'")
print(f"TEST_QUARANTINED_ONLY env var: '{os.environ.get('TEST_QUARANTINED_ONLY', 'NOT_SET')}'")
print(f"TEST_CUROBO_ONLY env var: '{os.environ.get('TEST_CUROBO_ONLY', 'NOT_SET')}'")
print("=" * 50)
@@ -939,6 +1006,13 @@ def pytest_sessionstart(session):
new_test_files.append(test_file)
test_files = new_test_files
+ if test_node_ids_by_file:
+ configured_files = set(test_node_ids_by_file)
+ test_files = [test_file for test_file in test_files if os.path.normpath(test_file) in configured_files]
+ missing_files = sorted(configured_files - {os.path.normpath(test_file) for test_file in test_files})
+ if missing_files:
+ pytest.exit(f"Configured test node ID files were not collected: {missing_files}", returncode=1)
+
if not test_files:
if quarantined_only:
print("No quarantined tests configured — nothing to run.")
@@ -954,9 +1028,14 @@ def pytest_sessionstart(session):
print(f"Found {len(test_files)} test files after filtering:")
for test_file in test_files:
print(f" - {test_file}")
+ if test_node_ids_by_file:
+ for node_id in test_node_ids_by_file[os.path.normpath(test_file)]:
+ print(f" {node_id}")
# Run all tests individually
- failed_tests, test_status, xml_reports = run_individual_tests(test_files, workspace_root, isaacsim_ci)
+ failed_tests, test_status, xml_reports = run_individual_tests(
+ test_files, workspace_root, isaacsim_ci, test_node_ids_by_file
+ )
print("failed tests:", failed_tests)
diff --git a/tools/wheel_builder/res/python_packages.toml b/tools/wheel_builder/res/python_packages.toml
index db104ce02f0c..31ed61750590 100644
--- a/tools/wheel_builder/res/python_packages.toml
+++ b/tools/wheel_builder/res/python_packages.toml
@@ -88,7 +88,7 @@ pyproject.optional-dependencies.all = [
# ================================================================================
{ "newton" = [
"warp-lang==1.14.0",
- "newton[sim] @ git+https://github.com/newton-physics/newton.git@811968bfb7cc7ff4e37b9260a2ba56930a3e605e",
+ "newton[sim] @ git+https://github.com/newton-physics/newton.git@79e95bf5571d70a0a46c8eaedc80644531d27368",
"PyOpenGL-accelerate==3.1.10"
] },
# ================================================================================
@@ -97,12 +97,6 @@ pyproject.optional-dependencies.all = [
# RL libraries
{ "sb3" = ["stable-baselines3>=2.6", "tqdm", "rich"] },
{ "skrl" = ["skrl>=2.1.0"] },
- # Do not pin aiohttp here: isaacsim-kernel==6.0.0.0 pins aiohttp==3.12.14.
- { "rl-games" = [
- "rl-games @ git+https://github.com/isaac-sim/rl_games.git@python3.11",
- "gym",
- "standard-distutils",
- ] },
{ "rsl-rl" = ["rsl-rl-lib==5.0.1", "onnxscript>=0.5"] },
{ "rsl_rl" = ["rsl-rl-lib==5.0.1", "onnxscript>=0.5"] },
# ================================================================================
@@ -118,9 +112,6 @@ pyproject.optional-dependencies.all = [
"tqdm",
"rich",
"skrl>=2.1.0",
- "rl-games @ git+https://github.com/isaac-sim/rl_games.git@python3.11",
- "gym",
- "standard-distutils",
"rsl-rl-lib==5.0.1",
"onnxscript>=0.5",
] },