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



#=======================================================
# Section: [ICP]
#  Parameters of ICP inside the ICP-based SLAM class
#=======================================================
[ICP]
maxIterations    = 80    // The maximum number of iterations to execute if convergence is not achieved before
minAbsStep_trans = 1e-6  // If the correction in all translation coordinates (X,Y,Z) is below this threshold (in meters), iterations are terminated:
minAbsStep_rot   = 1e-6  // If the correction in all rotation coordinates (yaw,pitch,roll) is below this threshold (in radians), iterations are terminated:

thresholdDist    = 0.3   // Initial maximum distance for matching a pair of points
thresholdAng_DEG = 5     // An angular factor (in degrees) to increase the matching distance for distant points.

ALFA             = 0.8   // After convergence, the thresholds are multiplied by this constant and ICP keep running (provides finer matching)

smallestThresholdDist=0.05 // This is the smallest the distance threshold can become after stopping ICP and accepting the result.
onlyClosestCorrespondences=true // 1: Use the closest points only, 0: Use all the correspondences within the threshold (more robust sometimes, but slower)
onlyUniqueRobust = false // Force unique correspondences in both directions when pairing two point clouds

# 0: icpClassic
# 1: icpLevenbergMarquardt
ICP_algorithm = icpClassic

# decimation to apply to the point cloud being registered against the map
# Reduce to "1" to obtain the best accuracy
corresponding_points_decimation = 5


#=======================================================
# Section: [MappingApplication]
# Use: Here comes global parameters for the app.
#=======================================================
[MappingApplication]
# The source file (RAW-LOG) with action/observation pairs
rawlog_file=../../datasets/2006-01ENE-21-SENA_Telecom Faculty_one_loop_only.rawlog
rawlog_offset=0

# The directory where the log files will be saved (left in blank if no log is required)
logOutput_dir=LOG_ICP-SLAM
LOG_FREQUENCY=50			// The frequency of log files generation:
SAVE_3D_SCENE=1
SAVE_POSE_LOG=0
CAMERA_3DSCENE_FOLLOWS_ROBOT=1
SHOW_PROGRESS_3D_REAL_TIME=1

SHOW_PROGRESS_3D_REAL_TIME_DELAY_MS=5
SHOW_LASER_SCANS_3D = true

localizationLinDistance	= 0.2	// The distance threshold for correcting odometry with ICP (meters)  
localizationAngDistance	= 5	// The distance threshold for correcting odometry with ICP (degrees)

insertionLinDistance	= 1.2	// The distance threshold for inserting observations in the map (meters)
insertionAngDistance	= 45.0	// The distance threshold for inserting observations in the map (degrees)

minICPgoodnessToAccept	= 0.40	// Minimum ICP quality to accept correction [0,1].

# Neeeded for LM method, which only supports point-map to point-map matching.
matchAgainstTheGrid = 0

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


# ====================================================
#   MULTIMETRIC MAP: PointsMap #00
# ====================================================
# Creation Options for PointsMap 00:
[MappingApplication_pointsMap_00_insertOpts]
minDistBetweenLaserPoints   = 0.05
fuseWithExisting            = false
isPlanarMap                 = 1


