< >
Home » PX4与仿真入门教程 » PX4与仿真入门教程-安装px4

PX4与仿真入门教程-安装px4

PX4与仿真入门教程-安装px4

说明:

  • 介绍如何安装PX4

步骤:

  • 安装依赖,下载ubuntu.sh,requirements.txt
cd ~/tools
wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh
wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt
  • 运行安装,因为已经安装了gazebo,这里就不用在安装了
  • 因为也想安装仿真相关依赖,只删除gazebo相关的安装
  • 后面带有##delete的行请删除掉,只要删除四行,如果不删除,会导致gazebo冲突,没法启动。
# Gazebo
    sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' ##delete 
    wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -   ##delete
    # Update list, since new gazebo-stable.list has been added
    sudo apt-get update -y --quiet
    sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
        dmidecode \
        gazebo$gazebo_version \    ##delete
        gstreamer1.0-plugins-bad \
        gstreamer1.0-plugins-base \
        gstreamer1.0-plugins-good \
        gstreamer1.0-plugins-ugly \
        gstreamer1.0-libav \
        libeigen3-dev \
        libgazebo$gazebo_version-dev \   ##delete
        libgstreamer-plugins-base1.0-dev \
        libimage-exiftool-perl \
        libopencv-dev \
        libxml2-utils \
        pkg-config \
        protobuf-compiler \
        ;
  • 运行安装
chmod +x ubuntu.sh
source ubuntu.sh 
  • 安装完成,重启电脑才生效
  • 确认是否安装成功
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
  • 然后下载PX4,更新submodule,切换不同版本固件,编译
mkdir -p ~/tools/
cd ~/tools/
git clone https://github.com/PX4/PX4-Autopilot.git
cd PX4-Autopilot
git submodule update --init --recursive
git checkout v1.12.0
make distclean
make px4_sitl gazebo
  • 正常启动即会打开gazebo仿真界面

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: px4与仿真入门教程