藻华自用资料四——无人机(ardupilot搭建)

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

环境搭建完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值