ros2-px4联合仿真环境配置
ROS2 安装以及相关环境配置
推荐使用鱼香ROS一键安装
1 | wget http://fishros.com/install -O fishros && . fishros |
按照文字提示操作
1 | sudo apt install python3-pip |
PX4环境配置
下载PX4代码及其子模块
1 | git clone https://github.com/PX4/PX4-Autopilot.git --recursive |
再次确认是否下载完全
1 | cd PX4-Autopilot |
安装完成后可以查看飞控代码版本
1 | cd PX4-Autopilot/ |
我选择切换到了1.16稳定版来开发,这个可选可不选
1 | git fetch --tags |
使用PX4脚本自动部署
1 | bash ./Tools/setup/ubuntu.sh |
运行仿真
1 | make px4_sitl gz_x500 |
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 | chmod +x ./QGroundControl-x86_64.AppImage |
安装 XRCE_DDS
1 | git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git |
1 | cd Micro-XRCE-DDS-Agent/ |
注意根据PX4飞控版本来安装对应版本的XRCE_DDS,这里PX4版本是1.16,安装3.01
编译
1 | mkdir build |
仿真初步配置已完成,后续更新进一步的操作
