Getting bounding box of model(object)
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.
Asked by niranjan_187 on 2015-11-18 09:57:10 UTC
Answers
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 >
- Gazebo Source Code : https://bitbucket.org/osrf/gazebo/src/f69b82f6e25ce51bac99a04a0db036dfead6aa0b/gazebo/rendering/Visual_TEST.cc?at=default&fileviewer=file-view-default#Visual_TEST.cc-121
Asked by mysna on 2015-11-19 23:26:07 UTC
Comments
Hey! Do you know any way to do it in Python? Should it be similar right?
Asked by espetro on 2019-09-21 13:06:35 UTC
Hi,
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
Asked by AndreiHaidu on 2015-11-20 02:07:17 UTC
Comments