"""stereo_orb.launch.py — Launch the ORB stereo visual odometry node (Issue #586)."""

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node


def generate_launch_description():
    pkg_share = get_package_share_directory('saltybot_visual_odom')
    params    = os.path.join(pkg_share, 'config', 'stereo_orb_params.yaml')

    stereo_orb_node = Node(
        package='saltybot_visual_odom',
        executable='stereo_orb',
        name='stereo_orb_vo',
        output='screen',
        parameters=[params],
        remappings=[
            # Remap to the standard RealSense D435i topic names if needed
            ('/camera/infra1/image_rect_raw', '/camera/infra1/image_rect_raw'),
            ('/camera/infra2/image_rect_raw', '/camera/infra2/image_rect_raw'),
            ('/camera/depth/image_rect_raw',  '/camera/depth/image_rect_raw'),
        ],
    )

    return LaunchDescription([stereo_orb_node])
