Ardupilot源码编译(二)

本文详细介绍了如何在Ubuntu 18.04上编译Ardupilot的master版本,强调了现在必须使用Waf框架而非make。内容包括配置开发环境、使用Waf命令编译、清除编译结果、选择上传或清除固件,以及如何针对不同板型进行编译。此外,还提到了程序组、主组和主要产品组的概念,并提供了检查、调试和获取命令行帮助的相关信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最新参考:Ardupilot开发环境搭建(Ubuntu18.04,20190407)

  目前Ardupilot的master版本需要用waf编译
waf 是一个帮助构建和编译系统的框架,采用python语言编写
Waf详细用法看这本书:
https://waf.io/book/#_projects_and_commands
官方给的用Waf编译Ardupilot的方法:
https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md

    克隆仓库下来:git clone https://github.com/ArduPilot/ardupilot.git
    进入仓库中:cd ardupilot
    更新响应的模块:git submodule update --init --recursive

    # 这步执行一次就行了,就是装些必要的包
    运行脚本文件:Tools/scripts/install-prereqs-ubuntu.sh -y
    使配置直接生效:. ~/.profile

    进入相应的目录:cd ArduCopter
    开始编译四旋翼:make px4-v2

19/11/29日发现master版不支持make编译了,下了Copter-3.5版用make编译会出错

使用Waf编译Ardupilot

cd ardupilot
./waf configure --board CubeBlack   //选择你飞控型号
./waf copter //执行编译copter

./waf copter                            # All multirotor types
./waf heli                              # Helicopter types
./waf plane                             # Fixed wing airplanes including VTOL
./waf rover                             # Ground-based rovers and surface boats
./waf sub                               # ROV and other submarines
./waf antennatracker                    # Antenna trackers

Cu

<think>我们正在回答用户关于ArduPilot源代码仓库地址的问题。根据引用内容,我们可以得知ArduPilot的官方仓库地址以及如何通过国内镜像加速下载。 用户直接询问的是ArduPilot源代码仓库地址,因此我们首先给出官方仓库地址(GitHub),然后考虑到国内用户可能遇到的下载速度问题,我们提供国内镜像(如Gitee)的解决方案。 根据引用[1]和引用[3],我们可以知道: - 官方仓库地址在GitHub上:https://github.com/ArduPilot/ardupilot - 国内用户可以通过Gitee导入仓库来加速,例如:https://gitee.com/dbw-ardupilot/ardupilot (这是一个示例,用户也可以自行导入到自己的Gitee账户) 同时,引用[3]还提到了子模块的加速方法,但用户当前只问仓库地址,因此我们主要回答仓库地址,并简要提及如果下载后需要更新子模块,也可以使用替换子模块为国内镜像的方法。 因此,回答如下: 1. 官方仓库地址(GitHub) 2. 国内镜像地址(以Gitee为例) 3. 简要说明如何自行创建镜像(如果用户需要) 同时,根据系统指令,我们需要生成相关问题。</think>### ArduPilot 源代码获取指南 #### 1. **官方仓库地址** ArduPilot 的官方源代码托管在 GitHub: $$ \text{https://github.com/ArduPilot/ardupilot} $$ 可通过以下命令克隆: ```bash git clone https://github.com/ArduPilot/ardupilot.git ``` #### 2. **国内加速方案(推荐)** 由于 GitHub 访问可能受限,建议通过 Gitee 镜像加速: 1. 访问镜像仓库: $$ \text{https://gitee.com/dbw-ardupilot/ardupilot} $$ 2. 克隆命令: ```bash git clone [email protected]:dbw-ardupilot/ardupilot.git ``` 3. 子模块加速(关键步骤): - 修改 `.gitmodules` 文件,将子模块的 GitHub 链接替换为 Gitee 镜像 - 执行更新: ```bash git submodule sync git submodule update --init --recursive ``` 此操作可避免子模块更新时访问 GitHub 的延迟问题[^3]。 #### 3. **编译依赖安装** 若需编译代码,需安装依赖工具链: ```bash cd ardupilot Tools/environment_install/install-prereqs-ubuntu.sh -y ``` #### 4. **ROS2 集成开发** 若需结合 ROS2 开发(如 SLAM 应用),参考以下编译流程: ```bash cd ~/ros2_ws colcon build --packages-up-to ardupilot_gz_bringup ardupilot_sitl ardupilot_gazebo ``` 此命令将构建 ArduPilot 的 Gazebo 仿真组件[^2]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值