Added OdomLOAM/Resolution parameter

This commit is contained in:
matlabbe
2021-09-22 10:48:59 -04:00
parent cff0d15460
commit 5f65618d40
6 changed files with 111 additions and 69 deletions

View File

@@ -535,6 +535,7 @@ class RTABMAP_EXP Parameters
// Odometry LOAM
RTABMAP_PARAM(OdomLOAM, Sensor, int, 2, "Velodyne sensor: 0=VLP-16, 1=HDL-32, 2=HDL-64E");
RTABMAP_PARAM(OdomLOAM, ScanPeriod, float, 0.1, "Scan period (s)");
RTABMAP_PARAM(OdomLOAM, Resolution, float, 0.2, "Map resolution");
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.");

View File

@@ -60,7 +60,7 @@ OdometryFLOAM::OdometryFLOAM(const ParametersMap & parameters) :
float scan_period= Parameters::defaultOdomLOAMScanPeriod();
float max_dis = Parameters::defaultIcpRangeMax();
float min_dis = Parameters::defaultIcpRangeMin();
float map_resolution = Parameters::defaultIcpVoxelSize();
float map_resolution = Parameters::defaultOdomLOAMResolution();
linVar_ = Parameters::defaultOdomLOAMLinVar();
angVar_ = Parameters::defaultOdomLOAMAngVar();
@@ -68,7 +68,7 @@ OdometryFLOAM::OdometryFLOAM(const ParametersMap & parameters) :
Parameters::parse(parameters, Parameters::kOdomLOAMScanPeriod(), scan_period);
Parameters::parse(parameters, Parameters::kIcpRangeMax(), max_dis);
Parameters::parse(parameters, Parameters::kIcpRangeMin(), min_dis);
Parameters::parse(parameters, Parameters::kIcpVoxelSize(), map_resolution);
Parameters::parse(parameters, Parameters::kOdomLOAMResolution(), map_resolution);
UASSERT(scan_period>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMLinVar(), linVar_);

View File

@@ -52,10 +52,13 @@ OdometryLOAM::OdometryLOAM(const ParametersMap & parameters) :
#endif
{
#ifdef RTABMAP_LOAM
int velodyneType = 0;
int velodyneType = Parameters::defaultOdomLOAMSensor();
float mapResolution = Parameters::defaultOdomLOAMResolution();
Parameters::parse(parameters, Parameters::kOdomLOAMSensor(), velodyneType);
Parameters::parse(parameters, Parameters::kOdomLOAMScanPeriod(), scanPeriod_);
UASSERT(scanPeriod_>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMResolution(), mapResolution);
UASSERT(mapResolution>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMLinVar(), linVar_);
UASSERT(linVar_>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMAngVar(), angVar_);
@@ -75,6 +78,8 @@ OdometryLOAM::OdometryLOAM(const ParametersMap & parameters) :
}
laserOdometry_ = new loam::BasicLaserOdometry(scanPeriod_);
laserMapping_ = new loam::BasicLaserMapping(scanPeriod_);
laserMapping_->downSizeFilterCorner().setLeafSize(mapResolution, mapResolution, mapResolution);
laserMapping_->downSizeFilterSurf().setLeafSize(mapResolution*2.0f, mapResolution*2.0f, mapResolution*2.0f);
#endif
}