#------------------------------------------------------
# Config file for the Hierarchical Mapping Framework
#
#              ~ The MRPT Library ~
#          Jose Luis Blanco Claraco © 2005-2006
#------------------------------------------------------


#====================================================
#
#               HMT-SLAM
#
# Here come global parameters for the app.
#====================================================
[HMT-SLAM]

# The source file (RAW-LOG) with action/observation pairs

rawlog_file=/Rawlogs/2006-01ENE-21-Telecom Faculty_PLS_only.rawlog
#rawlog_file=/Rawlogs/importadosCARMEN/fr_campus.rawlog
#rawlog_file=/Rawlogs/MOOS/Jericho2006/Jericho_decimated4.rawlog
#rawlog_file=/Rawlogs/importadosCARMEN/intel.rawlog
#rawlog_file=/Rawlogs/importadosCARMEN/2002-09-11-MIT_Infinite_Corridor.rawlog
#rawlog_file=/Rawlogs/2006-10OCT-26_Sancho_Floor2.2_LARGE_2laser_icpodo.rawlog
#rawlog_file=/Rawlogs/2006-01ENE-20-Corridor2.3_many_times_to_test_ICP.rawlog

# The directory where the log files will be saved (left in blank if no log is required)
LOG_OUTPUT_DIR	= LOG_HTMSLAM_MALAGA

rawlog_offset	= 0		// Whether to skip some rawlog entries 
LOG_FREQUENCY	= 20	// The frequency of log files generation:
LOG_SHOW3D		= 1
random_seed		= 1234	// 0:Randomize, !=0:use that seed.

# --------------------------------
# Local SLAM method selection:
#   1: RBPF_2DLASER
# --------------------------------
SLAM_METHOD=1

#SLAM_MIN_DIST_BETWEEN_OBS=1.0		// Map updates threshold (meters)
#SLAM_MIN_HEADING_BETWEEN_OBS_DEG=50	// Map updates threshold (degrees)

SLAM_MIN_DIST_BETWEEN_OBS=1.25		// Map updates threshold (meters)
SLAM_MIN_HEADING_BETWEEN_OBS_DEG=30	// Map updates threshold (degrees)

MIN_ODOMETRY_STD_XY		= 0.05		// Minimum sigma in odometry increments (meters)
MIN_ODOMETRY_STD_PHI	= 2			// Minimum sigma in odometry increments (deg)

# Loop closure detectors:
# gridmaps
# images
TLC_DETECTORS=gridmaps

# ====================================================
#          TLC_GRIDMATCHING
#
#  Top. Loop-closure detector based on grid-matching
# ====================================================
[TLC_GRIDMATCHING]
featsPerSquareMeter		= 0.012

threshold_max			= 0.20 		// For considering candidate matches
threshold_delta			= 0.09

ransac_prob_good_inliers = 0.9999999999  // Prob. of a good inliers (for the number of iterations).

maxKLd_for_merge        = 0.9		// Merge of close SOG modes

min_ICP_goodness	= 0.25
max_ICP_mahadist	= 20 //10 // The maximum Mahalanobis distance between the initial and final poses in the ICP not to discard the hypothesis (default=10)

ransac_minSetSizeRatio	= 0.15 // 0.20

ransac_mahalanobisDistanceThreshold	= 6		// amRobust method only
ransac_chi2_quantile	= 0.5 				// amModifiedRANSAC method only

save_feat_coors			= 0		// Dump correspondences to grid_feats
debug_save_map_pairs	= 1		// Save the pair of maps with the best correspondences
debug_show_corrs		= 0		// Debug output of graphs


# ----------------------------------------------------------
# All the params of the feature detectors/descriptors
# ----------------------------------------------------------
featsType			= 1		// 0: KLT, 1: Harris, 3: SIFT, 4: SURF

# The feature descriptor to use: 0=detector already has descriptor, 
#  1= SIFT, 2=SURF, 4=Spin images, 8=Polar images, 16=log-polar images 
feature_descriptor		= 8

patchSize			= 0   	// Not needed

KLTOptions.min_distance		= 6			// Pixels
KLTOptions.threshold		= 0.01 // 0.10  // 0.20

harrisOptions.min_distance	= 6			// Pixels
harrisOptions.threshold 	= 0.10  // 0.20

SIFTOptions.implementation	= 3			// Hess

SURFOptions.rotation_invariant	= 1		// 0=64 dims, 1=128dims

SpinImagesOptions.hist_size_distance	= 10 
SpinImagesOptions.hist_size_intensity	= 10 
SpinImagesOptions.radius			= 20

PolarImagesOptions.bins_angle			= 8
PolarImagesOptions.bins_distance		= 6
PolarImagesOptions.radius			= 40

