getMesh from gazebo
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 ?