ArduPilot_Ubuntu_Setup_Guide

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值