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


#=======================================================
# Section: [icp_graphslam]
#=======================================================
[icp_graphslam]
#rawlog_offset=0   // Optional: skip to a given part of dataset

logOutput_dir                        = LOG_ICP-GRAPH-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           = true
SHOW_PROGRESS_3D_REAL_TIME_DELAY_MS  = 50
SHOW_LASER_SCANS_3D                  = true

# ====================================================
#
#            MULTIMETRIC MAP CONFIGURATION
#
# ====================================================
# Creation of maps:
occupancyGrid_count=0
gasGrid_count=0
pointsMap_count=1

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




# ====================================================
#  icp_graphslam_update_decider 
# ====================================================
[icp_graphslam_update_decider]
verbose = true

new_kf_min_distance_xy  = 0.35    // Minimum distance (X,Y) between KeyFrames (in meters)
new_kf_min_angle        = 30.0   // Minimum angle between KeyFrames (in degrees)


# ====================================================
#  icp_graphslam_f2f_match
# ====================================================
[icp_graphslam_f2f_match]
verbose = true

kf2kf_max_search_radius    = 3.0    // Maximum radius for search of candidate KFs to loop closure / edge creation (meters).
minICP_goodness_to_accept  = 0.40   // in [0,1]: Minimum ICP scan matching overlap to accept a registration as valid.
consistency_max_delta_norm = 1.3   // Maximum delta from expected-to-registered to accept edge as valid.


#  Parameters of the ICP method itself, inside the Frame-to-Frame match module
# -----------------------------------------------------------------------------
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    = 1.00   // Initial maximum distance for matching a pair of points
thresholdAng_DEG = 7     // An angular factor (in degrees) to increase the matching distance for distant points.

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

smallestThresholdDist=0.10 // 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)

# 0: icpClassic
# 1: icpLevenbergMarquardt
ICP_algorithm = icpLevenbergMarquardt

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

