from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
    return LaunchDescription([
        DeclareLaunchArgument('output_namespace', default_value='/viz'),
        DeclareLaunchArgument('input_fps_limit', default_value='30.0'),
        DeclareLaunchArgument('output_fps', default_value='10.0'),
        DeclareLaunchArgument('voxel_size_m', default_value='0.05'),
        DeclareLaunchArgument('max_points', default_value='100000'),
        Node(
            package='ros_viz_adapter', executable='adapter',
            name='ros_viz_adapter', output='screen',
            parameters=[{
                'output_namespace': LaunchConfiguration('output_namespace'),
                'input_fps_limit': LaunchConfiguration('input_fps_limit'),
                'output_fps': LaunchConfiguration('output_fps'),
                'voxel_size_m': LaunchConfiguration('voxel_size_m'),
                'max_points': LaunchConfiguration('max_points'),
            }],
        ),
    ])
