Skip to main content

A URDF to OpenUSD Data Converter

Project description

urdf-usd-converter

Overview

A URDF to OpenUSD Data Converter

Important: This is currently an Alpha product. See the CHANGELOG for features and known limitations.

Key Features:

  • Converts an input URDF file into an OpenUSD Layer
  • Supports data conversion of visual geometry & materials, as well as the links, collision geometry, and joints necessary for kinematic simulation.
  • Available as a python module or command line interface (CLI).
  • Creates a standalone, self-contained artifact with no connection to the source URDF, OBJ, DAE, or STL data.
    • Structured as an Atomic Component
    • Suitable for visualization & rendering in any OpenUSD Ecosystem application.
    • Suitable for import & simulation in Newton.

This project is part of Newton, a Linux Foundation project which is community-built and maintained.

Implementation Details & Dependencies

Specific implementation details are based on our URDF to USD Conceptual Data Mapping.

The output asset structure is based on NVIDIA's Principles of Scalable Asset Structure in OpenUSD.

The implementation also leverages the following dependencies:

  • NVIDIA's OpenUSD Exchange SDK to author consistent & correct USD data.
  • Pixar's OpenUSD python modules & native libraries (vendored via the usd-exchange wheel).
  • tinyobjloader, pycollada, and numpy-stl for parsing any mesh data referenced by the input URDF datasets.

Get Started

To start using the converter, install the python wheel into a virtual environment using your favorite package manager:

python -m venv .venv
source .venv/bin/activate
pip install urdf-usd-converter
urdf_usd_converter /path/to/robot.urdf /path/to/usd_robot

See urdf_usd_converter --help for CLI arguments.

Alternatively, the same converter functionality can be accessed from the python module directly, which is useful when further transforming the USD data after conversion.

import urdf_usd_converter
import usdex.core
from pxr import Sdf, Usd

converter = urdf_usd_converter.Converter()
asset: Sdf.AssetPath = converter.convert("/path/to/robot.urdf", "/path/to/usd_robot")
stage: Usd.Stage = Usd.Stage.Open(asset.path)
# modify further using Usd or usdex.core functionality
usdex.core.saveStage(stage, comment="modified after conversion")

Loading the USD Asset

Once your asset is saved to storage, it can be loaded into an OpenUSD Ecosystem application.

We recommend starting with usdview, a simple graphics application to confirm the visual geometry & materials are working as expected. You can inspect any of the USD properties in this application, including the UsdPhysics properties.

Tip: OpenUSD Exchange Samples provides ./usdview.sh and .\usdview.bat commandline tools which bootstrap usdview with the necessary third party dependencies.

However, you cannot start simulating in usdview, as there is no native simulation engine in this application.

To simulate this asset in Newton, call newton.ModelBuilder.add_usd() to parse the asset and add it to your Newton model.

Simulating in other UsdPhysics enabled products (e.g. NVIDIA Omniverse, Unreal Engine, etc) may provided mixed results. The rigid bodies are structured hierarchically, which maximal coordinate solvers often do not support. In order to see faithful simulation in these applications, the USD asset will need to be modified to suit the expectations of each target runtime.

Contribution Guidelines

Contributions from the community are welcome. See CONTRIBUTING.md to learn about contributing via GitHub issues, as well as building the project from source and our development workflow.

General contribution guidelines for Newton repositories are available here.

Community

For questions about this urdf-usd-converter, feel free to join or start a GitHub Discussions.

For questions about OpenUSD Exchange SDK, use the USD Exchange GitHub Discussions.

For general questions about OpenUSD itself, use the Alliance for OpenUSD Forum.

By participating in this community, you agree to abide by the Linux Foundation Code of Conduct.

References

License

The urdf-usd-converter is provided under the Apache License, Version 2.0, as is the OpenUSD Exchange SDK.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urdf_usd_converter-0.1.0a1.tar.gz (140.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urdf_usd_converter-0.1.0a1-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file urdf_usd_converter-0.1.0a1.tar.gz.

File metadata

  • Download URL: urdf_usd_converter-0.1.0a1.tar.gz
  • Upload date:
  • Size: 140.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for urdf_usd_converter-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 021ad6c7a7fa7560af0245c3b659df140d7be6fe6186d02e1b9925c35e30bb6c
MD5 2a07e00ec85abb318b0dc25050996b3f
BLAKE2b-256 360f57d2e5cc4f29ae5e8a5e54f9ed55acb09fad49256e4a6c6d9b14c2f5ae16

See more details on using hashes here.

Provenance

The following attestation bundles were made for urdf_usd_converter-0.1.0a1.tar.gz:

Publisher: ci.yml on newton-physics/urdf-usd-converter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file urdf_usd_converter-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for urdf_usd_converter-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 94cbc74408adf251244468e86eded8abd637d3b8946fe1ad305f4c834da09801
MD5 6fbdcceefa871de34dbe13cb3aa9f0c2
BLAKE2b-256 7076684110b8dc9fa31fda46762c2e86b85694e712e336ed8c8890a86cf668b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for urdf_usd_converter-0.1.0a1-py3-none-any.whl:

Publisher: ci.yml on newton-physics/urdf-usd-converter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page