ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to get the minimun ditsance from an obstacle

asked 2011-09-07 22:13:22 -0600

erpa gravatar image

updated 2014-01-28 17:10:21 -0600

ngrennan gravatar image

Hello, I'm working with gazebo and I would like to detect the minimum distance between my robot and an obstacle. The model of the robot is an urdf file. What is the best sensor to use? How do I "attach" it to the robot and how do I get the data? Thanks.

edit retag flag offensive close merge delete

Comments

Do you need 2D range data or 3D? What's the application?
ben gravatar image ben  ( 2011-09-07 22:24:35 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2011-09-07 23:13:21 -0600

The first thing you need is to segment out the obstacle from the other objects in the environment. This might or might not be tricky, depending on the environment and the sensors you want to use.

You can either use a laser or a generic pointcloud (coming from a stereo/range camera or a tilting laser). The latter is the most generic and you can always convert a laser message to a pointcloud. However if you are interested in a gazebo simulation only, then a laser will be easier.

Then for every point in the pointcloud, you can transform it to the coordinate system you prefer (e.g. for the PR2 it would be baselink) and a simple euclidean distance will give you the answer.

If you are using the laser only, then the minimum in the range field of the laser message will give you the closest point.

edit flag offensive delete link more

Comments

Hello. Im trying to do the same with a laser. I wont to know how to work with straight lines in laser scan massages. Because the points on the longest straight lines is likely the wall and point not on the longest straight line the msg are likely on the other object. Any help??

Astronaut gravatar image Astronaut  ( 2013-06-30 18:59:26 -0600 )edit

@Astronaut you should post this as a new question, and check if somebody has not asked the same before. Your problem is very common, I bet you'll find a solution.

Lorenzo Riano gravatar image Lorenzo Riano  ( 2013-07-09 13:17:45 -0600 )edit
0

answered 2011-09-08 22:58:30 -0600

SAK gravatar image

As you havent provided details of your robot, i will tell you about adding a sensor in pr2. The physical sensor can be added in pr2 by using xacro file. In pr2 you can add sensors in head, torso and base.

But if you want to add a new sensor, (IR and Sonar) which are currently not available, you need to create them from scratch.

The process of creating a new sensor is not simple, i am working on it and finished it, it will be soon made public after testing repeatedly.

Now the available sensors are bumper (Contact sensors) and laserScan.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-09-07 22:13:22 -0600

Seen: 1,504 times

Last updated: Sep 08 '11