Skip to content

load urdf/srdf from json-wrapped string input #26

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

Merged
merged 2 commits into from
Aug 15, 2016

Conversation

ClintLiddick
Copy link
Member

Backwards-compatible with previous interface, this adds additional ability to load a urdf and (optionally) srdf from a json-wrapped string through OpenRAVE plugin command.


/** Constructs plugin and registers functions */
URDFLoader(OpenRAVE::EnvironmentBasePtr env) : OpenRAVE::ModuleBase(env)
{
__description = "URDFLoader: Loader that imports URDF files.";
_env = env;

RegisterCommand("load", boost::bind(&URDFLoader::load, this, _1, _2),
RegisterCommand("load", boost::bind(&URDFLoader::loadFile, this, _1, _2),
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks great, but I think the names are now confusing. I proposed that we (a) rename URDFLoader::load -> URDFLoader::loadModel, (b) rename URDFLoader::loadFile -> URDFLoader::loadURI and rename its command registration to LoadURI, and (c) create a new wrapper command called URDFLoader::load registered as Load which internally forwards to LoadURI (perhaps eventually with a deprecation warning?). What do y'all think?

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @cdellin. Lets:

  1. Rename URDFLoader::load to URDFLoader::loadModel.
  2. Rename URDFLoader::loadFile to URDFLoader::loadURI.
  3. Rename the Load command to LoadURI.
  4. Rename the LoadJsonString command to LoadString.
  5. Add a Load command that prints a deprecation warning and forwards to LoadURI.

@psigen
Copy link
Member

psigen commented Aug 15, 2016

If we are shoving a random header-only JSON library in here, I prefer https://github.com/nlohmann/json to picojson.

@ClintLiddick
Copy link
Member Author

@cdellin @mkoval I made those changes. @psigen that library looks good but doesn't work with 14.04 gcc version 4.8 😢 .

I'll open a PR on herbpy to remove the deprecation warning.

@mkoval
Copy link
Member

mkoval commented Aug 15, 2016

👍 I'll merge once Travis is happy.

@mkoval mkoval merged commit 395e273 into master Aug 15, 2016
@mkoval mkoval deleted the feature/load_from_string branch August 15, 2016 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants