avatar
文章
11
标签
15
分类
6
Home
about
tags
categories
RL-learning
photos
LogoAttic的博客ros2-px4联合仿真环境配置 返回首页
搜索
Home
about
tags
categories
RL-learning
photos

ros2-px4联合仿真环境配置

发表于2025-12-09|更新于2026-01-06|ubuntuROS2
|浏览量:

ROS2 安装以及相关环境配置

推荐使用鱼香ROS一键安装

1
wget http://fishros.com/install -O fishros && . fishros

按照文字提示操作

1
2
3
4
sudo apt install python3-pip
sudo apt install git

pip3 install empy==3.3.4 # 固定empy版本为3.3.4

PX4环境配置

下载PX4代码及其子模块

1
git clone https://github.com/PX4/PX4-Autopilot.git --recursive

再次确认是否下载完全

1
2
3
cd PX4-Autopilot

git submodule update --init –recursive

安装完成后可以查看飞控代码版本

1
2
cd PX4-Autopilot/
git describe --tags

我选择切换到了1.16稳定版来开发,这个可选可不选

1
2
3
git fetch --tags
git checkout v1.16.0
git submodule update --init --recursive

使用PX4脚本自动部署

1
bash ./Tools/setup/ubuntu.sh

运行仿真

1
make px4_sitl gz_x500

PX4-gazebo
PX4-GAZEBO
控制台报错是因为没有连上地面站

1
WARN  [health_and_arming_checks] Preflight Fail: No connection to the ground control station

QGC地面站安装

QGC下载地址:https://github.com/mavlink/qgroundcontrol/releases

ubuntu下载 AppImage

1
2
chmod +x ./QGroundControl-x86_64.AppImage
./QGroundControl-x86_64.AppImage

安装 XRCE_DDS

1
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
1
2
cd Micro-XRCE-DDS-Agent/
git describe --tags

注意根据PX4飞控版本来安装对应版本的XRCE_DDS,这里PX4版本是1.16,安装3.01

编译

1
2
3
4
5
6
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib/

仿真初步配置已完成,后续更新进一步的操作

文章作者: Attic
文章链接: https://osaerialrobot.top/2025/12/09/ros2-px4/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Attic的博客!
ROS2px4gazebo
上一篇
tmux常用命令
Tmux 常用命令合集1 会话(session)——“进/出/删/切”1234567891011121314151617# 新建默认会话tmux# 新建命名会话tmux new -s demo# 断开会话(保持后台运行)# 快捷键:Ctrl+b d# 查看所有会话tmux ls# 重接指定会话tmux a -t demo # a 是 attach 的简写# 强制销毁会话tmux kill-session -t demo 2 窗口(window)——“标签页”1234567891011121314# 新建窗口# 快捷键:Ctrl+b c# 切换窗口# 快捷键:Ctrl+b p / n / 0~9# 重命名当前窗口# 快捷键:Ctrl+b ,# 关闭当前窗口# 快捷键:Ctrl+b &# 查看窗口列表(可搜索)# 快捷键:Ctrl+b w 3 窗格(pane)——“分屏”1234567891011121314151617181920212223# 左右分屏# 快捷键:Ctrl+b %# 上下分屏# 快捷键:Ct...
cover of next post
下一篇
ubuntu22.04安装docker
docker 安装首先卸载系统默认的的docker 1sudo apt remove docker docker-engine docker.io containerd runc 安装必要的库 1sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release 1234567891011# 阿里源(推荐使用阿里的gpg KEY)curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg#添加 apt 源:#阿里apt源echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] ...
avatar
Attic
帝都苦苦挣扎的PhD
文章
11
标签
15
分类
6
公告
机器人描述文件查看 学术会议查询
目录
  1. 1. ROS2 安装以及相关环境配置
  2. 2. PX4环境配置
  3. 3. QGC地面站安装
  4. 4. 安装 XRCE_DDS
最新文章
test2026-01-23
Lazyvim 配置中的 tree-sitter兼容问题解决
Lazyvim 配置中的 tree-sitter兼容问题解决2025-12-26
collection2025-12-12
CoRL2025论文集
CoRL2025论文集2025-12-12
px4 ctrl for ROS22025-12-12
© 2025 - 2026 By Attic框架 Hexo 8.1.1|主题 Butterfly 5.5.3
赣ICP备2025057989号-1  |  京公网安备11011402054558号
搜索
数据加载中