Gazebo | Ignition | Community
Ask Your Question

Getting bounding box of model(object)

asked 2015-11-18 08:57:10 -0500

niranjan_187 gravatar image

Hello all,

I am pretty new to Gazebo so please excuse me if this query sounds to basic.

I want to have the bounding box of objects in the gazebo. With the gazebo model state publisher I get the pose but not the bounding box. Is there something already existing to get the same? Or is there a way to get the bounding box?

Thank you in advance.

Waiting for you responses.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-11-19 22:26:07 -0500

mysna gravatar image

updated 2015-11-19 22:27:32 -0500

i just find it on gazebo source code ^^ $ grep "boundingbox" * -ri

use below code:

gazebo::rendering::ScenePtr scene = gazebo::rendering::get_scene();
rendering::VisualPtr visual = scene->GetVisual("your model name");
math::Box boundingBox = visual->GetBoundingBox();

< reference >

edit flag offensive delete link more


Hey! Do you know any way to do it in Python? Should it be similar right?

espetro gravatar imageespetro ( 2019-09-21 13:06:35 -0500 )edit

answered 2015-11-20 01:07:17 -0500

AndreiHaidu gravatar image


you will probably need to write a plugin where you can query for the bounding box.

math::Box my_bb = my_model->GetBoundingBox()

Cheers, Andrei

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-11-18 08:57:10 -0500

Seen: 2,577 times

Last updated: Nov 20 '15