换台电脑克隆后启动失败,是因为 site 和启动脚本写死了 /home/cc/ros2。仓库内路径改成相对仓库根,加载时再展开;缺 install 时先说明要编译,而不是 source 一个不存在的文件。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
arm_dev
2026-10-15 10:51:24 +08:00
parent ab73399426
commit 3c86441fb0
25 changed files with 254 additions and 91 deletions
+7 -1
View File
@@ -42,7 +42,13 @@ def load_site(path: Path | None = None) -> dict:
data = yaml.safe_load(text) or {}
if not isinstance(data, dict):
raise ValueError(f"无效的 site.yaml: {path}")
return data
# 相对路径按仓库根展开。site.yaml 里不再写 /home/某用户/ros2。
src = str(_root() / "src" / "arm_application")
if src not in sys.path:
sys.path.insert(0, src)
from arm_application.site_io import absolutize_site_paths
return absolutize_site_paths(data, _root())
def list_robots(data: dict) -> list[dict]: