"""multi_person_tracker.launch.py — Launch file for multi-person tracking (Issue #423)."""

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


def generate_launch_description():
    """Generate launch description for multi-person tracker."""

    # Declare launch arguments
    config_arg = DeclareLaunchArgument(
        "config_file",
        default_value=os.path.join(
            get_package_share_directory("saltybot_multi_person_tracker"),
            "config",
            "multi_person_tracker_params.yaml",
        ),
        description="Path to multi-person tracker parameters YAML file",
    )

    # Multi-person tracker node
    tracker_node = Node(
        package="saltybot_multi_person_tracker",
        executable="multi_person_tracker_node",
        name="multi_person_tracker_node",
        parameters=[LaunchConfiguration("config_file")],
        remappings=[],
        output="screen",
    )

    return LaunchDescription(
        [
            config_arg,
            tracker_node,
        ]
    )
