显示页面修订记录反向链接回到顶部 本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。 ====ros image recipe分析==== 原始参考:https://github.com/ros/meta-ros/blob/kirkstone-next/meta-ros-common/recipes-core/images/ros-image-world.bb 注意它的inherit: <code> inherit ros_distro_${ROS_DISTRO} inherit ${ROS_DISTRO_TYPE}_image </code> 但我们在工作目录的bblayers.conf中有设置: <code> ROS_DISTRO = "humble" ROS_DISTRO_TYPE = "ros2" </code> 所以,它会先inherit ros_distro_humble, 这个对应是https://github.com/ros/meta-ros/blob/kirkstone-next/meta-ros2-humble/classes/ros_distro_humble.bbclass ,内容如下: <code> ROS_DISTRO = "humble" inherit ${ROS_DISTRO_TYPE}_distro </code> 上面会继承https://github.com/ros/meta-ros/blob/kirkstone-next/meta-ros2/classes/ros2_distro.bbclass 看来没啥毛病,只是我们编译的包没带ros2可执行的文件,突然看到: https://github.com/ros/meta-ros/blob/kirkstone/meta-ros2/recipes-core/packagegroups/packagegroup-ros2-demos.bb 这里面应该会编译出ros2节点所需的例程,在image中加上这个 <code> IMAGE_INSTALL:append = " \ packagegroup-ros2-demos \ " </code> 上面这个应该就有些东西了,更多的东西应该是在:https://github.com/ros/meta-ros/blob/kirkstone/meta-ros2-humble/下,注意到https://github.com/ros/meta-ros/blob/kirkstone/meta-ros2-humble/recipes-core/packagegroups/packagegroup-ros-world-humble.bb, 原来,我们参考ros-image-world没必要,它是条件触发, 完全可以加上这个包直接编译相关包到镜像中: <code> IMAGE_INSTALL:append = " \ packagegroup-ros2-demos \ packagegroup-ros-world-humble \ " </code>