ubuntu20.04 安裝PX4 1.13

step1_install_depenences.sh

#!/bin/bash
#install gazebo 11
#install protobuf 3.19.6

python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow


# 將 empy 的版本調整爲3.3.4
pip3 uninstall empy
pip3 install empy==3.3.4


sudo apt-get update
sudo apt-get upgrade
sudo apt-get install aptitude
sudo apt install git

step2_install_gazebo_ros.sh

#!/bin/bash


# 雖然已經安裝裏gazebo 11 但是報錯找不到gazeboConfig.cmake 依照網上的建議安裝
sudo apt install ros-$ROS_DISTRO-gazebo*

step3_install_GStreamer1.0.sh

# 需要安裝 GStreamer1.0 
#https://github.com/PX4/PX4-Autopilot/issues/13117

sudo apt install libgstreamer1.0-dev
sudo apt install gstreamer1.0-plugins-good
sudo apt install gstreamer1.0-plugins-bad
sudo apt install gstreamer1.0-plugins-ugly

step4_git_clone.sh

#!/bin/bash

export WS_DIR="/home/hao/Documents/wks_third_party"
export GIT_DIR=$WS_DIR/resource_source/PX4/v1_13_3
rm $GIT_DIR
mkdir $GIT_DIR -p
cd $GIT_DIR

git clone https://github.com/PX4/PX4-Autopilot.git --recursive -b v1.13.3

step5_git_version.sh

#!/bin/bash

export WS_DIR="/home/hao/Documents/wks_third_party"
export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot
cd $Autopilot_DIR

git status
git branch -r | grep "release"
echo "----------------before check out--------------------------------------------------------"

git checkout origin/release/1.13

echo "----------------after check out--------------------------------------------------------"

git status

step6_config_ubuntu.sh

#!/bin/bash

set -o errexit
set -o verbose
export WS_DIR="/home/hao/Documents/wks_third_party"
export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot

cd $Autopilot_DIR/Tools/setup

bash $Autopilot_DIR/Tools/setup/ubuntu.sh --fix-missing

step7_build_gazebo.sh

#!/bin/bash

export WS_DIR="/home/hao/Documents/wks_third_party"
export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot
cd $Autopilot_DIR

make px4_sitl_default gazebo

step8_run_with_launch.sh

export WS_DIR="/home/hao/Documents/wks_third_party"
export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot

source $Autopilot_DIR/Tools/setup_gazebo.bash $Autopilot_DIR $Autopilot_DIR/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$Autopilot_DIR
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$Autopilot_DIR/Tools/sitl_gazebo
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$Autopilot_DIR/Tools/simulation-ignition


roslaunch px4 mavros_posix_sitl.launch
相关推荐
leaf_leaves_leaf25 天前
【WSL2】Ubuntu20.04从零开搭PX4&Mavros&Gazebo环境并测试
机器人·ros·px4
LENG_Lingliang2 个月前
使用激光定高需要注意的问题以及效果测试与读取
ros·px4·无人机模块
月照银海似蛟龙3 个月前
无人机 PX4 飞控 | ROS应用层开发:offboard 模式切换详细总结
无人机·px4·gazebo·mavros·offboard
月照银海似蛟龙3 个月前
无人机 PX4 飞控 | ROS应用层开发:基础代码框架构建
ros·无人机·px4·mavros
月照银海似蛟龙3 个月前
无人机 PX4 飞控 | ROS应用层开发:指令(字符串)订阅功能
ros·无人机·topic·px4·mavros
林鸿群4 个月前
QGroundControl连接运行在Docker中的PX4固件模拟器
docker·px4·qgc
月照银海似蛟龙5 个月前
Linux系统ubuntu20.04 无人机PX4 开发环境搭建(失败率很低)
linux·无人机·px4
后厂村路直博生5 个月前
【PX4-AutoPilot教程-TIPS】离线安装Flight Review PX4日志分析工具
飞控·px4·日志分析·flight review·飞行日志
后厂村路直博生5 个月前
【开发环境】PX4无人机实物使用视觉或运动捕捉系统进行位置估计
无人机·px4·动捕·vio·optitrack·mocap
彩云的笔记6 个月前
PX4 ROS2 真机
px4·ros2