Skip to content

Update MJCF converter to support scene import, update urdf cfg - #4826

Merged
ooctipus merged 3 commits into
isaac-sim:developfrom
stevfeng:dev/stevfeng/update_urdf_importer
Mar 6, 2026
Merged

ooctipus merged 3 commits into
isaac-sim:developfrom
stevfeng:dev/stevfeng/update_urdf_importer

Conversation

@stevfeng

@stevfeng stevfeng commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Mar 5, 2026
@stevfeng stevfeng changed the title update urdf converter to match Isaac Sim 3, update mjcf converter cfg update urdf converter to match Isaac Sim URDF/MJCF 3.x, update mjcf converter cfg Mar 5, 2026
@stevfeng stevfeng changed the title update urdf converter to match Isaac Sim URDF/MJCF 3.x, update mjcf converter cfg Draft: update urdf converter to match Isaac Sim URDF/MJCF 3.x, update mjcf converter cfg Mar 5, 2026
@greptile-apps

greptile-apps Bot commented Mar 5, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the URDF and MJCF converters to work with Isaac Sim 3 by replacing the old multi-step pipeline (urdf-usd-converter → intermediate USD → asset transformer) with a single call to the new URDFImporter.import_urdf() API, and aligns collision type strings to title-case values expected by the new importer.

Key changes:

  • urdf_converter.py: Removes the six-step conversion pipeline and replaces it with a direct call to URDFImporter(config).import_urdf(). The extension manager setup is also removed. The _fix_articulation_root_for_fixed_base post-processing step is retained.
  • urdf_converter_cfg.py: Renames collider_type → collision_type, updates literal values from "convex_hull"/"convex_decomposition" to "Convex Hull"/"Convex Decomposition", and adds a new merge_mesh field.
  • mjcf_converter_cfg.py: Updates the collision_type default from "default" to "Convex Hull" and removes the now-unsupported "default" value.

Issues found:

  • _apply_fix_base, _apply_link_density, and _apply_joint_drives are no longer called in _convert_asset. The corresponding config fields (fix_base joint creation, link_density, joint_drive) are not forwarded to URDFImporterConfig, meaning these features will be silently ignored at runtime. If the new importer handles them natively, these methods and config fields should be deprecated; if not, the calls need to be restored.
  • The collider_type → collision_type rename is a silent breaking change for users with existing configs — no deprecation shim or migration notice is provided.
  • The _convert_asset docstring still describes the old intermediate-stage post-processing pipeline.

Confidence Score: 2/5

  • Not safe to merge until the fate of fix_base joint creation, link_density, and joint_drive application is explicitly resolved.
  • The core conversion pipeline simplification looks correct, but three established config features (fix_base world-joint creation, link_density, joint_drive) are no longer applied without any deprecation warning or documentation. Users who rely on these features — which are still present as config fields — will experience silent regressions. Additionally, the collider_type rename is a silent breaking change.
  • source/isaaclab/isaaclab/sim/converters/urdf_converter.py and source/isaaclab/isaaclab/sim/converters/urdf_converter_cfg.py need the closest attention.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/sim/converters/urdf_converter.py Major pipeline refactor switching from the multi-step urdf-usd-converter+asset-transformer approach to URDFImporter.import_urdf() directly; however, fix_base joint creation, link_density, and joint_drive are no longer forwarded to the importer or applied manually, leaving those config fields silently inert. Docstring is also stale.
source/isaaclab/isaaclab/sim/converters/urdf_converter_cfg.py Renames collider_type → collision_type and updates literal values to title-case strings to match Isaac Sim 3; adds merge_mesh field. The rename is a silent breaking change for existing users, and the docstring still references the old default string "convex_hull".
source/isaaclab/isaaclab/sim/converters/mjcf_converter_cfg.py Updates default collision_type from "default" to "Convex Hull" and removes "default" from supported values to match the new Isaac Sim 3 MJCF importer API. Straightforward change with low risk.
CONTRIBUTORS.md Adds "Ji Yuan Feng" to the contributors list in alphabetical order. No issues.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[UrdfConverter.__init__] --> B[Set usd_file_name from robot stem]
    B --> C[AssetConverterBase.__init__]
    C --> D{USD cached?}
    D -- Yes --> E[Return cached USD]
    D -- No --> F[_convert_asset]

    F --> G[_warn_unsupported_features]
    G --> H{merge_fixed_joints?}
    H -- Yes --> I[XML pre-process: merge fixed joints]
    H -- No --> J[Clean output_subdir if exists]
    I --> J
    J --> K["Build URDFImporterConfig\nurdf_path, usd_path, merge_mesh,\ncollision_from_visuals, collision_type,\nallow_self_collision"]
    K --> L["URDFImporter.import_urdf()"]
    L --> M{fix_base?}
    M -- Yes --> N["_fix_articulation_root_for_fixed_base\nmove ArticulationRootAPI to parent prim"]
    M -- No --> O[Cleanup temp merged URDF]
    N --> O

    P["fix_base world joint\nlink_density\njoint_drive"] -. "NOT forwarded" .-> K
    style P fill:#fcc,stroke:#c33
Loading

Last reviewed commit: cc0b14a

Comments Outside Diff (1)

  1. undefined, line undefined (link)

    Stale docstring after refactor

    The _convert_asset docstring still describes the old multi-step pipeline ("inserting IsaacLab-specific post-processing (fix base, joint drives, link density) on the intermediate stage before the asset transformer restructures the output"), but the new implementation delegates directly to URDFImporter.import_urdf() without any intermediate stage post-processing. The docstring should be updated to reflect the new approach.

Comment on lines +120 to +139
importer_config = URDFImporterConfig(
urdf_path=urdf_path,
usd_path=usd_path,
merge_mesh=cfg.merge_mesh,
collision_from_visuals=cfg.collision_from_visuals,
collision_type=cfg.collision_type,
allow_self_collision=cfg.self_collision,
)

importer_utils.run_asset_transformer_profile(
input_stage_path=intermediate_path,
output_package_root=os.path.normpath(os.path.join(usd_path, robot_name)),
profile_json_path=asset_structure_profile_json_path,
)
importer = URDFImporter(importer_config)
usd_path = importer.import_urdf()

# step 6b: fix ArticulationRootAPI placement for fixed-base articulations.
# fix ArticulationRootAPI placement for fixed-base articulations.
# After the asset transformer, ArticulationRootAPI ends up on the root rigid body.
# Having a FixedJoint on the same rigid body that has ArticulationRootAPI causes
# PhysX to treat the articulation as a floating-base + constraint (maximal coordinate
# tree) rather than a fixed-base reduced-coordinate articulation.
# Moving ArticulationRootAPI to the parent of the root rigid body resolves this.
if cfg.fix_base:
final_usd_path = os.path.join(usd_path, robot_name, f"{robot_name}.usda")
self._fix_articulation_root_for_fixed_base(final_usd_path)

# step 7: clean up intermediate files
if os.path.exists(usdex_path):
shutil.rmtree(usdex_path)
temp_dir = os.path.dirname(intermediate_path)
if os.path.exists(temp_dir):
shutil.rmtree(temp_dir)
self._fix_articulation_root_for_fixed_base(usd_path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix_base, link_density, and joint_drive config fields silently ignored

The new URDFImporterConfig construction does not forward three important config parameters:

  • cfg.fix_base — the _apply_fix_base static method (which creates the fixed world joint) is no longer called. Only _fix_articulation_root_for_fixed_base runs, which moves ArticulationRootAPI — but if no fixed joint to the world exists, this post-processing step has no meaningful effect.
  • cfg.link_density — _apply_link_density is never called, so density values will be silently ignored.
  • cfg.joint_drive — _apply_joint_drives is never called, so all joint drive configuration (type, target, gains) will be silently ignored.

These methods still exist in the class as dead code. If the new URDFImporter handles these features natively, the corresponding config fields and static methods should be deprecated and removed. If not, they should still be applied after importer.import_urdf(), the same way _fix_articulation_root_for_fixed_base is. Either way this should be explicitly addressed to avoid silent behavior regressions for users who rely on link_density > 0 or joint_drive settings.

@@ -134,13 +134,13 @@ class NaturalFrequencyGainsCfg:
collision_from_visuals = False
"""Whether to create collision geometry from visual geometry. Defaults to False."""

collider_type: Literal["convex_hull", "convex_decomposition"] = "convex_hull"
collision_type: Literal["Convex Hull", "Convex Decomposition"] = "Convex Hull"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking rename without deprecation path

collider_type was renamed to collision_type (and the value literals changed from "convex_hull" / "convex_decomposition" to "Convex Hull" / "Convex Decomposition"). Any existing user config that sets collider_type="convex_hull" or collider_type="convex_decomposition" will silently stop working. The PR description marks this as a breaking change, but there is no deprecation warning or migration notice in the docstring or changelog entry visible in this diff. Consider adding a deprecation shim (e.g., __post_init__ or a @property) or at minimum updating the changelog and class docstring to make the migration path explicit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collider_type is a new term introduced in the develop branch recently, so renaming it is fine. Also this will align with the arg used in mjcf converter cfg and isaac sim urdf / mjcf importers

@stevfeng
stevfeng requested a review from ooctipus March 5, 2026 03:16

@ooctipus ooctipus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@stevfeng
stevfeng force-pushed the dev/stevfeng/update_urdf_importer branch from 43e12bd to 623c76f Compare March 6, 2026 20:01
@stevfeng stevfeng changed the title Draft: update urdf converter to match Isaac Sim URDF/MJCF 3.x, update mjcf converter cfg Update MJCF converter to support scene import, update urdf cfg Mar 6, 2026
@ooctipus
ooctipus merged commit 84d5716 into isaac-sim:develop Mar 6, 2026
4 of 6 checks passed
@ooctipus

ooctipus commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

I asked for default on False for import-physics-scene parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants