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

def generate_launch_description():
    return LaunchDescription([
        DeclareLaunchArgument(
            'use_sim_time',
            default_value='false',
            description='是否使用模拟时间'
        ),
        DeclareLaunchArgument(
            'rotation_time',
            default_value='10.0',
            description='旋转一圈的目标时间(秒)'
        ),
        Node(
            package='mujoco_simulation',
            executable='mujoco_sim_node',
            name='mujoco_sim_node',
            output='screen',
            parameters=[
                {'use_sim_time': LaunchConfiguration('use_sim_time')},
                {'rotation_time': LaunchConfiguration('rotation_time')}
            ]
        )
    ])
