Skip to content

Commit e752af0

Browse files
author
Horde
committed
Fix startswith path bug; add USD->Newton and test cleanup
- Fix _scope_custom_frequencies: use root_path.rstrip("/")+"/": prefix instead of bare startswith(root_path) to prevent sibling paths like /robot_a_v2/tendon from falsely matching a filter scoped to /robot_a - Add TestUsdTendonParsing: real in-memory USD stage with MjcTendon prim, verifies stiffness authored in USD lands in proto builder (no Isaac Sim required), and that plain builder without register_custom_attributes picks up no tendon data - Add test_filter_rejects_sibling_path_prefix_match covering the bug above - Trim test suite from 24 to 12: remove Newton-API-only tests (TestMainBuilderHasNoMjcFrequencies, TestProtoBuilderHasMjcFrequencies, importable/instantiable import checks) and redundant coverage (single_world, span_all_worlds, newton_filter, plain_builder, both_frequencies_patched, noop_on_plain, heterogeneous_plan)
1 parent 2bfb5b7 commit e752af0

2 files changed

Lines changed: 158 additions & 282 deletions

File tree

source/isaaclab_newton/isaaclab_newton/cloner/newton_replicate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ def _scope_custom_frequencies(builder: ModelBuilder, root_path: str) -> None:
4343
if freq.usd_prim_filter is None:
4444
continue
4545
orig = freq.usd_prim_filter
46-
freq.usd_prim_filter = lambda prim, ctx, _orig=orig, _path=root_path: (
47-
str(prim.GetPath()).startswith(_path) and _orig(prim, ctx)
46+
_prefix = root_path.rstrip("/") + "/"
47+
freq.usd_prim_filter = lambda prim, ctx, _orig=orig, _prefix=_prefix: (
48+
str(prim.GetPath()).startswith(_prefix) and _orig(prim, ctx)
4849
)
4950

5051

0 commit comments

Comments
 (0)