搭建无人机仿真环境之PX4安装

2023-05-16

搭建无人机仿真环境之PX4安装

    • 安装依赖包
    • 下载固件
    • git submodule update --init --recursive中遇到的问题
    • make posix_sitl_default gazebo中遇到的问题
    • 运行roslaunch px4 mavros_posix_sitl.launch遇到的问题

安装依赖包

sudo apt install python3-pip
pip3 install --user pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --user jinja2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --user empy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --user packaging -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --user toml -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --user numpy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install --user pyquaternion -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

如果遇到问题:

安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError

解决办法如:

pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

下载固件

git clone https://github.com/PX4/Firmware
mv Firmware PX4_Firmware
cd PX4_Firmware
git checkout -b xtdrone/dev v1.11.0-beta1
git submodule update --init --recursive
make posix_sitl_default gazebo

如果遇到git clone 速度非常慢,可以将原本的网站中的http://github.com 进行替换为github.com.cnpmjs.org。例如 git clone https://github.com.cnpmjs.org/PX4/Firmware

git submodule update --init --recursive中遇到的问题

  • 问题1

如果使用镜像github.com.cnpmjs.org进行git clone ,在执行git submodule update --init --recursive时出现:

~/PX4_Firmware$ git submodule update --init --recursive
子模组 'Tools/jMAVSim'(https://github.com.cnpmjs.org/PX4/jMAVSim.git)未对路径 'Tools/jMAVSim' 注册
子模组 'Tools/sitl_gazebo'(https://github.com.cnpmjs.org/PX4/sitl_gazebo.git)未对路径 'Tools/sitl_gazebo' 注册
子模组 'boards/atlflight/cmake_hexagon'(https://github.com.cnpmjs.org/PX4/cmake_hexagon.git)未对路径 'boards/atlflight/cmake_hexagon' 注册
子模组 'mavlink/include/mavlink/v2.0'(https://github.com.cnpmjs.org/mavlink/c_library_v2.git)未对路径 'mavlink/include/mavlink/v2.0' 注册
子模组 'platforms/nuttx/NuttX/apps'(https://github.com.cnpmjs.org/PX4/NuttX-apps.git)未对路径 'platforms/nuttx/NuttX/apps' 注册
子模组 'platforms/nuttx/NuttX/nuttx'(https://github.com.cnpmjs.org/PX4/NuttX.git)未对路径 'platforms/nuttx/NuttX/nuttx' 注册
子模组 'platforms/qurt/dspal'(https://github.com.cnpmjs.org/ATLFlight/dspal.git)未对路径 'platforms/qurt/dspal' 注册
子模组 'src/drivers/gps/devices'(https://github.com.cnpmjs.org/PX4/GpsDrivers.git)未对路径 'src/drivers/gps/devices' 注册
子模组 'src/drivers/uavcan/libuavcan'(https://github.com.cnpmjs.org/PX4/uavcan.git)未对路径 'src/drivers/uavcan/libuavcan' 注册
子模组 'src/lib/ecl'(https://github.com.cnpmjs.org/PX4/ecl.git)未对路径 'src/lib/ecl' 注册
子模组 'src/lib/matrix'(https://github.com.cnpmjs.org/PX4/Matrix.git)未对路径 'src/lib/matrix' 注册
子模组 'src/modules/micrortps_bridge/micro-CDR'(https://github.com.cnpmjs.org/PX4/micro-CDR.git)未对路径 'src/modules/micrortps_bridge/micro-CDR' 注册

解决方法:
检查 .gitmodule文件中的url格式
按照以下方法更换一下即可:

gedit .gitmodules

将.gitmodules文件中所有github.com替换为github.com.cnpmjs.org,例如
[submodule “mavlink/include/mavlink/v2.0”]
path = mavlink/include/mavlink/v2.0
url = https://github.com.cnpmjs.org/mavlink/c_library_v2.git
branch = master

修改完后,再次执行:

git submodule sync
  • 问题2
dj@dj-virtual-machine:~/PX4_Firmware$ git submodule update --init --recursive
fatal: Needed a single revision
无法在子模组路径 'Tools/jMAVSim' 中找到当前版本

解决方法:
删除对应文件夹,如删除文件夹 jMAVSim

make posix_sitl_default gazebo中遇到的问题

  • 问题1
CMake Error at CMakeLists.txt:32 (find_package):
  By not providing "Findgazebo.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gazebo", but
  CMake did not find one.

  Could not find a package configuration file provided by "gazebo" with any
  of the following names:

    gazeboConfig.cmake
    gazebo-config.cmake

  Add the installation prefix of "gazebo" to CMAKE_PREFIX_PATH or set
  "gazebo_DIR" to a directory containing one of the above files.  If "gazebo"
  provides a separate development package or SDK, be sure it has been
  installed.

解决方法:

sudo apt-get install libgazebo9-dev
  • 问题2
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GSTREAMER_LIBRARIES (ADVANCED)
    linked by target "gazebo_vision_plugin" in directory /home/dj/PX4_Firmware/Tools/sitl_gazebo
    linked by target "gazebo_uuv_plugin" in directory /home/dj/PX4_Firmware/Tools/sitl_gazebo
    
... ...
    
-- Configuring incomplete, errors occurred!
See also "/home/dj/PX4_Firmware/build/px4_sitl_default/build_gazebo/CMakeFiles/CMakeOutput.log".
See also "/home/dj/PX4_Firmware/build/px4_sitl_default/build_gazebo/CMakeFiles/CMakeError.log".
[143/573] Building CXX object platform...CMakeFiles/px4_layer.dir/px4_sem.cpp.o
FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-configure 
cd /home/dj/PX4_Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DSEND_VISION_ESTIMATION_DATA=ON -GNinja /home/dj/PX4_Firmware/Tools/sitl_gazebo && /usr/bin/cmake -E touch /home/dj/PX4_Firmware/build/px4_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-configure
[151/573] Building CXX object platform...n/CMakeFiles/px4_layer.dir/tasks.cpp.o
ninja: build stopped: subcommand failed.
Makefile:198: recipe for target 'px4_sitl_default' failed
make: *** [px4_sitl_default] Error 1

解决方法:

sudo apt-get install libgstreamer-plugins-base1.0-dev
  • 问题3

运行Gazebo出现:[Err] [REST.cc:205] Error in REST request

解决方法:
打开编辑~/.ignition/fuel/config.yaml文件

sudo gedit ~/.ignition/fuel/config.yaml

首先注释 url : https://api.ignitionfuel.org
然后添加 url: https://api.ignitionrobotics.org

servers:
  -
    name: osrf
    url: https://api.ignitionrobotics.org  
# url: https://api.ignitionfuel.org

重新启动即可

运行roslaunch px4 mavros_posix_sitl.launch遇到的问题

  • 问题1
VMware: vmw_ioctl_command error 无效的参数.
Aborted (core dumped)
[gazebo_gui-4] process has died [pid 2104, exit code 134, cmd /opt/ros/melodic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/dj/.ros/log/92926e0c-c1e4-11ea-b959-000c2928d800/gazebo_gui-4.log].
log file: /home/dj/.ros/log/92926e0c-c1e4-11ea-b959-000c2928d800/gazebo_gui-4*.log

解决方法:

$ export SVGA_VGPU10=0
  • 问题2
Resource not found: gazebo_ros
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
ROS path [2]=/home/dj/PX4_Firmware
ROS path [3]=/home/dj/PX4_Firmware/Tools/sitl_gazebo
The traceback for the exception was written to the log file

解决方法:

$ sudo apt-get install ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control

-问题3

RLException: [indoor1.launch] is neither a launch file in package [px4] nor is [px4] a launch file name
The traceback for the exception was written to the log file

解决方法:

source ~/PX4_Firmware/Tools/setup_gazebo.bash ~/PX4_Firmware/ ~/PX4_Firmware/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4_Firmware
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4_Firmware/Tools/sitl_gazebo
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

搭建无人机仿真环境之PX4安装 的相关文章

随机推荐

  • Android 8.1共享系统代理中的热点(LineageOS15.1)

    https github com Mygod VPNHotspot 下载安装这个软件 xff0c 需要ROOT 开发者选项 xff1a 关闭WLAN硬件加速 该软件设置 xff1a 关闭IPV6 打开 修复DHCP 开启手机自带的热点 该软
  • 浏览器页面滚动条美化(样式)

    浏览器页面滚动条美化 xff08 样式 xff09 最近测试反应我们的产品在浏览器中当页面宽高出现溢出的情况下页面滚动条太丑了 xff01 让我们美化一下 xff01 然后花了一点时间专研了一下关于滚动条样式的相关知识 xff0c 今天就在
  • Android串口工具

    参考Android系统实现方式 xff0c 串口操作采用native实现 xff0c 比java层用文件流的方式更高效 xff0c 不需要延时和睡眠处理 xff0c 大量自测不会出现读取不到数据等问题 特点 xff1a 1 提供基本的串口操
  • 【VINS-Fusion入门之一】让系统跑起来

    文章目录 简介配置执行单目 43 IMU双目 43 IMU双目相机双目 43 GPS 落地备注 xff1a 简介 VINS xff0c 英文缩写Visual Inertial Systems 是一个实时视觉SLAM框架 xff0c 2017
  • 【VINS-Fusion入门之二】基于优化的多传感器融合

    文章目录 简介特征参考论文 解读系统框图相机模型 xff1a 配置文件全局优化闭环优化状态估计 简介 VINS Fusion is an optimization based multi sensor state estimator whi
  • RealSense T265使用教程

    RealSense ROS 安装 https github com IntelRealSense realsense ros 安装教程 https www intelrealsense com get started tracking ca
  • c++面试宝典

    目录 一 多线程 二 指针 三 字符串 四 面向对象 五 基本用法 六 c 43 43 11 七 算法 c 43 43 面试必考多线程 xff0c 内存 xff08 智能指针 xff09 xff0c 常见算法 xff0c 设计模式 一 多线
  • 音视频编解码之傅里叶变换和小波变换

    傅里叶变换的核心是从时域到频域的变换 xff0c 而这种变换是通过一组特殊的正交基来实现的 傅立叶变换使我们能通过频率成分来分析一个函数 任何信号 xff08 如图像信号 xff09 都可以表示成一系列正弦信号的叠加 傅立叶变换在实际中有非
  • CMakeLists.txt生成makefile

    本CMakeLists txt的project名称 会自动创建两个变量 xff0c PROJECT SOURCE DIR和PROJECT NAME PROJECT SOURCE DIR xff1a 本CMakeLists txt所在的文件夹
  • 编程之禅-程序员的哲学

    编程之道 xff0c 一个酷爱东方哲学和练太极拳的老外写的书 作者是一位资深的程序设计师 xff0c 从他的爱好和著作中 可以看得出作者的文化底蕴 而他现在从事的工作 xff0c 是如何把最好的管理技术和高科技企业联系起来 xff0c 而这
  • Pixhawk-开篇

    Pixhawk 开篇 互联网上关于介绍Pixhawk的文章特别多 有心人自己去网上查看吧 本篇文章未完 可能会有更新 不足请指出 QQ 4862879 说重点 Pixhawk指的是一款开源的硬件 下图的那个 是把原来的PX4FMU 43 P
  • Pixhawk_bootloader简介

    Pixhawk Bootloader引导过程简介 自己结合网络上的资源总结的内容 有不对的地方请及时指出 有侵权的请指出 QQ 4862879 Pixhawk硬件使用STM32的芯片 Cortex M3的内核有三种启动方式 xff0c 其分
  • 【ROS】移动机器人导航仿真(2)——SLAM(gmapping)

    在前一节中 xff0c 简单介绍了移动机器人的3D建模 xff0c 并在gazebo三维仿真环境中实现了简单的移动 这一节采用gmapping包实现机器人的SLAM xff08 同时定位与地图建立 xff09 使用上一节构建的机器人3D模型
  • Git 远程推送被拒绝的一种解决方案

    Git 远程推送被拒绝的一种解决方案 参考文章 xff1a xff08 1 xff09 Git 远程推送被拒绝的一种解决方案 xff08 2 xff09 https www cnblogs com wf skylark p 9315463
  • 关于putty连接服务器提示server unexpectedly closed connection解决方法

    关于putty连接服务器提示server unexpectedly closed connection解决方法 参考文章 xff1a xff08 1 xff09 关于putty连接服务器提示server unexpectedly close
  • centos7下部署主机监控,mysql指标监控,(prometheus+grafana+node_exporter+mysqld_exporter+alertmanager)

    先解释一下这些组件都是干什么用的 xff0c 组件说明prometheus server 是 Prometheus 组件中的核心部分 xff0c 负责实现对监控数据的获取 xff0c 存储以 及查询 exporter 简单说是采集端 xff
  • HTTP通讯安全中的Digest摘要认证释义与实现

    摘要 出于安全考虑 xff0c HTTP规范定义了几种认证方式以对访问者身份进行鉴权 xff0c 最常见的认证方式之一是Digest认证 Digest认证简介 HTTP通讯采用人类可阅读的文本格式进行数据通讯 xff0c 其内容非常容易被解
  • C/C++学习(2)关于strcpy、strcat函数使用

    strcpy strcat函数使用注意 题目来源 xff1a 点击打开链接 下列程序的打印结果是 char p1 15 61 34 abcd 34 p2 61 34 ABCD 34 str 50 61 34 xyz 34 strcpy st
  • 详解测试驱动开发 Test Driven Development(TDD)

    TDD的目标 Clean Code That Works 这句话的含义是 xff0c 事实上只做两件事情 xff1a 让代码奏效 xff08 Work xff09 和让代码洁净 xff08 Clean xff09 xff0c 前者是把事情做
  • 搭建无人机仿真环境之PX4安装

    搭建无人机仿真环境之PX4安装 安装依赖包下载固件git submodule update init recursive中遇到的问题make posix sitl default gazebo中遇到的问题运行roslaunch px4 ma