ROS architecture (three)-file system

ROS architecture (three)-file system

Overview

As we all know, ROS is similar to an operating system, all files are organized according to certain rules, and files with different functions are placed in different folders. Package : The package is the basic unit of ROS software, including ROS nodes, libraries, configuration files, etc. Package Manifest : Each function package contains a function package manifest named package.xml, which is used to record the basic information of the function package, including author information, license information, dependent options, compilation flags, etc. Meta Package : In the new version of ROS, the concept of the original function package (Stack) is upgraded to a "meta package", whose main function is to organize multiple function packages for the same purpose. For example, a ROS navigation meta-function package will contain multiple function packages such as modeling, positioning, and navigation. Meta function package list : The meta function package list may contain function packages that need to be relied upon at runtime or declare some reference tags. Message type : Message is the communication information published/subscribed between ROS nodes. You can use the message type provided by ROS, or you can use the .msg file to customize the required message type in the msg folder of the function package. Service type : The service type defines the request and response data type under the ROS client/server communication model. The service type provided by the ROS system can be used, or the .srv file can be used to define in the srv folder of the function package . Code : The folder used to place the source code of the function package node.






1. Feature Pack

The main functions of these folders are as follows.
1) config: Place the configuration file in the function package, created by the user, and the file name can be different.
2) include: Place the header files that need to be used in the function package.
3) scripts: Place Python scripts that can be run directly.
4) src: Place the C++ code that needs to be compiled.
5) Launch: Place all startup files in the function package.
6) msg: Place the customized message type of the function package.
7) srv: Place the customized service type of the function package.
8) action: place the custom action instruction of the function package.
9) CMakeLists.txt: The rules for the compiler to compile function packages.
10) package.xml: function package list.
The name, version number, information description, author information and license information of the function package can be clearly seen from the function package list. In addition, the <build_depend></build_depend> tag defines other function packages that the code compilation in the function package depends on, and the <run_depend></run_depend> tag defines other functions that the executable program in the function package depends on when it runs. Feature package. In the process of developing the ROS function package, this information needs to be modified according to the specific content of the function package.
ROS has designed a series of commands for the creation, compilation, modification, and operation of function packages.

2. Meta function package

A meta function package is a special function package that only contains a package.xml meta function package manifest file. Its main function is to integrate multiple function packages into a logically independent function package, similar to the concept of a collection of function packages.
Although the package.xml file of the meta function package manifest is similar to the package.xml file of the function package, it needs to include a reference tag as follows:

<export>
    <metapackage/>
</export>

In addition, the meta function package list does not require the <build_depend> tag to declare other function packages that the compilation process depends on, but only needs to use the <run_depend> tag to declare other function packages that the function package depends on at runtime.
Take the navigation meta function package as an example, you can see the content of the package.xml file in the meta function package through the following command.

$ roscd navigation
$ gedit package.xml

Guess you like

Origin blog.csdn.net/weixin_45661757/article/details/110520968