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

robot position and minimal distance to an obsacle

asked 2012-08-19 19:40:30 -0500

Astronaut gravatar image

updated 2014-01-28 17:13:23 -0500

ngrennan gravatar image

Hello

I want to ask some question regarding robot position and orientation in the space and his minimal distance to some obstacle point. I want to calculate a minimal distance between the robot and some object in the map. Im using amcl for localisation and only laser scan datas. So my robot is assumed as rectangle and a obstacle as a simple line in the wall. So mathematically it is a minimal distance between a point and a line ( assume only 2d because the z coordinate is always 0). So Im using TF transform to label a line coordinate to the map frame. Than calling the TF functions can do those mathematically distance calculation. But my problem is the robot position and orientation during the time. Because during the time the robot change his position and orientation and it has rectangular dimension I have to find that closest point in the rectangle to calculate the disctance. So I know that have to use the geometry_msgs/Quaternion Message but any code help or some advice. ??

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-07 17:51:36 -0500

updated 2013-02-07 17:55:00 -0500

Assuming the obstacles are polygons (or polylines), the will always be a line of shortest distance between the robot and the obstacle that contains a vertex of at least one of them. So, to get an exact answer, you can search among minimal lines connecting vertices to edges between the robot and the obstacle. In practice that will not scale well, so you may want to look at something involving bounding volumes to get fast approximations.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-19 19:40:30 -0500

Seen: 672 times

Last updated: Feb 07 '13