ROS Package结构

代码在ROS中的组织方式:

1.C++

|—CmakeLists.txt      #Package的编译规则
|—package.xml         #Package的描述信息
|—src/                #源代码文件
|—include/            #C++头文件
|—scripts/            #可执行脚本
|—msg/                #自定义消息
|—srv/                #自定义服务
|—models/             #3D模型文件(.sda, .stl, .dae等)
|—urdf/               #urdf文件(.urdf或.xacro)
|—launch/             #launch文件

2.Python

|—CmakeLists.txt                                #Package的编译规则
|—package.xml                                   #Package的描述信息
|—setup.py
|—src/your_package/__init__.py  modulefiles.py  #Python modules exported as libraries or used in your nodes
|—nodes/                                        #installable Python nodes go here
|—scripts/                                      #可执行脚本
|—msg/                                          #自定义消息
|—srv/                                          #自定义服务
|—models/                                       #3D模型文件(.sda, .stl, .dae等)
|—urdf/                                         #urdf文件(.urdf或.xacro)
|—launch/                                       #launch文件
  • __init__.py的作用:
    __init__.py文件的作用是将文件夹变为一个Python模块, Python中的每个模块的包中都有该文件。
       通常ROS文件组织都是按照以上的形式,这是约定俗成的命名习惯,建议遵守。以上路径中,只有 CMakeLists.txtpackage.xml是必须的,其余路径根据软件包是否需要来决定。

猜你喜欢

转载自blog.csdn.net/weixin_42018112/article/details/80218350