[ros-users] Obstacles Detection with laser data

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
+ (text/html)
Slet denne besked
Besvar denne besked
Skribent: User discussions
Dato:  
Til: ros-users
Emne: [ros-users] Obstacles Detection with laser data

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