RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

Parse Universal Scene Description (USD) format #17833

Open RussTedrake opened 2 years ago

RussTedrake commented 2 years ago

There is considerable momentum behind Pixar's USD format: it's used it omniverse, and you can even view in Preview on mac. It should be sufficient for parsing into multibodyplant / scenegraph, and even for rendering.

Let's use this issue so that we can track progress / intentions towards properly supporting it.

Sub-issues:

jwnimmer-tri commented 2 years ago

FYI https://github.com/gazebosim/gz-usd might be interesting here as a stop-gap. It offers a usd2sdf command-line tool. (I haven't tried out how well it works.)

For adding Drake support for USD directly, my guess it that long-term we'd want use a native parser instead of a conversion tool, but in case users have usd files already that tool might help bridge the gap.

jwnimmer-tri commented 9 months ago

Presuming that Drake would use https://github.com/PixarAnimationStudios/OpenUSD to parse *.usd files, one question will be the build system side of that library and its dependencies. I've filed #20898 to help collate information on that front. We can keep this issue focused on the big-picture feature.

In the meantime, hermetic build system integration is not necessarily a blocker for exploring parsing integration. As a temporary measure, prototype code can just set e.g. linkopts = [...] manually to link against a hand-built version of OpenUSD.

jwnimmer-tri commented 9 months ago

In terms of the USD parser itself, a good starting point would be to look at the existing parsers. The TLDR is that they all implement class ParserInterface, with ParserInterface::AddAllModels being the primary entry point. When given a filename to parse, it's the job of that function to make API calls on class MultibodyPlant and class SceneGraph to populate the scene.

jwnimmer-tri commented 1 month ago

FYI Drake's SceneGraph now supports in-memory meshfiles, so the USD parser no longer needs to create a tmpdir to store meshdata. It can load the files directly into SceneGraph without writing out the files to disk.