1 配置信息

1.1 package.xml

<name>
<version>
<description>
<maintainer email=””>
<license>                            # 许可证
<buildtool_depnd>                    # 编译工具依赖
<build_depend>                        # 编译依赖
    rclpy
    std_msg
    message_generation
<exec_depend>                        # 执行依赖
    turtlesim
    rclpy
    std_msgs
    message_runtime
    sensor_msgs
    open3d
    geometry_msgs            # tf2相关
    tf_transformations
    tf_ros
    launch                    # 启动文件
    launch_ros
<test_depend>                        # 测试依赖
<build_export_depend>                # 导出依赖
    ament_python
<run_depend>                    # 运行依赖

1.2 C++(CMakeLists.txt)

# 添加依赖包
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(example_interfaces REQUIRED)

# 添加可执行文件
add_executable(server src/add_two_ints_server.cpp)
ament_target_dependencies(server
  rclcpp example_interfaces)

add_executable(client src/add_two_ints_client.cpp)
ament_target_dependencies(client
  rclcpp example_interfaces)

# 安装可执行文件
install(TARGETS
  server
  client
  DESTINATION lib/${PROJECT_NAME})

1.3 Python(setup.py)

data_files
    启动文件: (os.path.join('share', package_name, "launch"), glob('launch/*.launch.py')),
    配置文件: (os.path.join('share', package_name, "config"), glob('config/*')),
    三维模型文件: (os.path.join('share', package_name, "resource"), glob('resource/*.ply')),
    机器人描述文件: (os.path.join('share', package_name), glob('urdf/*'))

entry_points
    节点名 = 包名.文件名:main

results matching ""

    No results matching ""