@@ -568,7 +568,7 @@ int main(int argc, char **argv) {
568568 indY < planarVoxelWidth) {
569569 float h1 = point.z - planarVoxelElev[planarVoxelWidth * indX + indY];
570570 if (h1 > obstacleHeightThre) {
571- planarVoxelDyObs[planarVoxelWidth * indX + indY] = 0 ;
571+ planarVoxelDyObs[planarVoxelWidth * indX + indY] = - 1 ;
572572 }
573573 }
574574 }
@@ -591,7 +591,8 @@ int main(int argc, char **argv) {
591591
592592 if (indX >= 0 && indX < planarVoxelWidth && indY >= 0 &&
593593 indY < planarVoxelWidth) {
594- if (planarVoxelDyObs[planarVoxelWidth * indX + indY] < minDyObsPointNum || !clearDyObs) {
594+ int dyObsPointNum = planarVoxelDyObs[planarVoxelWidth * indX + indY];
595+ if (dyObsPointNum < minDyObsPointNum || !clearDyObs) {
595596 float disZ =
596597 point.z - planarVoxelElev[planarVoxelWidth * indX + indY];
597598 if (considerDrop)
@@ -600,7 +601,7 @@ int main(int argc, char **argv) {
600601 planarPointElev[planarVoxelWidth * indX + indY].size ();
601602 int outOfFovPointNum = planarVoxelOutOfFov[planarVoxelWidth * indX + indY];
602603 if (disZ >= 0 && disZ < vehicleHeight && planarPointElevSize >= minBlockPointNum &&
603- (outOfFovPointNum <= 0 || outOfFovPointNum >= minOutOfFovPointNum || disZ < obstacleHeightThre )) {
604+ (outOfFovPointNum >= minOutOfFovPointNum || disZ < obstacleHeightThre || dyObsPointNum < 0 || !clearDyObs )) {
604605 terrainCloudElev->push_back (point);
605606 terrainCloudElev->points [terrainCloudElevSize].intensity = disZ;
606607
0 commit comments