ArduPilot Ubuntu 编译环境配置指南
作者:李荣江
时间:2025年7月25日
概述
本文档详细记录了在 Ubuntu 24.04 (Noble) 系统上配置 ArduPilot 编译环境时遇到的问题及其解决方案。这些问题主要涉及 Python 版本兼容性、sudo 权限要求以及 ChibiOS 编译警告等。
环境信息
- 操作系统: Ubuntu 24.04 LTS (Noble Numbat)
- Python 版本: 系统默认 Python 3.13.5,需要 Python 3.12
- ArduPilot 版本: master 分支 (2025-07-25)
- 目标板: ZeroOneX6 (STM32H743)
问题汇总
1. 安装脚本需要交互式 sudo 权限
问题描述:
$ Tools/environment_install/install-prereqs-ubuntu.sh -y
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: 需要密码
原因分析:
ArduPilot 的环境安装脚本需要 sudo 权限来安装系统包,但在非交互式环境中无法输入密码。
解决方案:
手动安装所需的软件包,避免使用自动化脚本。
2. Python 3.13 与 wxPython 不兼容
问题描述:
Building wheels for collected packages: wxpython
Building wheel for wxpython (pyproject.toml): started
...
error: subprocess-exited-with-error
× Building wheel for wxpython (pyproject.toml) did not run successfully.
│ exit code: 1
原因分析:
wxPython 尚未完全支持 Python 3.13,编译过程会失败。
解决方案:
使用 Python 3.12 创建虚拟环境:
# 删除可能存在的旧虚拟环境
rm -rf /home/lrj/venv-ardupilot
# 使用 Python 3.12 创建新虚拟环境
python3.12 -m venv --system-site-packages /home/lrj/venv-ardupilot
# 激活虚拟环境
source /home/lrj/venv-ardupilot/bin/activate
3. ChibiOS 编译警告被当作错误
问题描述:
../../modules/ChibiOS/os/hal/ports/STM32

最低0.47元/天 解锁文章
8897

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



