Quantcast

Point cloud coordinate system and SAC model

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Point cloud coordinate system and SAC model

Luxabor
This post has NOT been accepted by the mailing list yet.
Hi everyone!
I'm a new PCL user and I'm facing a problem trying to estimate a plane model in my point cloud. I want to automatically identify the floor in different clouds, so I thought that SACMODEL_PERPENDICULAR_PLANE or SACMODEL_PARALLEL_PLANE would be perfect. However notice that the coordinate system visualized by pcl visualizer and  the floor are not "aligned" (coordinate system plane z0x not parallel to the floor => y axis not perpendicular to the floor).
How should I properly use the method setAxis? Particularly strange is the fact that in many of the tested clouds it works correctly if i set it as setAxis(Eigen::Vector3f(0,0,0)), but in other cases it first finds a vertical plane instead of the horizontal one.
Can someone explain me why does it work with that values?  This is the snippet:

  pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients ());
  pcl::PointIndices::Ptr inliers (new pcl::PointIndices ());
  pcl::SACSegmentation<PointT> seg;
  seg.setOptimizeCoefficients (true);
  seg.setModelType (pcl::SACMODEL_PARALLEL_PLANE);
  seg.setMethodType (pcl::SAC_RANSAC);
  seg.setMaxIterations(1000);
  seg.setDistanceThreshold (0.01);
  seg.setAxis(Eigen::Vector3f(0,0,0));
  seg.setEpsAngle (0.05);
Loading...