Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

I believe you're looking for information on a model's geometry. First, let's understand the structure of a model in Gazebo.

  • A model is a collection of links

  • A link can contain several collisions

  • Each collision has a shape. The shape can be something like a box, cylinder, sphere or a mesh.

So if you have a model which you know has a single link, which has a single collision, which is a sphere, you can get to its radius like this:

  1. Model::GetLink

    auto link = model->GetLink();
  2. Link::GetCollisions

    auto collision = link->GetCollisions()[0];
  3. Collision::GetShape

    auto sphereShape = boost::dynamic_pointer_cast<physics::SphereShape>(collision->GetShape());
  4. SphereShape::GetRadius

    auto radius = sphereShape->GetRadius();

Regarding the rest of your question:

  • I couldn't find the GetCollisionBox function in Gazebo, where did you get it from?

  • As for GetBoundingBox, it represents the world axis-aligned bounding box [1]. That is the smallest box aligned with the world which fully contains the model.