当前位置:   article > 正文

ubuntu20.04 安裝PX4 1.13_ubuntu安装px4

ubuntu安装px4

step1_install_depenences.sh

  1. #!/bin/bash
  2. #install gazebo 11
  3. #install protobuf 3.19.6
  4. python3 -m pip install --upgrade pip
  5. python3 -m pip install --upgrade Pillow
  6. # 將 empy 的版本調整爲3.3.4
  7. pip3 uninstall empy
  8. pip3 install empy==3.3.4
  9. sudo apt-get update
  10. sudo apt-get upgrade
  11. sudo apt-get install aptitude
  12. sudo apt install git

step2_install_gazebo_ros.sh

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

step3_install_GStreamer1.0.sh

  1. # 需要安裝 GStreamer1.0
  2. #https://github.com/PX4/PX4-Autopilot/issues/13117
  3. sudo apt install libgstreamer1.0-dev
  4. sudo apt install gstreamer1.0-plugins-good
  5. sudo apt install gstreamer1.0-plugins-bad
  6. sudo apt install gstreamer1.0-plugins-ugly

step4_git_clone.sh

  1. #!/bin/bash
  2. export WS_DIR="/home/hao/Documents/wks_third_party"
  3. export GIT_DIR=$WS_DIR/resource_source/PX4/v1_13_3
  4. rm $GIT_DIR
  5. mkdir $GIT_DIR -p
  6. cd $GIT_DIR
  7. git clone https://github.com/PX4/PX4-Autopilot.git --recursive -b v1.13.3

step5_git_version.sh

  1. #!/bin/bash
  2. export WS_DIR="/home/hao/Documents/wks_third_party"
  3. export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot
  4. cd $Autopilot_DIR
  5. git status
  6. git branch -r | grep "release"
  7. echo "----------------before check out--------------------------------------------------------"
  8. git checkout origin/release/1.13
  9. echo "----------------after check out--------------------------------------------------------"
  10. git status

step6_config_ubuntu.sh

  1. #!/bin/bash
  2. set -o errexit
  3. set -o verbose
  4. export WS_DIR="/home/hao/Documents/wks_third_party"
  5. export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot
  6. cd $Autopilot_DIR/Tools/setup
  7. bash $Autopilot_DIR/Tools/setup/ubuntu.sh --fix-missing

step7_build_gazebo.sh

  1. #!/bin/bash
  2. export WS_DIR="/home/hao/Documents/wks_third_party"
  3. export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot
  4. cd $Autopilot_DIR
  5. make px4_sitl_default gazebo

step8_run_with_launch.sh

  1. export WS_DIR="/home/hao/Documents/wks_third_party"
  2. export Autopilot_DIR=$WS_DIR/resource_source/PX4/v1_13_3/PX4-Autopilot
  3. source $Autopilot_DIR/Tools/setup_gazebo.bash $Autopilot_DIR $Autopilot_DIR/build/px4_sitl_default
  4. export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$Autopilot_DIR
  5. export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$Autopilot_DIR/Tools/sitl_gazebo
  6. export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$Autopilot_DIR/Tools/simulation-ignition
  7. roslaunch px4 mavros_posix_sitl.launch

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/585655
推荐阅读
相关标签
  

闽ICP备14008679号