# saltybot_visual_odom — runtime parameters
#
# Visual odometry requires the D435i IR1 stereo pair and aligned depth:
#   /camera/infra1/image_rect_raw    — left IR image (mono8, 30 Hz)
#   /camera/depth/image_rect_raw     — depth in metres (float32, 30 Hz)
#   /camera/infra1/camera_info       — intrinsics (latched)
#
# Enable infrared emitter in realsense2_camera launch:
#   enable_infra1: true
#   enable_depth:  true
#   align_depth.enable: true

visual_odom:
  ros__parameters:
    max_features:   300     # max tracked feature points per frame
    min_features:   80      # re-detect when below this
    frame_id:       'odom'
    child_frame_id: 'camera_link'

odom_fusion:
  ros__parameters:
    fusion_hz:              30.0    # EKF update + TF publish rate
    wheel_odom_topic:       '/saltybot/rover_odom'  # or /saltybot/tank_odom
    loop_closure_thr_m:     0.30    # RTAB-Map jump threshold to trigger correction
    loop_closure_alpha:     0.40    # correction weight (0=ignore, 1=snap to RTAB-Map)
    slip_noise_multiplier:  10.0    # wheel odom noise × this factor during slip
    odom_frame:             'odom'
    base_frame:             'base_link'


# ── RTAB-Map integration note ─────────────────────────────────────────────────
# To feed the fused odometry to RTAB-Map instead of its internal VO, add to
# slam_rtabmap.launch.py rtabmap_node remappings:
#
#   remappings=[
#       ...
#       ('odom', '/saltybot/odom_fused'),
#   ]
#
# And in rtabmap_params.yaml set:
#   subscribe_odom: "true"
#   Odom/Strategy:  "0"     # F2M still used but initialised from fused pose
#
# This feeds RTAB-Map's relocalization with the EKF fused pose, reducing
# loop-closure correction magnitude on startup after wheel slip events.
