Gazebo | Ignition | Community
Ask Your Question
0

Model names and hierarchy

asked 2014-04-10 08:43:10 -0600

Carbon Based Lifeform gravatar image

Hello. I'm trying to load my hexapod robot model in Gazebo 2.2, following this tutorial. I had an old hexapodsim.urdf.xacro file, that I converted to hexapodsim.urdf and then to hexapodsim.sdf. So far so good. Whenever I try to launch gazebo, I get the following:

Error [ModelDatabase.cc:407] Unable to download model[model://hexapodsim]
Error [parser_urdf.cc:2608] Unable to call parseURDF on robot model
Error [parser.cc:273] parse as old deprecated model file failed.
Error [World.cc:1544] Unable to read sdf file.

I followed carefully the tutorial, and I don't understand what's going on. My folder tree is like this:

  • hexapod_model

    • hexapodsim

      • hexapodsim.cc
      • CMakeLists.txt
      • model.sdf
      • model.urdf
      • model.config
      • meshes
      • build
      • hexapod.world

My hexapodsim.cc file looks like this:

#include "gazebo/physics/physics.hh"
#include "gazebo/common/common.hh"
#include "gazebo/gazebo.hh"

namespace gazebo
{
class Hexapodsim : public WorldPlugin
{
    public: void Load(physics::WorldPtr _parent, sdf::ElementPtr /*_sdf*/)
    {
        // Option 1: Insert model from file via function call.
        // The filename must be in the GAZEBO_MODEL_PATH environment variable.
        _parent->InsertModelFile("model://hexapodsim");  
    }
};

// Register this plugin with the simulator
GZ_REGISTER_WORLD_PLUGIN(Hexapodsim)
}

I made sure that the GAZEBOMODELPATH is set correctly to the hexapodsim folder; my GAZEBOPLUGINPATH is set correctly to the build folder where my libhexapodsim.so lies. I used the same name (hexapodsim) for the model.config, model.sdf and hexapod.world file. I thought it might be a filename convention problem, or a directories hierarchy issue, because I tried to rearrange the folder configuration and I was using different names for the files, and Gazebo managed to parse the .sdf file (even though I had some errors due to the lack of a couple of plugins I was trying to load). What is wrong now? Thanks for the help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-04-10 08:51:29 -0600

Carbon Based Lifeform gravatar image

I suddenly realized that I made a dumb mistake. The GAZEBOMODELPATH was pointing to hexapodsim folder (the directory containing the model files) and not to the parent directory, hexapod_models.

edit flag offensive delete link more

Comments

Me too facing the same problem, since i am new to Gazebo can you please elaborate how to fix this (with commands)

KishoreKumar P gravatar imageKishoreKumar P ( 2015-12-15 13:43:44 -0600 )edit

Take a look at [this tutorial](http://gazebosim.org/tutorials?tut=model_structure&cat=build_robot).

nkoenig gravatar imagenkoenig ( 2015-12-15 17:02:44 -0600 )edit
nkoenig gravatar imagenkoenig ( 2015-12-15 17:03:05 -0600 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-04-10 08:43:10 -0600

Seen: 602 times

Last updated: Apr 10 '14