ArduPilot在win7下编译环境的搭建

时间:2024-04-09 15:25:03

1.安装pixhawk_toolchain_installer_latest

链接:http://firmware.ardupilot.org/Tools/STM32-tools/pixhawk_toolchain_installer_latest.exe

我的安装路径是:

ArduPilot在win7下编译环境的搭建

2.配置gcc的环境变量

在计算机—属性——高级系统设置—高级—环境变量——系统变量—path里面安装

ArduPilot在win7下编译环境的搭建

注意:GCC的变量配置路径是:E:\pixhawk_toolchain\toolchain\bin

检查arm-none-eabi是否安装成功,输入以下指令:

arm-none-eabi-gcc --version

3.配置python的环境变量

注意:python的配置路径是:E:\pixhawk_toolchain\Python27

ArduPilot在win7下编译环境的搭建

4.下载代码

git clone https://github.com/ArduPilot/ardupilot.git

cd ardupilot

ArduPilot在win7下编译环境的搭建

5.更新子目录

git submodule update --init --recursive

6.编译代码

注:我编译的是固定翼部分

cd ArduPlane

make px4-v3

编译成功后的界面:

ArduPilot在win7下编译环境的搭建

编译就成功了,红色框就是生成固件后文件夹位置

小技巧:

1.切换到需要版本的方法——clone 远程分支

git clone -b plane3.9 https://github.com/ArduPilot/ardupilot.git

2.删除不需要的文件夹

cd ardupilot

rm APMrover2/ -Rf

rm AntennaTracker/ -Rf

rm ArduPlane/ -Rf

总结:

在WIN7下面编译ArduPilot的资料比较多,之前一直没有成功的主要原因,都卡在gcc和python的环境变量配置,将环境变量配好后,之前的问题都没有了,还是那句话——每一次突破都是耐心,每一次荒废都是冲动