LogPolarImagesOptions.radius			= 20
LogPolarImagesOptions.num_angles		= 8



# ====================================================
#
#            	PARTICLE_FILTER
#
#  Parameters of the PARTICLE FILTER within each LMH,
#   invoked & implemented in CLSLAM_RBPF_2DLASER
# ====================================================
[PARTICLE_FILTER]
#----------------------------------------------------------------------------------
# The Particle Filter algorithm:
#	0: pfStandardProposal
#	1: pfAuxiliaryPFStandard
#	2: pfOptimalProposal      *** (ICP,...)
#	3: pfAuxiliaryPFOptimal	  *** (Optimal SAMPLING)
#
# See: http://babel.isa.uma.es/mrpt/index.php/Particle_Filters
#----------------------------------------------------------------------------------
PF_algorithm=3

adaptiveSampleSize	= 0		// 0: Fixed # of particles, 1: KLD adaptive

#----------------------------------------------------------------------------------
# The Particle Filter Resampling method:
#	0: prMultinomial
#	1: prResidual
#	2: prStratified
#	3: prSystematic
#
# See: /docs/html/topic_resampling.html or http://mrpt.sourceforge.net/topic_resampling.html
#----------------------------------------------------------------------------------
resamplingMethod=0
pfAuxFilterOptimal_MaximumSearchSamples = 250		// For PF algorithm=3

sampleSize	= 5		// Number of particles (for fixed number algorithms)
BETA		= 0.50	// Resampling ESS threshold	
powFactor	= 0.01			// A "power factor" for updating weights			


# ====================================================
#		GRAPH_CUT
#
#  Params for Area Abstraction (AA)
# ====================================================
[GRAPH_CUT]
partitionThreshold                    = 0.6     // In the range [0,1]. Lower gives larger clusters.
minDistForCorrespondence              = 0.50
useMapMatching                        = 1
minimumNumberElementsEachCluster      = 5

# ====================================================
#
#            MULTIMETRIC MAP CONFIGURATION
#
#  The params for creating the metric maps for 
#   each LMH.
# ====================================================
[MetricMaps]
# Creation of maps:
occupancyGrid_count			= 1
gasGrid_count				= 0
landmarksMap_count			= 0
beaconMap_count				= 0
pointsMap_count				= 1

# Selection of map for likelihood: (fuseAll=-1,occGrid=0, points=1,landmarks=2,gasGrid=3)
likelihoodMapSelection		= 0

# Enables (1) / Disables (0) insertion into specific maps:
enableInsertion_pointsMap	= 1
enableInsertion_landmarksMap= 1
enableInsertion_beaconMap	= 1
enableInsertion_gridMaps	= 1
enableInsertion_gasGridMaps	= 1

# ====================================================
#   MULTIMETRIC MAP: OccGrid #00
# ====================================================
# Creation Options for OccupancyGridMap 00:
[MetricMaps_occupancyGrid_00_creationOpts]
resolution=0.07
disableSaveAs3DObject=0


# Insertion Options for OccupancyGridMap 00:
[MetricMaps_occupancyGrid_00_insertOpts]
mapAltitude							= 0
useMapAltitude						= 0
maxDistanceInsertion				= 35
maxOccupancyUpdateCertainty			= 0.60
considerInvalidRangesAsFreeSpace	= 1
minLaserScanNoiseStd				= 0.001
horizontalTolerance					= 0.9 // In degrees

CFD_features_gaussian_size			= 3
CFD_features_median_size			= 3


# Likelihood Options for OccupancyGridMap 00:
[MetricMaps_occupancyGrid_00_likelihoodOpts]
likelihoodMethod				= 4  // 0=MI, 1=Beam Model, 2=RSLC, 3=Cells Difs, 4=LF_Thrun, 5=LF_II
LF_decimation					= 4
LF_stdHit						= 0.10
LF_maxCorrsDistance				= 0.50
LF_zHit							= 0.999
LF_zRandom						= 0.001
LF_maxRange						= 60
LF_alternateAverageMethod		= 0
enableLikelihoodCache			= 1

# ====================================================
#   MULTIMETRIC MAP: PointMap #00
# ====================================================
# Creation Options for Pointsmap 00:
# Creation Options for OccupancyGridMap 00:
[MetricMaps_PointsMap_00_creationOpts]
disableSaveAs3DObject=0

[MetricMaps_PointsMap_00_insertOpts]
minDistBetweenLaserPoints=0.05  // The minimum distance between points (in 3D): If two points are too close, one of them is not inserted into the map.
isPlanarMap=0                   // If set to true, only HORIZONTAL (i.e. XY plane) measurements will be inserted in the map. Default value is false, thus 3D maps are generated

