Ah ok, I understand.  For efficiency, rather than computing the distance to each point in the cloud each time, you can project the cloud into a grid representing the robot configuration space and inflate each obstacle.  This is already implemented in the costmap_2d ROS package.
- Bhaskara

2011/1/18 Nicolás Alvarez Picco <nicolasapicco@hotmail.com>
Hi Everybody!!

I want to detect objects, but just their position to avoid them with the laser data. So I am using these lines:

   for(int it=0; it<size_cloud; it++){
           dist_obstacles=sqrt(pow(pts_laser->points[it].x-state2.pose.x,2)+pow(pts_laser->points[it].y-state2.pose.y,2)); //distancia entre 2 muestras consecutivas
     
        if(dist_obstacles <= robot_r)  {// quiero decir si el centro de mi robot esta a mas de la distancia del r significa q esta en un estado a seguro!!! y 4 metros es el mx alcance de mi laser
           
            return false;
        }
  }

where pts_laser is a pcl_pointcloud and the state2 give me the future position of the robot.
So it is a checker, if there is a point which is closer to the robot than the radius of the robot, so that state is unsafe.
This thing is not working well. So do you have a better solution or an idea??

Thanks

Nicolas

_______________________________________________
ros-users mailing list
ros-users@code.ros.org
https://code.ros.org/mailman/listinfo/ros-users




--
Bhaskara Marthi
Research Scientist
Willow Garage Inc.
650-475-2856