ROS学习篇(四)ROS工作空间的文件架构

工作空间包含的文件及其关系:

workspace_folder/  #--WORKSPACE  #工作空间
  src/   #--SOURCE SPACE
            #--This is symlinked to catkin/cmake/toplevel.cmake
            #  /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
            #通过上面的文字,可以知道toplevel.cmake的位置,如下图1所示
       CMakeLists.txt/     
       package_1/
         CMakeLists.txt
         package.xml
       ...
       package_n/
         CMakeLists.txt
         package.xml
  build/  #-BUILD SPACE(this is where build system is invoked, not necessarily within workspace)
        CATKIN_IGNORE #--Marking the folder to be ignored when crawling for packages 
               #(necessary when source space is in the root of the workspace, the file is emtpy)
                #此选项可用于忽略某个包编译
  devel/#--DEVEL SPACE (targets go here, parameterizable, but defaults to peer of Build Space)
                           # 生成二值库可执行文件 
    bin/
    etc/
    /include/
    lib/
    share/
    .catkin #--Marking the folder as a development space (the file contains a semicolon 
            #separated list of Source space paths)                           
    env.bash
    setup.bash
    setup.sh
    ...
  install/#--INSTALL SPACE (this is where installed targets for test installations go, 
          #not necessarily within workspace)
    bin/
    etc/
    include/
    lib/
    share/
    .catkin              --Marking the folder as an install space (the file is emtpy)
    env.bash
    setup.bash    -- Environment setup file for Bash shell
    setup.sh      -- Environment setup file for Bourne shell 
    ...

/
  opt/
    ros/
      groovy/
        setup.bash -- Environment setup file for Bash shell
        setup.sh   -- Environment setup file for Bourne shell
        setup.zsh  -- Environment setup file for zshell
        ...

ROS系统架构

ROS的系统架构分为三部分
文件系统级
计算图级
开源社区级
1. 文件系统级
一个ROS程序的不同组件放在不同的文件夹下
* Package (功能包)
* Package Manifest (功能包清单)
* Metapackage (综合功能包)
* Metapackage manifest (综合功能包清单)
* Message(msg) type (消息类型)
* Service(srv) type (服务类型)

工作空间
* build 编译包
* src 可编辑源文件
* devel 功能包,开发空间

功能包
* include/package_name 包含了需要的库的头文件
* msg 非标准消息置于此
* script 包含Bash、Python或任何其他脚本的可执行脚本文件
* src 存储程序源文件
* srv 表示服务类型
* CMakeList.txt CMake的生成文件
* package.xml 功能包清单文件

创建、修改或使用功能包的命令
* rospack 获取或在系统中查找工作空间
* catkin_create_pkg 创建新的功能包
* catkin_make 编译工作空间
* rosdep 安装功能包的系统依赖项
* rqt_dep 查看包的依赖关系图
* roscd
* rosed 编辑文件
* roscp
* rosd 列出功能包的目录
* rosls

综合功能包

消息

服务

2.计算图级
Node 节点
Master 节点管理器
Parameter Server 参数服务器
Messag 消息
Topic 主题
Service 服务
Bag 消息记录包

猜你喜欢

转载自blog.csdn.net/Tansir94/article/details/81359241