mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Added OdomLOAM/LocalMapping parameter
This commit is contained in:
@@ -65,6 +65,7 @@ private:
|
||||
float scanPeriod_;
|
||||
float linVar_;
|
||||
float angVar_;
|
||||
bool localMapping_;
|
||||
bool lost_;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -497,6 +497,7 @@ class RTABMAP_EXP Parameters
|
||||
RTABMAP_PARAM(OdomLOAM, ScanPeriod, float, 0.1, "Scan period (s)");
|
||||
RTABMAP_PARAM(OdomLOAM, LinVar, float, 0.01, "Linear output variance.");
|
||||
RTABMAP_PARAM(OdomLOAM, AngVar, float, 0.01, "Angular output variance.");
|
||||
RTABMAP_PARAM(OdomLOAM, LocalMapping, bool, true, "Local mapping. It adds more time to compute odometry, but accuracy is significantly improved.");
|
||||
|
||||
// Common registration parameters
|
||||
RTABMAP_PARAM(Reg, RepeatOnce, bool, true, "Do a second registration with the output of the first registration as guess. Only done if no guess was provided for the first registration (like on loop closure). It can be useful if the registration approach used can use a guess to get better matches.");
|
||||
|
||||
@@ -49,6 +49,7 @@ OdometryLOAM::OdometryLOAM(const ParametersMap & parameters) :
|
||||
,scanPeriod_(Parameters::defaultOdomLOAMScanPeriod())
|
||||
,linVar_(Parameters::defaultOdomLOAMLinVar())
|
||||
,angVar_(Parameters::defaultOdomLOAMAngVar())
|
||||
,localMapping_(Parameters::defaultOdomLOAMLocalMapping())
|
||||
,lost_(false)
|
||||
#endif
|
||||
{
|
||||
@@ -61,6 +62,7 @@ OdometryLOAM::OdometryLOAM(const ParametersMap & parameters) :
|
||||
UASSERT(linVar_>0.0f);
|
||||
Parameters::parse(parameters, Parameters::kOdomLOAMAngVar(), angVar_);
|
||||
UASSERT(angVar_>0.0f);
|
||||
Parameters::parse(parameters, Parameters::kOdomLOAMLocalMapping(), localMapping_);
|
||||
if(velodyneType == 1)
|
||||
{
|
||||
scanMapper_ = loam::MultiScanMapper::Velodyne_HDL_32();
|
||||
@@ -230,11 +232,14 @@ Transform OdometryLOAM::computeTransform(
|
||||
laserOdometry_->updateIMU(imuTrans);
|
||||
laserOdometry_->process();
|
||||
|
||||
laserMapping_->laserCloudCornerLast() = *laserOdometry_->lastCornerCloud();
|
||||
laserMapping_->laserCloudSurfLast() = *laserOdometry_->lastSurfaceCloud();
|
||||
laserMapping_->laserCloud() = *laserOdometry_->laserCloud();
|
||||
laserMapping_->updateOdometry(laserOdometry_->transformSum());
|
||||
laserMapping_->process(scanTime);
|
||||
if(localMapping_)
|
||||
{
|
||||
laserMapping_->laserCloudCornerLast() = *laserOdometry_->lastCornerCloud();
|
||||
laserMapping_->laserCloudSurfLast() = *laserOdometry_->lastSurfaceCloud();
|
||||
laserMapping_->laserCloud() = *laserOdometry_->laserCloud();
|
||||
laserMapping_->updateOdometry(laserOdometry_->transformSum());
|
||||
laserMapping_->process(scanTime);
|
||||
}
|
||||
|
||||
transformMaintenance_.updateOdometry(
|
||||
laserOdometry_->transformSum().rot_x.rad(),
|
||||
|
||||
Reference in New Issue
Block a user