# saltybot_dynamic_obstacles — runtime parameters
#
# Requires:
#   /scan  (sensor_msgs/LaserScan)  — RPLIDAR A1M8 at ~5.5 Hz
#
# LIDAR scan is published by rplidar_ros node.
# Make sure RPLIDAR is running before starting this stack.

dynamic_obs_tracker:
  ros__parameters:
    max_tracks:          20      # max simultaneous tracked objects
    confirm_frames:       3      # hits before a track is published
    max_missed_frames:    6      # missed frames before track deletion
    assoc_dist_m:         1.5    # max assignment distance (Hungarian)
    prediction_hz:       10.0    # tracker update + publish rate
    horizon_s:            2.5    # prediction look-ahead
    pred_step_s:          0.5    # time between predicted waypoints
    odom_frame:          'odom'
    min_speed_mps:        0.05   # suppress near-stationary tracks
    max_range_m:          8.0    # ignore detections beyond this

dynamic_obs_costmap:
  ros__parameters:
    inflation_radius_m:   0.35   # safety bubble around each predicted point
    ring_points:          8      # polygon points for inflation circle
    clear_on_empty:       true   # push empty cloud to clear stale Nav2 markings


# ── Nav2 costmap integration ───────────────────────────────────────────────────
# In your nav2_params.yaml, under local_costmap or global_costmap > plugins, add
# an ObstacleLayer with:
#
#   obstacle_layer:
#     plugin: "nav2_costmap_2d::ObstacleLayer"
#     enabled: true
#     observation_sources: static_scan dynamic_obs
#     static_scan:
#       topic: /scan
#       data_type: LaserScan
#       ...
#     dynamic_obs:
#       topic: /saltybot/dynamic_obs_cloud
#       data_type: PointCloud2
#       sensor_frame: odom
#       obstacle_max_range: 10.0
#       raytrace_max_range: 10.0
#       marking: true
#       clearing: false
#
# This feeds the predicted trajectory smear directly into Nav2's obstacle
# inflation, forcing the planner to route around the predicted future path
# of every tracked moving object.
