velocity_smoother:
  ros__parameters:
    use_sim_time: False
    smoothing_frequency: 20.0
    scale_velocities: False
    feedback: "OPEN_LOOP"
    max_velocity: [0.3, 0.0, 0.5]
    min_velocity: [-0.3, 0.0, -0.5]
    max_accel: [2.5, 0.0, 3.2]
    max_decel: [-2.5, 0.0, -3.2]
    odom_topic: "odom"

behavior_server:
  ros__parameters:
    local_frame: base_link
    global_frame: odom
    odom_frame: odom
    use_sim_time: False
    device_id: "robot"
    simulate_ahead_time: 2.0

bt_navigator:
  ros__parameters:
    use_sim_time: False
    global_frame: odom
    robot_base_frame: base_link
    odom_topic: /odom
    # 빈 문자열로 두면 Nav2가 기본 트리를 자동으로 찾아줄 거라 가정했었으나, 실측
    # 결과 "Empty Tree" 예외로 즉시 실패함(doc/07 Phase 1) - 표준 기본 트리 경로를
    # 명시적으로 지정한다.
    default_nav_to_pose_bt_xml: "/opt/ros/humble/share/nav2_bt_navigator/behavior_trees/navigate_to_pose_w_replanning_and_recovery.xml"
    default_nav_through_poses_bt_xml: "/opt/ros/humble/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_and_recovery.xml"
    bt_loop_duration: 10
    default_server_timeout: 20
    wait_for_service_timeout: 1000

controller_server:
  ros__parameters:
    use_sim_time: False
    controller_frequency: 20.0
    progress_checker_plugin: "progress_checker"
    goal_checker_plugins: ["general_goal_checker"]
    controller_plugins: ["FollowPath"]
    progress_checker:
      plugin: "nav2_controller::SimpleProgressChecker"
      required_movement_radius: 0.1
      movement_time_allowance: 30.0
    general_goal_checker:
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 0.30
      yaw_goal_tolerance: 0.35
    FollowPath:
      plugin: "nav2_regulated_pure_pursuit_controller::RegulatedPurePursuitController"
      desired_linear_vel: 0.3
      lookahead_dist: 0.6
      min_lookahead_dist: 0.3
      max_lookahead_dist: 0.9
      use_rotate_to_heading: True
      rotate_to_heading_min_angle: 0.20
      max_angular_vel: 0.5
      min_tc_velocity: 0.1
      regulated_linear_scaling_min_speed: 0.15

local_costmap:
  local_costmap:
    ros__parameters:
      update_frequency: 5.0
      publish_frequency: 2.0
      global_frame: odom
      robot_base_frame: base_link
      use_sim_time: False
      transform_tolerance: 1.0
      rolling_window: true
      width: 3
      height: 3
      resolution: 0.05
      robot_radius: 0.38
      plugins: ["obstacle_layer", "inflation_layer"]
      obstacle_layer:
        plugin: "nav2_costmap_2d::ObstacleLayer"
        enabled: True
        observation_sources: scan
        scan:
          topic: /scan
          max_obstacle_height: 2.0
          clearing: True
          marking: True
          data_type: "LaserScan"
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        inflation_radius: 0.15

global_costmap:
  global_costmap:
    ros__parameters:
      update_frequency: 1.0
      publish_frequency: 1.0
      # 순수 SLAM 모드(사전 맵/AMCL 없음): map_server가 없으므로 static_layer 제거,
      # fast_lio가 주는 odom 프레임을 기준으로 롤링 윈도우 형태로 동작.
      global_frame: odom
      robot_base_frame: base_link
      use_sim_time: False
      transform_tolerance: 1.0
      robot_radius: 0.38
      rolling_window: true
      width: 15
      height: 15
      resolution: 0.1
      plugins: ["obstacle_layer", "inflation_layer"]
      obstacle_layer:
        plugin: "nav2_costmap_2d::ObstacleLayer"
        observation_sources: scan
        scan:
          topic: /scan
          data_type: "LaserScan"
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        inflation_radius: 0.15

planner_server:
  ros__parameters:
    use_sim_time: False
    planner_plugins: ["GridBased"]
    GridBased:
      plugin: "nav2_smac_planner/SmacPlanner2D"
      tolerance: 0.5
      downsample_costmap: false
      allow_unknown: true
      max_iterations: 1000000
      max_planning_time: 2.0
      motion_model_for_search: "2D"
      angle_quantization_binned: 72
      minimum_turning_radius: 0.0
