Gazebo | Ignition | Community
Ask Your Question

Getting distance from model to nearest object

asked 2018-01-04 10:04:57 -0500

Pi Robot gravatar image

updated 2018-01-04 10:06:10 -0500


I am running Gazebo 2.3 under ROS Indigo and Ubuntu 14.04. I have a "walking person" model in my Gazebo world that I am moving around using a Python script and publishing new positions to the /gazebo/model_states topic.

My question is: is there any way either through the Gazebo API or through a ROS service or topic to get the distance between the person model and the nearest object in the rest of the world?

I can also use Gazebo 7 if that makes a difference.


edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-01-08 05:32:31 -0500

Carlos Agüero gravatar image

Not directly. The easiest way to do it would be to iterate through the list of models in the world and check the distance with your person model.

edit flag offensive delete link more


Yeah, we thought we might do that but then it was not clear how to get the nearest distance to a mesh that represents an entire office (for example). So instead we attached a lidar to the person model and now we can just use the lidar range values to get the nearest object. :)

Pi Robot gravatar imagePi Robot ( 2018-01-10 08:50:13 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-01-04 10:04:57 -0500

Seen: 462 times

Last updated: Jan 08 '18