# ------------------------------------------------------------------------
# Example configuration file for MRPT Reactive Navigation engine.
# See C++ documentation: http://reference.mrpt.org/svn/classmrpt_1_1nav_1_1_c_reactive_navigation_system.html
# See ROS node documentation: http://wiki.ros.org/mrpt_reactivenav2d
# ------------------------------------------------------------------------

[GLOBAL_CONFIG]
# 0: Virtual Force Field
# 1: Nearness Diagram (ND)
HOLONOMIC_METHOD=1

ALARM_SEEMS_NOT_APPROACHING_TARGET_TIMEOUT=100    # (seconds)

#	Parameters for the "Nearness diagram" Holonomic method
# ----------------------------------------------------
[ND_CONFIG]
factorWeights=1.0 0.5 2.0 0.5
# 1: Free space
# 2: Dist. in sectors
# 3: Closer to target (euclidean)
# 4: Hysteresis
WIDE_GAP_SIZE_PERCENT            = 0.25
MAX_SECTOR_DIST_FOR_D2_PERCENT   = 0.25
RISK_EVALUATION_SECTORS_PERCENT  = 0.25
RISK_EVALUATION_DISTANCE         = 0.5  # In normalized ps-meters [0,1]
TARGET_SLOW_APPROACHING_DISTANCE = 0.8	# For stop gradually
TOO_CLOSE_OBSTACLE               = 0.03 # In normalized ps-meters

#	Parameters for the "VFF" Holonomic method
# ----------------------------------------------------
[VFF_CONFIG]
# Used to decrease speed gradually when the target is going to be reached
TARGET_SLOW_APPROACHING_DISTANCE = 0.8	
# Use it to control the relative weight of the target respect to the obstacles
TARGET_ATTRACTIVE_FORCE = 7.5

# ----------------------------------------------------
#	Parameters for navigation
# ----------------------------------------------------
[ReactiveParams]
weights=0.5 0.05 0.5 2.0 0.2 0.1
# 1: Free space
# 2: Dist. in sectors			
# 3: Heading toward target
# 4: Closer to target (euclidean)
# 5: Hysteresis
# 6: Security Distance

DIST_TO_TARGET_FOR_SENDING_EVENT=0.6	# Minimum. distance to target for sending the end event. Set to 0 to send it just on navigation end

MinObstaclesHeight=0.0 		# Minimum coordinate in the "z" axis for an obstacle to be taken into account.
MaxObstaclesHeight=1.40 	# Maximum coordinate in the "z" axis for an obstacle to be taken into account.

robotMax_V_mps   = 1.0		# Speed limits
robotMax_W_degps = 60

MAX_REFERENCE_DISTANCE  = 8.0       # Maximum distance to build PTGs (in meters), i.e. the visibility "range" of tentative paths
LUT_CELL_SIZE           = 0.05      # Look-up-table cell size, or resolution (in meters)

# The constant time of a first-order low-pass filter of outgoing speed commands, 
# i.e. can be used to impose a maximum acceleration.
SPEEDFILTER_TAU         = 0         

# PTGs: See classes derived from mrpt::nav::CParameterizedTrajectoryGenerator ( http://reference.mrpt.org/svn/classmrpt_1_1nav_1_1_c_parameterized_trajectory_generator.html)# refer to papers for details.
#------------------------------------------------------------------------------
# Types:
# 1 - Circular arcs \n"
# 2 - alpha - A, Trajectories with asymptotical heading
# 3 - C|C,S, R = vmax/wmax, Trajectories to move backward and then forward
# 4 - C|C,s, like PTG 3, but if t > threshold -> v = w = 0
# 5 - CS, Trajectories with a minimum turning radius
# 6 - alpha - SP, Trajectories built upon a spiral segment

PTG_COUNT      = 3

PTG0_Type      = 1
PTG0_nAlfas    = 121
PTG0_v_max_mps = 1.0
PTG0_w_max_gps = 60
PTG0_K         = 1.0

PTG1_Type        = 2
PTG1_nAlfas      = 121
PTG1_v_max_mps   = 1.0
PTG1_w_max_gps   = 60
PTG1_cte_a0v_deg = 57
PTG1_cte_a0w_deg = 57

PTG2_Type      = 1
PTG2_nAlfas    = 121
PTG2_v_max_mps = 1.0
PTG2_w_max_gps = 60
PTG2_K         = -1.0


# Default 2D robot shape for collision checks: (ignored in ROS, superseded by node parameters)
RobotModel_shape2D_xs=-0.2 0.5 0.5 -0.2
RobotModel_shape2D_ys=0.3 0.3 -0.3 -0.3

ROBOTMODEL_DELAY=0  # (un-used param, must be present for compat. with old mrpt versions)
ROBOTMODEL_TAU=0 # (un-used param, must be present for compat. with old mrpt versions)
