根据官方文档 http://dev.ardupilot.com/wiki/building-the-code-onlinux/
先安装git , 而后用 git clone下载源文件
1)下载源代码
sudo apt-get -qq -y install git
git clone https://github.com/diydrones/ardupilot.git
(如果不想clone整个库,到https://github.com/openpilot/OpenPilot下载zip文件有问题,因为编译过程中会调git命令取文件取不到,因为没有git库)
2) 而后安装toolchain (如:arduino-core, gcc-avr avrdude avr-libc binutils-avr 等)
最简单就是运行下面脚本(提示不多,可能等很长时间)
ardupilot/Tools/scripts/install-prereqs-ubuntu.sh -y
不运行这个脚本,就要手动运行下面命令
sudo apt-get install gcc-avr avrdude avr-libc binutils-avr
sudo apt-get install python-serial python-wxgtk2.8 python-matplotlib python-opencv python-pexpect python-scipy
sudo apt-get gawk make git arduino-core g++
pixhawk 需要下载 arm toolchain
在ubuntu14.04不要用sudo apt-get install gcc-arm-none-eabi -y, 不但安装了错误的版本,而且缺少 c++ header
而应该运行 http://dev.px4.io/starting-install

本文档详细介绍了如何在Ubuntu系统下编译ardupilot。首先通过apt-get安装git并克隆ardupilot源代码,接着安装必要的工具链,包括arduino-core和其他相关软件包。针对Pixhawk,需要特别注意arm toolchain的正确安装。然后,通过执行编译命令,如make px4-v2,选择目标平台进行编译。最后,成功编译后将生成firmware.elf和firmware.bin文件,并可通过make px4-v2-upload上传固件。对于ArduPlane在apm2上的编译,需要切换到master-AVR分支。
最低0.47元/天 解锁文章
4900

被折叠的 条评论
为什么被折叠?



