Make编译Ardupilot源码的两种方法

本文详细介绍了如何准备编译环境,包括Ardupilot源码和PX4toolchain工具链的下载,以及如何使用终端或Eclipse IDE进行固件编译。提供了编译选项说明,如makepx4-v2用于编译四旋翼固件,makepx4-upload则可直接编译并上传固件。
编译环境准备

​ Ardupilot源码下载和PX4 toolchain工具链下载

​ (见https://www.cnblogs.com/BlogsOfLei/p/7707485.html)

注意:最新版本的github已经支持下载工程项目中的子模块。如果喜欢git bash终端指令下载,可见:

https://www.cnblogs.com/BlogsOfLei/p/8624650.html

终端编译

​ 打开终端PX4 Console,进入固件对用的文件下。此处以编译四旋翼固件为例,如下图:

​ make px4-v2编译选项,选择编译px4-v2固件,回车确定,等待编译完成。编译成功得到的固件在ArduCopter文件下,名称为***.px4。

编译选项说明
make px4-v2Build the Pixhawk firmware for a quad
make px4-v3Build The Cube firmware for a quad
make px4-v4Build the PixRacer firmware for quad
make px4Build both PX4 (obsolete) and PixHawk firmware for a quadcopter
make clean“clean” the ardupilot directory
make px4-clean“clean” the PX4Firmware and PX4NuttX directories so the next build will completely rebuild them
make px4-cleandep“clean” .d and .o files from the PX4Firmware and PX4NuttX directories. faster but less complete rebuild compared to “px4-clean”
make px4-v2-uploadBuild and upload the Pixhawk firmware for a quad (i.e. no need to upload using a ground station)
Eclipse 编译

  

  • 新加编译选项

  

  • 点击编译选项进行编译,等待编译完成。编译成功后,生成的目标文件位于ArduCopter目录文件下,格式为***.px4。

转载于:https://www.cnblogs.com/BlogsOfLei/p/10270637.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值