Skip to content

convert SDF to USD#762

Closed
adlarkin wants to merge 39 commits intosdf12from
adlarkin/sdf_to_usd
Closed

convert SDF to USD#762
adlarkin wants to merge 39 commits intosdf12from
adlarkin/sdf_to_usd

Conversation

@adlarkin
Copy link
Copy Markdown
Contributor

@adlarkin adlarkin commented Nov 30, 2021

🎉 New feature

Related to #736

Summary

This targets the sdf12 branch to add functionality for converting a SDF file to USD.

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

@github-actions github-actions bot added 🌱 garden Ignition Garden 🏯 fortress Ignition Fortress labels Nov 30, 2021
@adlarkin adlarkin mentioned this pull request Nov 30, 2021
8 tasks
@adlarkin adlarkin force-pushed the adlarkin/sdf_to_usd branch 2 times, most recently from f33ccd8 to a908241 Compare December 1, 2021 20:58
@adlarkin adlarkin changed the title SDF to USD (sdf12) convert SDF to USD Dec 1, 2021
@adlarkin adlarkin force-pushed the adlarkin/sdf_to_usd branch from a908241 to efff131 Compare December 2, 2021 01:42
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
@adlarkin adlarkin force-pushed the adlarkin/sdf_to_usd branch from efff131 to 984c8e0 Compare December 2, 2021 01:43
ahcorde and others added 2 commits December 2, 2021 10:20
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
return false;
}

if (!pxr::UsdPhysicsCollisionAPI::Apply(geomPrim))
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.

you should create two schemas, one for the visual and another one for the collision, even if this implies to duplicate the mesh.

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.

I'm not sure that I understand what you mean - are you saying that the geometry should have two schemas applied to it (i.e., collision and something else)? What is the visual schema you mentioned, can you share a link to documentation/API somewhere?

Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
@adlarkin adlarkin force-pushed the adlarkin/sdf_to_usd branch from 071cef6 to c291638 Compare December 3, 2021 22:31
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
@adlarkin
Copy link
Copy Markdown
Contributor Author

adlarkin commented Dec 8, 2021

As a note to myself and anyone else following the progress of this PR, here's what's supported as of commit 64b5915:

  • Models
    • static/non-static
    • links and joints (more info on these items below)
  • Links
    • Mass (part of the link's inertial)
    • Visual
      • Geometry for box, cylinder, sphere, capsule, triangle meshes, and ground planes
    • Collisions for geometries defined above
  • Joints
    • Basic support (parent, child, and axis information - which includes joint limits) for revolute, ball, prismatic, and fixed joint types

I still need to test the USD equivalents in simulation with Nvidia's isaac sim to make sure things behave as expected (so far, I have looked at the generated USD file via the usd converter script, and viewed contents of converted USD files with usdview). Here are a few SDF files that may be worth using for testing simulation behavior:

  • double pendulum
    • has links with basic geometry shapes and revolute joints
  • wind.sdf
    • has a joint with the parent being the world instead of a link (see roofJoint), and joints of type fixed and ball

Looking forward, I plan to work on converting lights and/or sensors next.

adlarkin and others added 3 commits December 8, 2021 18:06
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
adlarkin and others added 12 commits December 20, 2021 10:07
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
* Added more info to the main stage

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Fixed complain about type

Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: Ashton Larkin <42042756+adlarkin@users.noreply.github.com>
Signed-off-by: Teo Koon Peng <koonpeng@openrobotics.org>
* Added articulationRootAPI to SDF-USD converter

Signed-off-by: ahcorde <ahcorde@gmail.com>
* Added tutorial to move an articulated arms

Signed-off-by: ahcorde <ahcorde@gmail.com>
* Camera fixes to SDF to USD converter

Signed-off-by: ahcorde <ahcorde@gmail.com>
* Added materials to SDF to USD converter

Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Copy link
Copy Markdown

@koonpeng koonpeng left a comment

Choose a reason for hiding this comment

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

I'm having problem building this with other ignition libraries, when building libraries that uses sdformat, I am getting linker errors

...
/usr/bin/ld: cannot find -lusdImagingGL
/usr/bin/ld: cannot find -lusdRiImaging
/usr/bin/ld: cannot find -lusdSkelImaging
/usr/bin/ld: cannot find -lusdVolImaging
/usr/bin/ld: cannot find -lusdAppUtils
collect2: error: ld returned 1 exit status

I think it's a combination of usd's cmake not being correct about the needed compiler flags, and that some libraries are not linking to sdformat via the target, but by XXX_Libraries variables, and that colcon is not correctly adding the workspace install directory to the list of default search directories.

Since #817 has been merged, updating this PR should fix the issue.

list(APPEND @PKG_NAME@_INCLUDE_DIRS ${IGNITION-MATH_INCLUDE_DIRS})
list(APPEND @PKG_NAME@_LIBRARY_DIRS ${IGNITION-MATH_LIBRARY_DIRS})

find_package(ignition-commonh@IGN_COMMON_VER@)
Copy link
Copy Markdown

@koonpeng koonpeng Jan 26, 2022

Choose a reason for hiding this comment

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

Suggested change
find_package(ignition-commonh@IGN_COMMON_VER@)
find_package(ignition-common@IGN_COMMON_VER@)

typo?


upstream has removed this file, not sure if we can remove as well.

@adlarkin
Copy link
Copy Markdown
Contributor Author

I'm having problem building this with other ignition libraries

@koonpeng, sorry, we actually are not iterating on this PR anymore - now that we have merged #817, the approach being taken is to split this PR up into smaller pieces that can be built on top of #817. For example:

We are keeping this PR open as a draft for reference, but once we have broken this up into smaller pieces that make use of the component infrastructure, we will close this PR.

@koonpeng
Copy link
Copy Markdown

thanks, I will look at #829 for my testing.

@scpeters scpeters added the usd label Feb 21, 2022
@ahcorde
Copy link
Copy Markdown
Collaborator

ahcorde commented Mar 4, 2022

@ahcorde ahcorde closed this Mar 4, 2022
@adlarkin adlarkin deleted the adlarkin/sdf_to_usd branch March 24, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏯 fortress Ignition Fortress 🌱 garden Ignition Garden usd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants