URDF Import Extension [isaacsim.asset.importer.urdf]#
URDF Importer API#
The URDF importer provides a Python API for configuring and converting URDF files into USD assets. Below is a sample demonstrating how to import the Carter URDF included with this extension.
1import os
2
3import omni.usd
4from isaacsim.asset.importer.urdf import URDFImporter, URDFImporterConfig
5
6# Get path to extension data.
7ext_manager = omni.kit.app.get_app().get_extension_manager()
8ext_id = ext_manager.get_enabled_extension_id("isaacsim.asset.importer.urdf")
9extension_path = ext_manager.get_extension_path(ext_id)
10
11urdf_path = os.path.join(extension_path, "data", "urdf", "robots", "carter", "urdf", "carter.urdf")
12output_dir = os.path.dirname(urdf_path)
13
14# Configure and import.
15import_config = URDFImporterConfig(
16 urdf_path=urdf_path,
17 usd_path=output_dir,
18 collision_from_visuals=False,
19 merge_mesh=False
20)
21
22importer = URDFImporter(import_config)
23output_path = importer.import_urdf()
24
25# Open the resulting USD stage.
26omni.usd.get_context().open_stage(output_path)
- class URDFImporter(
- config: URDFImporterConfig | None = None,
URDF to USD importer.
Uses urdf-usd-converter to convert URDF files to USD format.
- Parameters:
config – Optional configuration for the import operation.
Example:
>>> from isaacsim.asset.importer.urdf import URDFImporter >>> URDFImporter() <...>
- import_urdf(
- config: URDFImporterConfig | None = None,
Import a URDF file and convert it to USD.
- Parameters:
config – Optional configuration for the import operation. If not provided, the stored importer configuration will be used.
- Returns:
Path to the generated USD file.
- Raises:
ValueError – If the URDF path is not configured.
Example:
>>> from isaacsim.asset.importer.urdf import URDFImporter, URDFImporterConfig >>> importer = URDFImporter() >>> config = URDFImporterConfig(urdf_path="/tmp/robot.urdf") >>> importer.config = config >>> # output_path = importer.import_urdf()
- property config: URDFImporterConfig#
Get the importer configuration.
- Returns:
Current importer configuration.
Example:
>>> from isaacsim.asset.importer.urdf import URDFImporter, URDFImporterConfig >>> importer = URDFImporter() >>> importer.config URDFImporterConfig(...)
- class URDFImporterConfig(
- urdf_path: str | None = None,
- usd_path: str | None = None,
- merge_mesh: bool = False,
- debug_mode: bool = False,
- collision_from_visuals: bool = False,
- collision_type: str = 'Convex Hull',
- allow_self_collision: bool = False,
- ros_package_paths: list[dict[str,
- str]] = <factory>,
Configuration for URDF import operations.
Stores settings that control how URDF files are converted to USD.
- Parameters:
urdf_path – Path to the URDF (.urdf) file to import.
usd_path – Directory path where the USD file will be saved.
merge_mesh – If True, merges meshes where possible to optimize the model.
debug_mode – If True, enables debug mode with additional logging and visualization.
collision_from_visuals – If True, collision geometry is generated from visual geometries.
collision_type – Type of collision geometry to use. Options: “Convex Hull”, “Convex Decomposition”, “Bounding Sphere”, “Bounding Cube”.
allow_self_collision – If True, allows the model to collide with itself.
ros_package_paths – List of ROS package name/path mappings for resolving package:// URLs.
Example:
>>> from isaacsim.asset.importer.urdf import URDFImporterConfig >>> config = URDFImporterConfig( ... urdf_path="/tmp/robot.urdf", ... usd_path="/tmp/output", ... merge_mesh=True ... ) >>> config.urdf_path '/tmp/robot.urdf'
- allow_self_collision: bool = False#
- collision_from_visuals: bool = False#
- collision_type: str = 'Convex Hull'#
- debug_mode: bool = False#
- merge_mesh: bool = False#
- ros_package_paths: list[dict[str, str]]#