Skip to content

[AO migration] URDF Parser + Model#1300

Merged
aclegg3 merged 8 commits intomasterfrom
ao-migration-urdf-parser
Jun 8, 2021
Merged

[AO migration] URDF Parser + Model#1300
aclegg3 merged 8 commits intomasterfrom
ao-migration-urdf-parser

Conversation

@aclegg3
Copy link
Copy Markdown
Contributor

@aclegg3 aclegg3 commented Jun 8, 2021

Motivation and Context

This change introduces the esp::io::URDF namespace containing a Parser for xml based URDF files (using tinyxml) and a Model struct (plus supporting datastrctures) to cache articulated object metadata before instancing. No physics simulation or Bullet implementation is included at this stage.

How Has This Been Tested

Added a new C++ test IOTest::parseURDF with URDF parsing and validation of a test file.

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.

@aclegg3 aclegg3 requested review from eundersander and jturner65 June 8, 2021 02:50
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jun 8, 2021
Comment thread src/esp/io/URDFParser.h Outdated
Copy link
Copy Markdown
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

I know this class is adapted from Bullet code so I expect we don't want to modify it too much. Still, I added some comments.

Comment thread src/esp/io/URDFParser.cpp Outdated
Comment thread src/esp/io/URDFParser.cpp Outdated
Comment thread src/esp/io/URDFParser.h Outdated
Comment thread src/esp/io/URDFParser.h Outdated
Comment thread src/esp/io/URDFParser.h

// parse a loaded URDF string into relevant general data structures
// return false if the string is not a valid urdf or other error causes abort
bool parseURDF(std::shared_ptr<Model>& model,
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: kinda a strange interface to pass in a reference to a shared_ptr to be populated. How about just return a valid shared_ptr or null on failure?

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.

Yeah, that makes sense. Was following the parser paradigm of filling reference input variables, but perhaps the top-level API here should just return the smart pointer. Easy enough refactor. 👍

Copy link
Copy Markdown
Contributor

@jturner65 jturner65 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Skylion007 Skylion007 self-requested a review June 8, 2021 22:11
@aclegg3 aclegg3 merged commit d4cc4bf into master Jun 8, 2021
@aclegg3 aclegg3 deleted the ao-migration-urdf-parser branch June 8, 2021 22:27
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.

5 participants