Hi sam,
A while back, I was trying something similar (walking legs), but I had to abandon it. Perhaps what I found could be of help, but I should warn you, my approach is rather hacky.
Gazebo runs as a server and you can connect to it using the client/server interfaces in libgazebo. The documentation with an example is available in the Gazebo manual.
Also, the ROS wrapper for gazebo very nicely uses these interfaces to expose some topics and services in ROS. You can find the code on your machine at this path:
$(find gazebo)/src/gazeboros.cpp
Specifically, you might want to look at functions used to retrieve and manipulate models at run-time:
gazebo::Model* model = dynamic_castgazebo::World::Instance()->GetEntityByName(your_model_name));
const std::vector children = model->GetChildren();
// iterate using variable 'iter'
gazebo::Body* body = dynamic_cast(*iter);
const std::map* geoms = body->GetGeoms();
// magic happens here
Sorry I didn't get any further, but I'm interested in what you find.
Best,
Nikhil
PS: The model and entity names should be carefully specified to match the XML file that is loaded.
Originally posted by scribbleink with karma: 116 on 2011-06-07
This answer was ACCEPTED on the original site
Post score: 2