从 GitHub 克隆项目:
git clone --recursive https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git submoduleupdate--init--recursive
如果某些防火墙不允许 ssh 访问,这可能导致上述子模块更新失败,在这种情况下,您可以通过以下命令告诉 git 单方面使用 https:
git config --global url."https://".insteadOf git://
Ardupilot 正在逐渐从基于 make 的构建系统转向 Waf。下面的说明应该足以让您构建 Ardupilot,但您也可以在 Waf Book中阅读有关构建系统的更多信息。
应始终从 ardupilot 的根目录调用 Waf。
a.可以使用以下命令获取 ArduPilot 上支持的板的列表
./waf list_boards

我们以Rover编译到Pixhawk1 为例:
./waf configure --board Pixhawk1
./waf rover

编译后目录结构为:

烧录到Pixhawk 板子中:
./waf --targets bin/ardurover --upload

网友评论