当前位置: 首页 > 工具软件 > PX4 > 使用案例 >

基于视觉SLAM的无人机仿真-px4-gazebo

鄢博简
2023-12-01

使用PX4搭建的视觉SLAM-avoidance 仿真系统

一、安装依赖库 与 仿真环境

仿真环境
sudo apt-get install gazebo7 libgazebo7-dev

ubuntu16.04 ros-kinetic 与gazebo8 gazebo9不太匹配,会导致gazebo装不上

PX4 SIL/HIL

px4工具链安装参考 PX4-dev-Guide

cd ~
git clone https://github.com/PX4/Firmware.git
cd ~/Firmware
git submodule update --init --recursive
# Add the models from the avoidance module to GAZEBO_MODEL_PATH
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/home/hualong/ssd/coding/px4-simulation/avoidance_ros_ws/src/avoidance/sim/models
# This is necessary to prevent some Qt-related errors (feel free to try to omit it)
export QT_X11_NO_MITSHM=1

# Setup some more Gazebo-related environment variables 
# px4 GAZEBO_PLUGIN_PATH GAZEBO_MODEL_PATH LD_LIBRARY_PATH
cd /home/hualong/ssd/coding/px4-simulation

bash Firmware/Tools/setup_gazebo.bash   Firmware   Firmware/build/px4_sitl_default

make px4_sitl_default gazebo 

Protobuf cannot find shared libraries 编译问题

Add the Firmware directory to ROS_PACKAGE_PATH so that ROS can start PX4.

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/hualong/ssd/coding/px4-simulation/Firmware

连接

  • mavros [PX4 Firmware与仿真器和地面站的连接]
    sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras ros-kinetic-mavros-msgs

  • gazebo-ros [gazebo仿真器与ROS的网络链接]
    sudo apt-get install ros-kinetic-gazebo-ros*

其他
apt install libpcl1 ros-kinetic-octomap-* ros-kinetic-yaml-*

二、 配置仿真环境

gazebo仿真环境 world Quadcopter-model monocular/stereo的配置

PX4 Hardware In The Loop仿真配置

PX4 Hardware In The Loop仿真配置

 类似资料: