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

import os


def generate_launch_description():
    default_config = os.path.join(
        get_package_share_directory('origincar_birdseye'),
        'config',
        'birdseye_defaults.yaml')
    return LaunchDescription([
        DeclareLaunchArgument(
            'birdseye_config',
            default_value=default_config,
            description='Birdseye node ROS parameter YAML'),
        Node(
            package='origincar_birdseye',
            executable='birdseye_node',
            name='birdseye_node',
            output='screen',
            parameters=[LaunchConfiguration('birdseye_config')])
    ])
