Gazebo | Ignition | Community
Ask Your Question

How to get the distance between two objects (meshes)

asked 2014-04-28 01:39:54 -0600

dmeltz gravatar image

updated 2014-10-28 09:43:40 -0600

Hello all

I am interesting in wright a plugin that calculates the distance between my robot and the objects around it. My intention is to use this measure in order to grade the performance of obstacle avoidance algorithms. Therefore, i am looking for some kind of unambiguous world state data, and not a sensor simulation.

My question: is there a function in the Gazebo API that performs these kind of calculations, that i can use it in my plugin ?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-05-08 23:02:47 -0600

peshala gravatar image


One way of doing is writing a plugin similar to p3d (LINK) and iterating through all the models in the simulation world and getting the relative position between your robot and all those models.

Hope it helps!

edit flag offensive delete link more


I understand that i need to iterate between all objects in the scenario but the thing that i looking for is a function that will sit inside my iteration loop and be able to calculate minimal distance once it is given two objects positions and meshes. I sure that some variation of this function is used to calculate collisions between objects.

dmeltz gravatar imagedmeltz ( 2014-07-14 10:09:04 -0600 )edit

Maybe [FCL]( is what you're looking for?

scpeters gravatar imagescpeters ( 2014-10-28 23:45:13 -0600 )edit
Login/Signup to Answer

Question Tools


Asked: 2014-04-28 01:39:54 -0600

Seen: 2,730 times

Last updated: Oct 28 '14