Skip to content

Add naming-semantics tests for URDF assembly; fix name_case propagation bug#203

Draft
Copilot wants to merge 2 commits intocjt/modify_urdf_assemblyfrom
copilot/sub-pr-202
Draft

Add naming-semantics tests for URDF assembly; fix name_case propagation bug#203
Copilot wants to merge 2 commits intocjt/modify_urdf_assemblyfrom
copilot/sub-pr-202

Conversation

Copy link
Contributor

Copilot AI commented Mar 26, 2026

component_prefix patching and name_case policy changes in the URDF assembly manager had no test coverage, and a bug caused name_case updates to never actually reach URDFComponentManager._name_case.

Bug fix — URDFComponentManager missing name_case property setter

URDFAssemblyManager.name_case setter called self.component_manager.name_case = ..., but URDFComponentManager had no property setter, so Python silently created a dangling instance attribute while _name_case remained unchanged. Added a proper getter/setter to URDFComponentManager:

# Before: setting name_case on the assembly manager had no effect on
# URDFComponentManager._name_case — links/joints were still cased with
# the original defaults regardless of the policy set.

manager = URDFAssemblyManager()
manager.name_case = {"joint": "lower", "link": "upper"}
assert manager.component_manager._name_case == {"joint": "lower", "link": "upper"}
# ^^^ AssertionError before fix

The new setter mirrors the constructor's lenient-validation strategy (warn + ignore invalid entries) and documents the intentional divergence from URDFAssemblyManager.name_case which raises ValueError.

New tests — tests/toolkits/test_urdf_assembly_naming.py

21 tests using minimal inline URDF fixtures across four focused test classes:

Class What it covers
TestUnknownComponentKeyRaises Unknown/non-string component keys and non-list inputs raise ValueError
TestComponentPrefixPreservesOrder Patch-style prefix updates don't reorder; cumulative patches work; unpatched components keep original prefixes
TestNameCaseAffectsNames upper/lower/none modes applied to link and joint names; setter validation; policy propagation to URDFComponentManager
TestSignatureChangesWithNamingSettings Changing component_prefix or name_case produces a distinct assembly signature (cache invalidation)

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

…_case propagation bug

Co-authored-by: chase6305 <61959467+chase6305@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DexForce/EmbodiChain/sessions/005bec75-52f9-49bc-a9ff-5ff8cedd862b
Copilot AI changed the title [WIP] [WIP] Address feedback on URDF assembly component prefixes and name casing policy Add naming-semantics tests for URDF assembly; fix name_case propagation bug Mar 26, 2026
Copilot AI requested a review from chase6305 March 26, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants