Skip to content

Updates urdf converter - #4864

Merged
kellyguo11 merged 2 commits into
isaac-sim:developfrom
stevfeng:dev/stevfeng/fix_urdf_importer
Mar 7, 2026
Merged

kellyguo11 merged 2 commits into
isaac-sim:developfrom
stevfeng:dev/stevfeng/fix_urdf_importer

Conversation

@stevfeng

@stevfeng stevfeng commented Mar 7, 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 bug Something isn't working isaac-lab Related to Isaac Lab team labels Mar 7, 2026
@stevfeng stevfeng changed the title update urdf update urdf converter Mar 7, 2026
@greptile-apps

greptile-apps Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR simplifies the collision_from_visuals code path in UrdfConverter._convert_asset. The old code maintained a local dictionary mapping snake_case keys ("convex_hull", "convex_decomposition") to title-case strings ("Convex Hull", "Convex Decomposition") and attempted to perform a lookup using cfg.collider_type — a field that does not exist on UrdfConverterCfg (the actual field is cfg.collision_type).

The new code directly passes cfg.collision_type, which already stores the correctly formatted string values expected by importer_utils.collision_from_visuals. This fixes a latent bug where accessing the non-existent cfg.collider_type would have raised AttributeError whenever collision_from_visuals was enabled.

Key improvements:

  • Removes the now-unnecessary collision_type_map dictionary.
  • Fixes the erroneous cfg.collider_type reference to the correct cfg.collision_type.
  • Preserves default behavior: cfg.collision_type defaults to "Convex Hull", matching the previous fallback.
  • No breaking changes to the public API.

Confidence Score: 5/5

  • Safe to merge — targeted bug fix with no regressions or breaking changes.
  • The change corrects a latent bug where accessing the non-existent attribute cfg.collider_type would have raised AttributeError whenever collision_from_visuals was True. The fix uses the correct attribute cfg.collision_type, which is properly typed (Literal with title-case values) and defaults to "Convex Hull". The removal of the redundant mapping dictionary simplifies the code without altering behavior. The change is minimal, clearly correct, and preserves the existing API contract.
  • No files require special attention

Sequence Diagram

sequenceDiagram
    participant Caller
    participant UrdfConverter
    participant importer_utils

    Caller->>UrdfConverter: _convert_asset(cfg)
    note over UrdfConverter: cfg.collision_from_visuals == True
    UrdfConverter->>importer_utils: collision_from_visuals(stage, cfg.collision_type)
    note over importer_utils: cfg.collision_type is already<br/>"Convex Hull" or "Convex Decomposition"
    importer_utils-->>UrdfConverter: (collision geometry applied)
Loading

Last reviewed commit: 3619eb3

@stevfeng
stevfeng requested a review from ooctipus March 7, 2026 00:48
@kellyguo11 kellyguo11 changed the title update urdf converter Updates urdf converter Mar 7, 2026
@kellyguo11
kellyguo11 merged commit 9d8e516 into isaac-sim:develop Mar 7, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants