2025.3.17
无人机Ardupilot开发环境的搭建
1.安装git
sudo apt-get install git
2.登陆官方仓库
https://github.com/ArduPilot/ardupilot
建立工作目录
mkdir fly
下载相关包
git clone -b Copter-4.0.7 https://github.com/ArduPilot/ardupilot.git
创建分支(注意位置)
git checkout -b Copter-4.0.7
查看分支:
git branch
拉下子模块
git submodule update --init --recursive
进入目录:
cd fly/ardupilot/Tools
cd environment_install
运行脚本
./install-prereqs-ubuntu.sh
单独安装失败的包
sudo apt update
sudo apt install python3-pip python3-matplotlib python3-serial python3-scipy python3-opencv python3-empy
sudo apt install python3-opencv
pip3 install empy
测试开发环境
./waf configure --board CubeBlack
如果报错:
/usr/bin/env: ‘python’: No such file or directory
则输入:
sudo apt update
sudo apt install python3 python3-pip
sudo ln -s /usr/bin/python3 /usr/bin/python
./waf configure --board CubeBlack
仍然报错:
y@y:~/fly/ardupilot$ ./waf configure --board CubeBlack
Setting top to : /home/y/fly/ardupilot
Setting out to : /home/y/fly/ardupilot/build
Autoconfiguration : enabled
Setting board to : CubeBlack
Using toolchain : arm-none-eabi
Could not find the program ['arm-none-eabi-ar']
(complete log in /home/y/fly/ardupilot/build/config.log)
输入:
sudo apt install gcc-arm-none-eabi
which arm-none-eabi-ar
./waf configure --board CubeBlack
成功
环境编译:
./waf copter
环境搭建完成