ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

getMesh from gazebo

asked 2011-10-06 03:16:35 -0600

GuiHome gravatar image

Hi,

We are interested in retrieving the vertex and triangles from a loaded model directly out of gazebo (without loading the mesh from a file separately). In fact, we need to get the meshdata knowing the GeomID (for instance the GeomIDs that are in contact).

What we did is to start a simple_world.launch and run a basic package to access the model data. Here is the code :

    int main(int argc, char **argv)
    {
            ros::init(argc,argv,"gazebo_ros_getmesh",ros::init_options::NoSigintHandler);

            std::vector<gazebo::Model*> models;
            models = gazebo::World::Instance()->GetModels();
            if(models.size()>0)
                    ROS_INFO("ModelName:%s",models[0]->GetName().c_str());
            else
                    ROS_INFO("NoModel");
     }

We always get "NoModel". We thought it would be possible to access to the meshdata via some service that retrieves first the models (gazebo::World::Instance()->GetModels() ) and then the Body, Geom and finally the meshdata.

Appears to us, that any call to such functions must be done in gazeboros node but cannot be called from an external package of our own.

Is there another mean to access to the Meshdata ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-10-07 02:20:02 -0600

GuiHome gravatar image

We finally found our way through this, by creating a gazebo_plugin and attaching it to the world to get access to the models->body->geom->ogrevisual->mesh

this helped us a lot : http://answers.ros.org/question/1919/gazebo-tutorials-for-creating-a-plugin

Any other simpler mean to access to the triangles of the mesh (not the geoms) that are in contact during a collision would be appreciated.

edit flag offensive delete link more

Comments

Can you please help me with the plugin. unable to proceed after fetching the models.

CR7 gravatar image CR7  ( 2020-06-22 22:41:43 -0600 )edit

Question Tools

Stats

Asked: 2011-10-06 03:16:35 -0600

Seen: 917 times

Last updated: Oct 07 '11