from setuptools import setup, find_packages
import os
from glob import glob

package_name = 'soft_arm_sim'

setup(
    name=package_name,
    version='0.0.0',
    # 自动查找所有包含 __init__.py 的子包
    packages=find_packages(exclude=['test']),
    data_files=[
        ('share/ament_index/resource_index/packages',
            ['resource/' + package_name]),
        ('share/' + package_name, ['package.xml']),
        
        # 1. 安装 launch 文件
        (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')),
        
        # 2. 安装 urdf 文件 (非常重要，否则 robot_state_publisher 找不到模型)
        (os.path.join('share', package_name, 'urdf'), glob('urdf/*')),

        # 3. 配置文件安装
        (os.path.join('share', package_name, 'config'), glob('config/*.yaml')),
    ],
    install_requires=['setuptools'],
    zip_safe=True,
    maintainer='mio',
    maintainer_email='user@todo.todo',
    description='Soft Robot Arm Simulation',
    license='TODO: License declaration',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            # 格式: '可执行文件名 = 包名.路径.文件名:函数名'
            
            # 仿真核心节点 (对应 base/simulation_node.py 中的 main 函数)
            'simulator = soft_arm_sim.base.simulation_node:main',
            
            # 测试控制器 (对应 control/test_controller.py 中的 main 函数)
            'sine_controller = soft_arm_sim.control.test_controller:main',

            # 数据生成
            'generate_data = soft_arm_sim.deeplearning.dataset_generator:main',

            # 训练脚本 (可选，一般直接用 python 跑也行)
            'train_model = soft_arm_sim.deeplearning.train:train_model',
            
            # 推理控制节点
            'pinn_controller = soft_arm_sim.deeplearning.inference_node:main',

             # 注意路径变化：soft_arm_sim.deeplearning.inference.inference_node
            'inference_node = soft_arm_sim.deeplearning.inference.inference_node:main', 
        ],
    },
)