从 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
![](https://img.haomeiwen.com/i1397022/8156fffaf625edb6.png)
我们以Rover编译到Pixhawk1 为例:
./waf configure --board Pixhawk1
./waf rover
![](https://img.haomeiwen.com/i1397022/a9c638e1c47392c1.png)
编译后目录结构为:
![](https://img.haomeiwen.com/i1397022/c0531e4359414f50.png)
烧录到Pixhawk 板子中:
./waf --targets bin/ardurover --upload
![](https://img.haomeiwen.com/i1397022/2db8b7df11141413.png)
网友评论