# saltybot_night_vision — runtime parameters
#
# Ambient light detection requires ONE of:
#   /camera/color/image_raw         — IMX219 front camera (primary)
#   /camera/infra1/image_rect_raw   — D435i IR fallback
#
# D435i IR emitter is controlled via the realsense2_camera parameter service.
# Make sure the node is running as /camera/camera (default).
#
# GPIO headlight on physical pin 33 of the Jetson Orin Nano Super 40-pin header.
# Requires Jetson.GPIO (jetson-gpio pip package) or /sys/class/gpio write access.

light_monitor:
  ros__parameters:
    primary_camera_topic:  '/camera/color/image_raw'
    fallback_ir_topic:     '/camera/infra1/image_rect_raw'
    publish_hz:             2.0      # ambient light evaluation rate
    initial_mode:          'day'
    history_len:            6        # frames to median-filter intensity

night_vision_controller:
  ros__parameters:
    headlight_pin:         33        # physical board pin (Jetson 40-pin J26)
    day_headlight:         0.0       # off
    twilight_headlight:    0.25      # 25 % — subtle fill
    night_headlight:       0.50      # 50 % — normal dark room
    ir_only_headlight:     1.0       # 100 % — pitch black

ir_slam_bridge:
  ros__parameters:
    active_modes:   'night,ir_only'  # publish IR→RGB only in these modes
    output_encoding: 'rgb8'          # RTAB-Map expects rgb8 or bgr8


# ── RTAB-Map integration note ──────────────────────────────────────────────────
# When the bridge is active (/saltybot/ir_bridge/image_raw), redirect RTAB-Map's
# RGB input by adding to slam_rtabmap.launch.py Node remappings:
#
#   remappings=[
#       ('rgb/image',       '/saltybot/ir_bridge/image_raw'),
#       ('rgb/camera_info', '/saltybot/ir_bridge/camera_info'),
#   ]
#
# Or set the topic at launch:
#   ros2 launch saltybot_bringup slam_rtabmap.launch.py \
#       rgb_image_topic:=/saltybot/ir_bridge/image_raw
#
# This ensures loop-closure detection continues using the IR feature stream
# instead of a dark / blank colour image.
