Skip to content

Commit

Permalink
Merge pull request laboshinl#110 from jingpang/master
Browse files Browse the repository at this point in the history
Clear swapped point-cloud, as in primary loam
  • Loading branch information
laboshinl authored Jan 9, 2019
2 parents 0caee62 + ff1291f commit ef1b9b7
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 ef1b9b7

Please sign in to comment.