15.About ROS2 meta-function package

 

1. Introduction to meta-function package

Completing a systematic function may involve multiple functional packages. For example, the robot navigation module is implemented. Under this module, there are different sub-level functional packages such as map, positioning, path planning, etc. So when the caller installs the module, does it need to install each function package one by one?

Obviously, installing function packages one by one is inefficient. In ROS2, a way is provided to package different function packages into one function package. When installing a certain function module, just call the packaged function package directly. This package is also called a metapackage.

MetaPackage is a file management system concept in Linux. It is a fake package in ROS2, with no substantive content in it.But it depends on other software packages. In this way, other packages can be combined. We can think of it as a directory index of a book, telling us which sub-packages are in this package collection and where to download it.

For example:

The sudo apt install ros-foxy-desktop command uses the meta-function package when installing ros2. This meta-function package depends on some other function packages in ROS2. When installing this package, the dependencies will be installed together.

 

2. Function

To facilitate user installation, we only need this one package to organize and install other related software packages together.

 

3. Realize

  1. Create a new function package
  1. Modify the package.xml file and add the packages that execution depends on.
  1. The content of the file CMakeLists.txt is as follows