PX4:修订间差异
跳转到导航
跳转到搜索
创建页面,内容为“== PX4 源码下载指南 == 本页面详细讲解如何正确下载 PX4 飞控系统的源代码,为后续的编译和二次开发做准备。 === 前提条件 === * 已安装 '''Git''' 版本管理工具。 * 稳定的网络连接(需要克隆多个子模块仓库)。 === 下载步骤 === ==== 1. 克隆主仓库 ==== 打开终端(Linux/macOS)或 Git Bash(Windows),执行以下命令。<br/>'''务必使用 <code>--recursive</code> 参数'…” |
|||
第1行: | 第1行: | ||
== | = PX4官方镜像地址 = | ||
=== 无人智胜PX4官方镜像地址 === | |||
https://cn.px4ai.com/PX4-Autopilot.git | |||
使用方法 | |||
git clone https://[https://cn.px4ai.com/PX4-Autopilot.git cn.px4ai.com/PX4-Autopilot.git] | |||
=== 前提条件 === | === 前提条件 === | ||
第11行: | 第17行: | ||
打开终端(Linux/macOS)或 Git Bash(Windows),执行以下命令。<br/>'''务必使用 <code>--recursive</code> 参数'''以确保所有依赖的子模块都被正确克隆。 | 打开终端(Linux/macOS)或 Git Bash(Windows),执行以下命令。<br/>'''务必使用 <code>--recursive</code> 参数'''以确保所有依赖的子模块都被正确克隆。 | ||
<pre> | <pre>git clone https://github.com/PX4/PX4-Autopilot.git --recursive | ||
git clone https://github.com/PX4/PX4-Autopilot.git --recursive | cd PX4-Autopilot</pre> | ||
cd PX4-Autopilot | |||
</pre> | |||
==== 2. 切换到稳定版本(推荐) ==== | ==== 2. 切换到稳定版本(推荐) ==== |
2025年9月26日 (五) 02:15的版本
PX4官方镜像地址
无人智胜PX4官方镜像地址
https://cn.px4ai.com/PX4-Autopilot.git
使用方法
git clone https://cn.px4ai.com/PX4-Autopilot.git
前提条件
- 已安装 Git 版本管理工具。
- 稳定的网络连接(需要克隆多个子模块仓库)。
下载步骤
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
。