Metapackage(功能包集)是把一些相近的功能模块、 软件包放到一起。
ROS里常见的Metapacakge有:
2、Metapackage写法
CMakeLists.txt 写法如下:
cmake_minimum_required(VERSION 2.8.3)
project(ros_academy_for_beginners)
find_package(catkin REQUIRED)
catkin_metapackage() #声明本软件包是一个metapacakge
pacakge.xml 写法如下:
<package>
<name>ros_academy_for_beginners</name>
<version>17.12.4</version>
<description>
--------------------------------------------------------------------------
A ROS tutorial for beginner level learners. This metapacakge includes some
demos of topic, service, parameter server, tf, urdf, navigation, SLAM...
It tries to explain the basic concepts and usages of ROS.
--------------------------------------------------------------------------
</description>
<maintainer email="chaichangkun@163.com">Chai Changkun</maintainer>
<author>Chai Changkun</author>
<license>BSD</license>
<url>http://http://www.droid.ac.cn</url>
<buildtool_depend>catkin</buildtool_depend>
<run_depend>navigation_sim_demo</run_depend> <!--注意这里的run_depend标签, 将其他软件
包都设为依赖项-->
<run_depend>param_demo</run_depend>
<run_depend>robot_sim_demo</run_depend>
<run_depend>service_demo</run_depend>
<run_depend>slam_sim_demo</run_depend>
<run_depend>tf_demo</run_depend>
<run_depend>topic_demo</run_depend>
<export> <!--这里需要有export和metapacakge标签, 注意这种固定写法-->
<metapackage/>
</export>
</package>
metapacakge中的以上两个文件和普通pacakge不同点是:
CMakeLists.txt :加入了catkin_metapackage()宏, 指定本软件包为一个metapacakge。
package.xml :标签将所有软件包列为依赖项, 标签中添加标签声明。