obstacle_detect:
  ros__parameters:
    # ── Depth processing ──────────────────────────────────────────────────────
    downsample_factor:    8       # stride-based downsample before processing
                                  # 640x480 / 8 = 80x60 = 4800 pts (fast RANSAC)

    # ── RANSAC ground plane fitting ───────────────────────────────────────────
    ransac_n_iter:        50      # RANSAC iterations
    ransac_inlier_m:      0.06    # inlier distance threshold (m)

    # ── Obstacle height filter ────────────────────────────────────────────────
    min_obstacle_h_m:     0.05    # min height above ground to count as obstacle (m)
                                  #   — avoids false positives from ground noise
    max_obstacle_h_m:     0.80    # max height above ground to count as obstacle (m)
                                  #   — ignores ceiling / upper structure (D435i ~0.5m mount)

    # ── Clustering ────────────────────────────────────────────────────────────
    cluster_cell_m:       0.30    # 2D grid cell size for BFS clustering (m)
    cluster_min_pts:      5       # minimum points for a cluster to be reported
    max_obstacle_dist_m:  5.0     # discard obstacle points beyond this forward distance

    # ── Alert / e-stop thresholds ─────────────────────────────────────────────
    danger_dist_m:        0.40    # closest obstacle z < this → DANGER alert
    warn_dist_m:          1.20    # closest obstacle z < this → WARN alert

    # ── Safety zone integration ───────────────────────────────────────────────
    # When enabled, DANGER obstacles publish zero Twist to depth_estop_topic.
    # Wire this into the cmd_vel safety chain so safety_zone can latch e-stop.
    # Typical chain:  depth_estop_topic=/cmd_vel_input  →  safety_zone  →  /cmd_vel
    depth_estop_enabled:  false
    depth_estop_topic:    /cmd_vel_input

    # ── Frame / topic configuration ───────────────────────────────────────────
    camera_frame:         camera_link    # frame_id for MarkerArray and PointCloud2
    marker_lifetime_s:    0.20           # Marker.lifetime — 0.2 s = 6 frames at 30 Hz
