Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USD -> SDF: Added lights attached to the world #875

Merged
merged 68 commits into from
Mar 31, 2022

Conversation

ahcorde
Copy link
Collaborator

@ahcorde ahcorde commented Mar 9, 2022

Signed-off-by: ahcorde [email protected]

🎉 New feature

Summary

USD -> SDF: Added lights attached to the world

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 and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@ahcorde ahcorde requested review from adlarkin and koonpeng March 9, 2022 18:43
@ahcorde ahcorde self-assigned this Mar 9, 2022
ahcorde added 3 commits March 9, 2022 19:50
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
@ahcorde ahcorde force-pushed the ahcorde/usd_to_sdf_lights branch from ed473a5 to 4b09785 Compare March 9, 2022 22:48
@ahcorde ahcorde added the usd label Mar 10, 2022
ahcorde and others added 4 commits March 10, 2022 13:39
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: ahcorde <[email protected]>
test/usd/upAxisZ.usda Outdated Show resolved Hide resolved
usd/src/usd_parser/USD2SDF.cc Outdated Show resolved Hide resolved
usd/src/usd_parser/USDLight_TEST.cc Show resolved Hide resolved
usd/src/usd_parser/USDWorld.cc Outdated Show resolved Hide resolved
usd/src/usd_parser/USDWorld.cc Show resolved Hide resolved
Copy link

@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.

There is some data that is not common between these two formats, I would say that some of the data might be "lost in translation"

I assume that these differences are due to the different formats and can't be addressed easily?

@ahcorde ahcorde force-pushed the ahcorde/usd_to_sdf_lights branch from 1878882 to 7299701 Compare March 28, 2022 11:44
Signed-off-by: Ashton Larkin <[email protected]>
Copy link
Contributor

@adlarkin adlarkin left a comment

Choose a reason for hiding this comment

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

I have a few questions before merging. Otherwise, I think this looks good.

usd/src/usd_parser/USDLight_TEST.cc Outdated Show resolved Hide resolved
usd/src/usd_parser/USDLight_TEST.cc Outdated Show resolved Hide resolved
usd/src/usd_parser/USDLights.cc Outdated Show resolved Hide resolved
Comment on lines 97 to 124
// In general USD models used in Issac Sim define the model path
// under a root path for example:
// -> /robot_name/robot_name_link0
// But sometimes for enviroments it uses just a simple path:
// -> /ground_plane
// -> /wall_0
// the shortName variable defines if this is the first case when it's
// False or when it's true then it's the second case.
// This conversion might only work with Issac Sim USDs
if (primPathTokens.size() >= 2)
{
bool shortName = false;
if (primPathTokens.size() == 2)
{
if (prim.IsA<pxr::UsdGeomGprim>() || (primType == "Plane"))
{
if (primName != "imu")
{
linkName = "/" + primPathTokens[0];
shortName = true;
}
}
}
if (!shortName)
{
linkName = "/" + primPathTokens[0] + "/" + primPathTokens[1];
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this code mainly used for finding the parent prim of the light? I find it a little odd that we are manually parsing through the first 2 levels of the prim path to find the parent. I imagine this could be problematic if the light's parent isn't in the first two levels of the stage. Is there a better way to find the parent of a light that offers more flexibility/is less error prone?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't find a better way to do it, I'm open to suggestions

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't think of a better way at the moment - since we are pressed for time, I added a TODO note in 847271a and created an issue in #927.

Base automatically changed from ahcorde/usd_to_sdf_transforms to sdf12 March 31, 2022 18:16
@ahcorde ahcorde enabled auto-merge (squash) March 31, 2022 20:33
@ahcorde ahcorde merged commit 585c925 into sdf12 Mar 31, 2022
@ahcorde ahcorde deleted the ahcorde/usd_to_sdf_lights branch March 31, 2022 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants