#------------------------------------------------------------
# Config file for the "RBPF-SLAM" application
# See: http://www.mrpt.org/list-of-mrpt-apps/application-rbpf-slam/
#------------------------------------------------------------

#=======================================================
# Section: [MappingApplication]
# Use: Here comes global parameters for the app.
#=======================================================
[MappingApplication]

# The source file (RAW-LOG) with action/observation pairs
rawlog_file=../datasets/2006-12DEC-18-JavierOffice_2laser_2enoses.rawlog
# How many entries to skip at the beginning of the file:
rawlog_offset=0   

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

# The frequency of log files generation:
LOG_FREQUENCY=10

# Options:
GENERATE_LOG_JOINT_H=0
GENERATE_LOG_INFO=0
SAVE_3D_SCENE=1
SAVE_POSE_LOG=0
SAVE_MAP_IMAGES=1
SAVE_ENOSE_READINGS=0
CAMERA_3DSCENE_FOLLOWS_ROBOT=0
SHOW_PROGRESS_IN_WINDOW=0

insertionLinDistance=0.10	// The distance threshold for inserting observations in the map (meters)
insertionAngDistance_deg=10	// The distance threshold for inserting observations in the map (degrees)


#----------------------------------------------------------------------------------
# The Particle Filter algorithm:
#	0: pfStandardProposal
#	1: pfAuxiliaryPFStandard
#	2: pfOptimalProposal      *** (ICP,...)
#	3: pfAuxiliaryPFOptimal	  *** (Optimal Aux)
#
# See: /docs/html/topic_pf.html  or http://mrpt.sourceforge.net/topic_pf.html
#----------------------------------------------------------------------------------
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=3

sampleSize=15			// Sample size (for fixed number)
BETA=0.50			// Resampling ESS threshold


# ========================================================
#            MULTIMETRIC MAP CONFIGURATION
# See docs for (Google for) mrpt::maps::CMultiMetricMap
# ========================================================
# Creation of maps:
occupancyGrid_count=2
gasGrid_count=1
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=0

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


# ====================================================
#         CHybridMetricMapPDF::TPredictionParams
# ====================================================
powFactor=0.01				// A "power factor" for updating weights
pfAuxFilterOptimal_MaximumSearchSamples=600	// For PF algorithm=3

# -----------------------------------------------------------------
#   pfOptimalProposal_mapSelection
#  Only for PF algorithm=2 (Exact "pfOptimalProposal")
#   Select the map on which to calculate the optimal 
#    proposal distribution. Values:
#   0: Gridmap   -> Uses Scan matching-based approximation (based on Stachniss' work)
#   1: Landmarks -> Uses matching to approximate optimal
#   2: Beacons   -> Used for exact optimal proposal in RO-SLAM
# -----------------------------------------------------------------
pfOptimalProposal_mapSelection=2

# Adaptive sample size parameters ------------------
KLD_maxSampleSize=10000
KLD_minSampleSize=15
KLD_binSize_XY=10.00
KLD_binSize_PHI_deg=30
KLD_delta=0.01
KLD_epsilon=0.40


# ====================================================
#   MULTIMETRIC MAP: OccGrid #00
# ====================================================
# Creation Options for OccupancyGridMap 00:
[MappingApplication_occupancyGrid_00_creationOpts]
resolution=0.03
disableSaveAs3DObject=0		// =1 ->Save the gas grid map only!

# Insertion Options for OccupancyGridMap 00:
[MappingApplication_occupancyGrid_00_insertOpts]
mapAltitude=0.31
useMapAltitude=1
maxDistanceInsertion=25
maxOccupancyUpdateCertainty=0.52
considerInvalidRangesAsFreeSpace=1
minLaserScanNoiseStd=0.001

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

LF_decimation=7
LF_stdHit=0.10
LF_maxCorrsDistance=0.30
LF_zHit=0.999
LF_zRandom=0.001
LF_maxRange=30
LF_alternateAverageMethod=0

# ====================================================
#   MULTIMETRIC MAP: OccGrid #01
# ====================================================
# Creation Options for OccupancyGridMap 01:
[MappingApplication_occupancyGrid_01_creationOpts]
resolution=0.03
disableSaveAs3DObject=0		// =1 ->Save the gas grid map only!

# Insertion Options for OccupancyGridMap 01:
[MappingApplication_occupancyGrid_01_insertOpts]
mapAltitude=0.27
useMapAltitude=1
maxDistanceInsertion=25
maxOccupancyUpdateCertainty=0.52
considerInvalidRangesAsFreeSpace=1
minLaserScanNoiseStd=0.001

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

LF_decimation=3
LF_stdHit=0.10
LF_maxCorrsDistance=0.30
LF_zHit=0.999
LF_zRandom=0.001
LF_maxRange=30
LF_alternateAverageMethod=0


# ====================================================
#   MULTIMETRIC MAP: GasMap #00
# ====================================================
# Creation Options for CGasConcentrationGridMap2D 00:
 [MappingApplication_gasGrid_00_creationOpts]
 mapType=1   // 0: mrAchin, 1: mrKalman  - See CGasConcentrationGridMap2D::CGasConcentrationGridMap2D
 min_x=-2
 max_x=2
 min_y=-2
 max_y=2
 resolution=0.20

 // Insertion Options for CGasConcentrationGridMap2D 00:
 [MappingApplication_gasGrid_00_insertOpts]
sigma=0.10   		// The sigma of the "Parzen"-kernel Gaussian. 
cutoffRadius=0.30 	// The cutoff radius for updating cells. 
R_min=0 			// Limits for normalization of sensor readings. 
R_max=5

KF_covSigma=0.35		// [KF model] The "sigma" for the initial covariance value between cells (in meters). 
KF_initialCellStd=1.0 	// [KF model] The initial standard deviation of each cell's concentration (will be stored both at each cell's structure and in the covariance matrix as variances in the diagonal) (in normalized concentration units). 
KF_observationModelNoise=0.25 	// [KF model] The sensor model noise (in normalized concentration units). 
KF_defaultCellMeanValue=0.25 	

