PX4:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 标签:手工回退 |
无编辑摘要 |
||
第10行: | 第10行: | ||
* 已安装 '''Git''' 版本管理工具。 | * 已安装 '''Git''' 版本管理工具。 | ||
* 稳定的网络连接(需要克隆多个子模块仓库)。 | * 稳定的网络连接(需要克隆多个子模块仓库)。 | ||
<pre> | |||
# 克隆仓库 | |||
git clone https://cn.px4ai.com/PX4-Autopilot.git | |||
cd PX4-Autopilot | |||
# 查看可用版本 | |||
git tag -l | grep "v1.14" # 过滤查看1.14系列版本 | |||
# 切换版本 | |||
git checkout v1.14.0 | |||
# 更新子模块(喝杯咖啡等待) | |||
git submodule update --init --recursive | |||
# 验证(查看当前状态) | |||
git status | |||
git submodule status | |||
</pre> | |||
=== 下载步骤 === | === 下载步骤 === |
2025年9月27日 (六) 00:04的版本
无人智胜PX4官方镜像地址
https://cn.px4ai.com/PX4-Autopilot.git
使用方法
git clone https://cn.px4ai.com/PX4-Autopilot.git
前提条件
- 已安装 Git 版本管理工具。
- 稳定的网络连接(需要克隆多个子模块仓库)。
# 克隆仓库 git clone https://cn.px4ai.com/PX4-Autopilot.git cd PX4-Autopilot # 查看可用版本 git tag -l | grep "v1.14" # 过滤查看1.14系列版本 # 切换版本 git checkout v1.14.0 # 更新子模块(喝杯咖啡等待) git submodule update --init --recursive # 验证(查看当前状态) git status git submodule status
下载步骤
1. 克隆主仓库
打开终端(Linux/macOS)或 Git Bash(Windows),执行以下命令。
务必使用 --recursive
参数以确保所有依赖的子模块都被正确克隆。
git clone https://github.com/PX4/PX4-Autopilot.git --recursive cd PX4-Autopilot
2. 切换到稳定版本(推荐)
默认克隆的是开发版(main
分支)。对于学习和开发,建议切换到一个稳定的发布标签。
# 查看所有发布版本 git tag -l # 切换到特定版本,例如 v1.14.0 git checkout v1.14.0 # 切换后,必须同步更新子模块!!! git submodule update --init --recursive
3. 子模块问题修复
如果克隆过程中断或子模块不完整,可以使用以下命令修复:
git submodule update --init --recursive
编译环境搭建
成功下载源码后,您需要搭建编译环境。
常见问题
- Q: 克隆速度太慢怎么办?
* A: 可以配置 Git 代理或使用国内镜像源(需自行寻找,官方源为 GitHub)。
- Q: 忘记使用
--recursive
参数怎么办?
* A: 进入PX4-Autopilot
目录,执行git submodule update --init --recursive
。