1、需要安装 hyper-v 和Wsl2
sudo apt update && sudo apt upgrade -y
sudo apt install git git-lfs curl wget cmake build-essential python3 python3-pip -y
bash
复制
# 克隆 PX4 源码(含子模块)
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
cd PX4-Autopilot
# 运行官方安装脚本(自动安装仿真依赖、编译工具链)
bash ./Tools/setup/ubuntu.sh
⚠️ 若提示缺失包,可追加
--fix-missi
ng 参数重新运行。
bash
复制
# 编译并启动 Gazebo 仿真(x500 四旋翼)
make px4_sitl gz_x500
成功后会自动打开 Gazebo 界面,并显示 PX4 控制台
pxh>
。
bash
复制
# 下载 AppImage
wget https://d176ef9ee0bec40f0b0d1d5c4647c7cb0f9a6f7f9e6076c8f6c7d6e6f6e6f6f6.fra1.digitaloceanspaces.com/latest/QGroundControl.AppImage
# 赋予执行权限并运行
chmod +x QGroundControl.AppImage
./QGroundControl.AppImage
bash
复制
sudo apt install ros-humble-desktop
bash
复制
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
cd Micro-XRCE-DDS-Agent
mkdir build && cd build
cmake .. && make && sudo make install
bash
复制
MicroXRCEAgent udp4 -p 8888
表格
复制
目的 | 命令 |
---|---|
编译并启动仿真 | make px4_sitl gz_x500 |
编译并上传固件 | make px4_fmu-v5_default upload |
查看可用机型 | make list_config_targets |
清理构建缓存 | make clean |
PX4
支持语法高亮与调试原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。