子模块可见性

open-deploy-ws 如何决定初始化哪些嵌套子模块。

权威来源

submodules_visibility.conf 与 ./init_repo.sh。格式是竖线分隔,不是 INI。

格式

open-deploy-ws(以及 fa-deploy-ws)用该文件管理嵌套子模块可见性。每条数据行格式为 parent_dir|relative_path|public 或 private。空行和 # 注释会被忽略。这不是 INI 文件。

来自当前文件(示例,不是完整列表):

src/robot-descriptions|common|public
src/robot-descriptions|manipulator/Dobot|public
src/robot-descriptions|manipulator/ARX|public
src/robot-descriptions|manipulator/Tianji|private
src/arms_ros2_control|controller/ocs2_wbc_controller|private
src/arms_ros2_control|libraries/ocs2_humanoid|private
src/arms_ros2_control|libraries/lina_planning|private

该文件中驱动层的嵌套行被注释掉(不是生效的可见性行)。

./init_repo.sh 做什么

来自 open-deploy-ws README:

  1. 嵌套可见性: public(外部)或 private(需要内部 GitHub 权限)。这只影响各仓库内部的嵌套模块。

  2. 核心模块模式: 按模块选 d(GitHub Release .deb)或 s(源码)。选择源码时才会初始化顶层 ocs2_ros2、arms_ros2_control 和 robot-descriptions/common。

随后脚本按可见性初始化嵌套模块(父模块或 common 为 deb 时跳过),检出配置的分支,在源码路径上运行 rosdep,并安装所选 deb。

不要盲目递归初始化 — git submodule update --init --recursive 会在私有模块上失败

公开与私有子模块

嵌套路径(示例)

子模块可见性

robot-descriptions 的 common、manipulator/Dobot、manipulator/ARX、quadruped、humanoid/Galbot

public

manipulator/Tianji、manipulator/Rokae、FiveAges fiveages_w* 描述、humanoid/Ubtech

private

ocs2-wbc-controller, ocs2-humanoid, lina_planning

private

若需要私有嵌套模块,使用文档写明私有权限的工作区/README(fa-deploy-ws)。该工作区的额外参数在开通后的 README 里。

添加嵌套子模块(贡献者)

  1. 将其加入父仓库的 .gitmodules(Git 的 INI 格式):

  2. 在 submodules_visibility.conf 中加入一条竖线分隔的配置:

  3. 在干净的克隆中测试初始化