Skip to content

Commit

Permalink
Clear swapped point-cloud, as in primary loam
Browse files Browse the repository at this point in the history
  • Loading branch information
jing committed Jan 4, 2019
1 parent 0caee62 commit ff1291f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib/BasicLaserMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ bool BasicLaserMapping::process(Time const& laserOdometryTime)
std::swap(_laserCloudCornerArray[indexA], _laserCloudCornerArray[indexB]);
std::swap(_laserCloudSurfArray[indexA], _laserCloudSurfArray[indexB]);
}
const size_t indexC = toIndex(0, j, k);
_laserCloudCornerArray[indexC]->clear();
_laserCloudSurfArray[indexC]->clear();
}
}
centerCubeI++;
Expand All @@ -340,6 +343,9 @@ bool BasicLaserMapping::process(Time const& laserOdometryTime)
std::swap(_laserCloudCornerArray[indexA], _laserCloudCornerArray[indexB]);
std::swap(_laserCloudSurfArray[indexA], _laserCloudSurfArray[indexB]);
}
const size_t indexC = toIndex(_laserCloudWidth - 1, j, k);
_laserCloudCornerArray[indexC]->clear();
_laserCloudSurfArray[indexC]->clear();
}
}
centerCubeI--;
Expand All @@ -359,6 +365,9 @@ bool BasicLaserMapping::process(Time const& laserOdometryTime)
std::swap(_laserCloudCornerArray[indexA], _laserCloudCornerArray[indexB]);
std::swap(_laserCloudSurfArray[indexA], _laserCloudSurfArray[indexB]);
}
const size_t indexC = toIndex(i, 0, k);
_laserCloudCornerArray[indexC]->clear();
_laserCloudSurfArray[indexC]->clear();
}
}
centerCubeJ++;
Expand All @@ -378,6 +387,9 @@ bool BasicLaserMapping::process(Time const& laserOdometryTime)
std::swap(_laserCloudCornerArray[indexA], _laserCloudCornerArray[indexB]);
std::swap(_laserCloudSurfArray[indexA], _laserCloudSurfArray[indexB]);
}
const size_t indexC = toIndex(i, _laserCloudHeight - 1, k);
_laserCloudCornerArray[indexC]->clear();
_laserCloudSurfArray[indexC]->clear();
}
}
centerCubeJ--;
Expand All @@ -397,6 +409,9 @@ bool BasicLaserMapping::process(Time const& laserOdometryTime)
std::swap(_laserCloudCornerArray[indexA], _laserCloudCornerArray[indexB]);
std::swap(_laserCloudSurfArray[indexA], _laserCloudSurfArray[indexB]);
}
const size_t indexC = toIndex(i, j, 0);
_laserCloudCornerArray[indexC]->clear();
_laserCloudSurfArray[indexC]->clear();
}
}
centerCubeK++;
Expand All @@ -416,6 +431,9 @@ bool BasicLaserMapping::process(Time const& laserOdometryTime)
std::swap(_laserCloudCornerArray[indexA], _laserCloudCornerArray[indexB]);
std::swap(_laserCloudSurfArray[indexA], _laserCloudSurfArray[indexB]);
}
const size_t indexC = toIndex(i, j, _laserCloudDepth - 1);
_laserCloudCornerArray[indexC]->clear();
_laserCloudSurfArray[indexC]->clear();
}
}
centerCubeK--;
Expand Down

0 comments on commit ff1291f

Please sign in to comment.