from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import TimerAction

def generate_launch_description():
    # 创建节点启动描述
    keyboard_control_node = Node(
        package='keyboard_control',  # 功能包名称
        executable='keyboard_control_node',  # 可执行文件名称
        name='keyboard_control_node',  # 节点名称（可自定义）
        output='screen',  # 输出到屏幕
        emulate_tty=True,  # 模拟终端
    )

    start_keyboard_control_node = TimerAction(
        period=1.0,
        actions=[keyboard_control_node],
    )
    
    # 组装launch描述
    return LaunchDescription([
        start_keyboard_control_node
    ])
