ground segmentaiton: adjusted cluster inlier with centroid below max height of biggest cluster

This commit is contained in:
matlabbe
2018-02-18 15:30:20 -05:00
parent 07244a8a73
commit 00559ce8d6
2 changed files with 2 additions and 2 deletions
@@ -109,7 +109,7 @@ void segmentObstaclesFromGround(
{
Eigen::Vector4f centroid(0,0,0,1);
pcl::compute3DCentroid(*cloud, *clusteredFlatSurfaces.at(i), centroid);
if(maxGroundHeight==0.0f || centroid[2] <= maxGroundHeight) // epsilon
if(maxGroundHeight==0.0f || centroid[2] <= maxGroundHeight || centroid[2] <= max[2]) // epsilon
{
ground = util3d::concatenate(ground, clusteredFlatSurfaces.at(i));
}
+1 -1
View File
@@ -3360,7 +3360,7 @@ void DatabaseViewer::update(int value,
{
cloudViewer_->addCloud("ground", util3d::laserScanToPointCloud(scan), pose, QColor(ui_->lineEdit_groundColor->text()));
}
scan = LaserScan::backwardCompatibility(localMaps.begin()->second.first.first);
scan = LaserScan::backwardCompatibility(localMaps.begin()->second.first.second);
if(scan.hasRGB())
{
cloudViewer_->addCloud("obstacles", util3d::laserScanToPointCloudRGB(scan), pose, QColor(ui_->lineEdit_obstacleColor->text()));