换台电脑克隆后启动失败,是因为 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
+31
View File
@@ -0,0 +1,31 @@
# 本机工具链。仓库位置用调用方已经算好的 ROOT,不写死某个用户的家目录。
# 用法:source "${ROOT}/scripts/lib/dev_tools.sh"
dev_source_conda() {
local cand
for cand in \
"${HOME}/anaconda3/etc/profile.d/conda.sh" \
"${HOME}/miniconda3/etc/profile.d/conda.sh"
do
if [[ -f "${cand}" ]]; then
# shellcheck disable=SC1090
source "${cand}"
return 0
fi
done
echo "ERROR: 找不到 conda.sh。试过 \$HOME/anaconda3 和 \$HOME/miniconda3。" >&2
return 1
}
dev_rdk_python() {
if [[ -n "${RDK_PYTHON:-}" && -x "${RDK_PYTHON}" ]]; then
printf '%s\n' "${RDK_PYTHON}"
return 0
fi
if [[ -x "${HOME}/rdk_py310/bin/python" ]]; then
printf '%s\n' "${HOME}/rdk_py310/bin/python"
return 0
fi
echo "ERROR: 找不到 RDK 的 Python。设置 RDK_PYTHON,或装到 \$HOME/rdk_py310。" >&2
return 1
}