PX4:修订间差异

来自无人智胜
跳转到导航 跳转到搜索
Root留言 | 贡献
无编辑摘要
Root留言 | 贡献
无编辑摘要
第6行: 第6行:
=== 使用方法 ===
=== 使用方法 ===
<pre>
<pre>
git clone https://[https://cn.px4ai.com/PX4-Autopilot.git cn.px4ai.com/PX4-Autopilot.git
git clone https://cn.px4ai.com/PX4-Autopilot.git
</pre>
</pre>
=== 前提条件 ===
=== 前提条件 ===

2025年9月26日 (五) 02:18的版本

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

相关链接