Skip to content

ArticulatedObjects: Enable support for secondary json config files.#1458

Merged
jturner65 merged 7 commits intofacebookresearch:masterfrom
jturner65:AO_JsonUsrAttr
Aug 30, 2021
Merged

ArticulatedObjects: Enable support for secondary json config files.#1458
jturner65 merged 7 commits intofacebookresearch:masterfrom
jturner65:AO_JsonUsrAttr

Conversation

@jturner65
Copy link
Copy Markdown
Contributor

Motivation and Context

This PR introduces support of Json config files for URDF-based ArticulatedObject models in the URDFParser, which will hold default user-defined attributes (Such as bounding boxes for placements) that apply to all instances of articulated objects built from these models. This PR also removed extraneous markers from error messages that did not match the format of our current message logging in the URDFParser.

To be compatible with this functionality, the json config file holding the user_defined attributes must meet these criteria :

  • Must be in the same directory as the AO's .urdf file
  • Must have the same core filename (minus extensions) as the AO's .urdf file
  • Must have the following extension : .ao_config.json
  • Internally, the file must have a root Json object, and within that object there must be a tag "user_defined" which references a Json object holding the user-defined values.

How Has This Been Tested

Locally c++ and python tests.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jturner65 jturner65 requested a review from aclegg3 August 30, 2021 16:33
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 30, 2021
Comment thread src/esp/physics/PhysicsManager.cpp Outdated
// merge articulated object's user-defined attributes, if any exist in scene
// instance.
existingArticulatedObjects_.at(aObjID)->setUserAttributes(
existingArticulatedObjects_.at(aObjID)->mergeUserAttributes(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: calling at(aObjId) is not free. The reference should really be cached between these calls, don't you think?

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.

Every little bit helps, yeah

Comment thread src/esp/io/URDFParser.cpp Outdated
return false;
}
}
if (urdfModel->m_links.size() == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (urdfModel->m_links.size() == 0) {
if (urdfModel->m_links.empty()) {

Copy link
Copy Markdown
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for cleaning up. 👍

@jturner65 jturner65 merged commit f24445d into facebookresearch:master Aug 30, 2021
@jturner65 jturner65 deleted the AO_JsonUsrAttr branch August 30, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants