from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
from launch.substitutions import LaunchConfiguration
from launch.conditions import IfCondition

def generate_launch_description():
    return LaunchDescription([
        # 启动orbbec_camera
        ExecuteProcess(
            cmd=[
                'ros2',
                'launch',
                'game_pad',
                'game_pad.launch.py'
            ],
            output='screen'
        ),

        ExecuteProcess(
            cmd=[
                'ros2',
                'launch',
                'voice_control',
                'voice_control.launch.py'
            ],
            output='screen'
        ),

        
        # 等待一段时间确保相机启动完成
        ExecuteProcess(
            cmd=['sleep', '3'],
            output='screen'
        ),
        
        # 启动input_dev_node
        Node(
            package='input_dev',
            executable='input_dev_node',
            name='input_dev_node',
            output='screen',
            parameters=[]
        )
    ])

