#------------------------------------------------------
# Config file for the application PF Localization
# See: http://www.mrpt.org/list-of-mrpt-apps/application-pf-localization/
#------------------------------------------------------

#---------------------------------------------------------------------------
# Section: [KLD_options]
# Use: Options for the adaptive sample size KLD-algorithm
# Refer to paper:
# D. Fox, W. Burgard, F. Dellaert, and S. Thrun, "Monte Carlo localization:
# Efficient position estimation for mobile robots," Proc. of the
# National Conference on Artificial Intelligence (AAAI),v.113, p.114,1999.
#---------------------------------------------------------------------------
[KLD_options]
KLD_binSize_PHI_deg=10
KLD_binSize_XY=0.10
KLD_delta=0.01
KLD_epsilon=0.01
KLD_maxSampleSize=40000
KLD_minSampleSize=150
KLD_minSamplesPerBin=0   

#---------------------------------------------------------------------------
# Section: [PF_options]
# Use: The parameters for the PF algorithms
#---------------------------------------------------------------------------
[PF_options]
# The Particle Filter algorithm:
#	0: pfStandardProposal	  ***
#	1: pfAuxiliaryPFStandard
#	2: pfOptimalProposal    
#	3: pfAuxiliaryPFOptimal	  ***
#
PF_algorithm=0

# The Particle Filter Resampling method:
#	0: prMultinomial
#	1: prResidual
#	2: prStratified
#	3: prSystematic
resamplingMethod=0

# Set to 1 to enable KLD adaptive sample size:
adaptiveSampleSize=1

# Only for algorithm=3 (pfAuxiliaryPFOptimal)
pfAuxFilterOptimal_MaximumSearchSamples=10

# Resampling threshold
BETA=0.5

# Number of particles (IGNORED IN THIS APPLICATION, SUPERSEDED BY "particles_count" below)
sampleSize=1



#---------------------------------------------------------------------------
# Default "noise" parameters for odometry in observations-only rawlog formats
#---------------------------------------------------------------------------
[DummyOdometryParams]
minStdXY     = 0.15    // (meters)
minStdPHI    = 2     // (degrees)


#---------------------------------------------------------------------------
# Section: [LocalizationExperiment]
# Use: Here come global parameters for the app.
#---------------------------------------------------------------------------
[LocalizationExperiment]

# The map in the ".simplemap" format or just a ".gridmap" (the program detects the file extension)
# This map is used to localize the robot within it:
map_file=../../datasets/localization_demo.simplemap.gz

# The source file (RAW-LOG) with action/observation pairs
rawlog_file=../../datasets/localization_demo_obsformat.rawlog

# The directory where the log files will be saved (left in blank if no log is desired)
logOutput_dir=LOG_LOCALIZATION

# Freq. of 3D scene log
3DSceneFrequency=1

# The repetitions of the experiments (each one will go to a different 
# directory with the index suffix)
experimentRepetitions=1

# Initial number of particles (if dynamic sample size is enabled, the population may change afterwards).
#  You can put an array, e.g. "100 200 300", to run the experiment with different number of initial samples:
particles_count=40000

# 1: Uniform distribution over the range, 0: Uniform distribution over the free cells of the gridmap in the range:
init_PDF_mode=0
init_PDF_min_x=-10
init_PDF_max_x=10
init_PDF_min_y=-15
init_PDF_max_y=-5


SHOW_PROGRESS_3D_REAL_TIME  = true



# ====================================================
#
#            MULTIMETRIC MAP CONFIGURATION
#
# ====================================================
[MetricMap]
# Creation of maps:
occupancyGrid_count=1
gasGrid_count=0
landmarksMap_count=0
pointsMap_count=0
beaconMap_count=0

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

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

# ====================================================
#   MULTIMETRIC MAP: OccGrid #00
# ====================================================
# Creation Options for OccupancyGridMap 00:
[MetricMap_occupancyGrid_00_creationOpts]
resolution=0.06

# Insertion Options for OccupancyGridMap 00:
[MetricMap_occupancyGrid_00_insertOpts]
mapAltitude=0
useMapAltitude=0
maxDistanceInsertion=15
maxOccupancyUpdateCertainty=0.55
considerInvalidRangesAsFreeSpace=1
minLaserScanNoiseStd=0.001

# Likelihood Options for OccupancyGridMap 00:
[MetricMap_occupancyGrid_00_likelihoodOpts]
likelihoodMethod=4		// 0=MI, 1=Beam Model, 2=RSLC, 3=Cells Difs, 4=LF_Trun, 5=LF_II

LF_decimation=20
LF_stdHit=0.20
LF_maxCorrsDistance=0.30
LF_zHit=0.95
LF_zRandom=0.05
LF_maxRange=80
LF_alternateAverageMethod=0

MI_exponent=10
MI_skip_rays=10
MI_ratio_max_distance=2
				
rayTracing_useDistanceFilter=0
rayTracing_decimation=10
rayTracing_stdHit=0.30

consensus_takeEachRange=30
consensus_pow=1


