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


def generate_launch_description():
    pkg_dir = get_package_share_directory('saltybot_remote_monitor')
    config_file = os.path.join(pkg_dir, 'config', 'remote_monitor.yaml')

    remote_monitor_node = Node(
        package='saltybot_remote_monitor',
        executable='remote_monitor',
        name='remote_monitor',
        parameters=[config_file],
        output='screen',
        respawn=True,
        respawn_delay=5,
    )

    return LaunchDescription([
        remote_monitor_node,
    ])
