1. OpenSourceRoboticsFoundation
  2. Simulation
  3. gazebo
  4. Pull requests

Pull requests

#242 Merged at dc7a139
Repository
Branch
model_db_renaming
Repository
Branch
gazebo_1.4

Renaming model database manifest files

Author
  1. Nathan Koenig
Reviewers
Description

Renames the two types of manifest.xml files from:

1) Database manifest.xml to database.config

2) Model manifest.xml to model.config

The model database has already been updated.

This change is backward compatible.

Comments (11)

  1. Steven Peters

    For the models in my GAZEBO_MODEL_PATH that haven't been updated, I get a bunch of the following warnings:

    Warning [InsertModelWidget.cc:222] The manifest.xml for a Gazebo model is deprecated. Please rename manifest.xml to model.config
    

    It would be nice if this warning indicated which model has the deprecated manifest.xml. For example:

    diff -r 9af33771bfdd gazebo/gui/InsertModelWidget.cc
    --- a/gazebo/gui/InsertModelWidget.cc   Tue Jan 22 14:33:31 2013 -0800
    +++ b/gazebo/gui/InsertModelWidget.cc   Wed Jan 23 10:34:54 2013 -0800
    @@ -221,6 +221,7 @@
           {
             gzwarn << "The manifest.xml for a Gazebo model is deprecated. "
               << "Please rename manifest.xml to "
    +          << dIter->filename() << '/'
               << GZ_MODEL_MANIFEST_FILENAME << "\n";
    
             manifest /= "manifest.xml";
    

    I currently have a clone of the gazebo_models repo in my GAZEBO_MODEL_PATH, and I'm getting warnings for non-model files:

    Please rename manifest.xml to ".hg"/model.config
    Please rename manifest.xml to ".hgignore"/model.config
    Please rename manifest.xml to "CMakeLists.txt"/model.config
    Please rename manifest.xml to "LICENSE"/model.config
    Please rename manifest.xml to "database.config.in"/model.config
    Please rename manifest.xml to "manifest.xml.in"/model.config
    
      1. Steven Peters

        Nate, that's helpful, but I'm still getting warnings for files like ".hg" and "CMakeLists.txt". Perhaps the warning should only happen if a manifest.xml is successfully loaded? Here's a patch for that.

        diff -r d33ad5e014b5 gazebo/gui/InsertModelWidget.cc
        --- a/gazebo/gui/InsertModelWidget.cc   Thu Jan 24 08:35:06 2013 -0800
        +++ b/gazebo/gui/InsertModelWidget.cc   Thu Jan 24 16:50:02 2013 -0800
        @@ -212,6 +212,7 @@
               std::string modelName;
               boost::filesystem::path fullPath = _path / dIter->filename();
               boost::filesystem::path manifest = fullPath;
        +      bool deprecatedManifest = false;
        
               // First try to get the GZ_MODEL_MANIFEST_FILENAME. If that file doesn't
               // exist, try to get the deprecated version.
        @@ -219,17 +220,19 @@
                 manifest /= GZ_MODEL_MANIFEST_FILENAME;
               else
               {
        -        gzwarn << "The manifest.xml for a Gazebo model is deprecated. "
        -          << "Please rename manifest.xml to "
        -          << GZ_MODEL_MANIFEST_FILENAME << " for model "
        -          << (*dIter) << "\n";
        -
                 manifest /= "manifest.xml";
        +        deprecatedManifest = true;
               }
        
               TiXmlDocument xmlDoc;
               if (xmlDoc.LoadFile(manifest.string()))
               {
        +        if (deprecatedManifest)
        +          gzwarn << "The manifest.xml for a Gazebo model is deprecated. "
        +                 << "Please rename manifest.xml to "
        +                 << GZ_MODEL_MANIFEST_FILENAME << " for model "
        +                 << (*dIter) << "\n";
        +          
                 TiXmlElement *modelXML = xmlDoc.FirstChildElement("model");
                 if (!modelXML || !modelXML->FirstChildElement("name"))
                   gzerr << "No model name in manifest[" << manifest << "]\n";
        
          1. Steven Peters

            I have the gazebo_models folder checked out from bitbucket, and I put that in my GAZEBO_MODEL_PATH. It saves a step between making changes and installing the files.

            1. Nathan Koenig author

              Okay. Thanks. I'll add that to my testing.

              I'm also going to change the behavior issue different warnings when miscellaneous files are in the GAZEBO_MODEL_PATH.

              1. Nathan Koenig author

                Okay, I've updated the pull request with a patch that will produce warning message when files other than directories are in the GAZEBO_MODEL_PATH.

  2. Steven Peters

    For folders without model.config or manifest.xml, I get two warnings:

    Warning [InsertModelWidget.cc:242] The manifest.xml for a Gazebo model is deprecated. Please rename manifest.xml to model.config for model "/home/scpeters/osrf/gazebo_models/.hg"
    Error [InsertModelWidget.cc:252] model.config file is missing in directory["/home/scpeters/osrf/gazebo_models/.hg"]