mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
util3d: added bool segmentFlatObstacles (default false) parameter to segmentObstaclesFromGround() method
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1980 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -146,7 +146,8 @@ void segmentObstaclesFromGround(
|
|||||||
pcl::IndicesPtr & obstacles,
|
pcl::IndicesPtr & obstacles,
|
||||||
float normalRadiusSearch,
|
float normalRadiusSearch,
|
||||||
float groundNormalAngle,
|
float groundNormalAngle,
|
||||||
int minClusterSize)
|
int minClusterSize,
|
||||||
|
bool segmentFlatObstacles)
|
||||||
{
|
{
|
||||||
ground.reset(new std::vector<int>);
|
ground.reset(new std::vector<int>);
|
||||||
obstacles.reset(new std::vector<int>);
|
obstacles.reset(new std::vector<int>);
|
||||||
@@ -159,6 +160,8 @@ void segmentObstaclesFromGround(
|
|||||||
normalRadiusSearch*2.0f,
|
normalRadiusSearch*2.0f,
|
||||||
Eigen::Vector4f(0,0,100,0));
|
Eigen::Vector4f(0,0,100,0));
|
||||||
|
|
||||||
|
if(segmentFlatObstacles)
|
||||||
|
{
|
||||||
int biggestFlatSurfaceIndex;
|
int biggestFlatSurfaceIndex;
|
||||||
std::vector<pcl::IndicesPtr> clusteredFlatSurfaces = util3d::extractClusters<PointT>(
|
std::vector<pcl::IndicesPtr> clusteredFlatSurfaces = util3d::extractClusters<PointT>(
|
||||||
cloud,
|
cloud,
|
||||||
@@ -186,6 +189,11 @@ void segmentObstaclesFromGround(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ground = flatSurfaces;
|
||||||
|
}
|
||||||
|
|
||||||
if(ground->size() != cloud->size())
|
if(ground->size() != cloud->size())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -597,7 +597,8 @@ void segmentObstaclesFromGround(
|
|||||||
pcl::IndicesPtr & obstacles,
|
pcl::IndicesPtr & obstacles,
|
||||||
float normalRadiusSearch,
|
float normalRadiusSearch,
|
||||||
float groundNormalAngle,
|
float groundNormalAngle,
|
||||||
int minClusterSize);
|
int minClusterSize,
|
||||||
|
bool segmentFlatObstacles = false);
|
||||||
|
|
||||||
template<typename PointT>
|
template<typename PointT>
|
||||||
void projectCloudOnXYPlane(
|
void projectCloudOnXYPlane(
|
||||||
|
|||||||
Reference in New Issue
Block a user