PX4无人机安装问题及解决方案

2023-05-16

文章目录

  • 1. git clone
    • 1) git clone fatal error
    • 2) PX4源码下载很慢
  • 2.ROS安装
    • 1) 设置密钥
    • 2)E: 无法定位软件包 ros-melodic-desktop-full
    • 3) sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential未满足的依赖关系
    • 4) rosdep update超时
  • 3. mavros安装
    • 1) 正在连接 raw.githubusercontent.com,无法建立 SSL 连接

1. git clone

1) git clone fatal error

一开始尝试了这个解决方案发现可以clone了但是很慢后面直接又fatal error,然后就把校园网关掉,改成连接手机热点即可



2) PX4源码下载很慢

  1. 参考文章https://blog.csdn.net/qq_43212651/article/details/116193397
    本来是要使用以下命令的
git clone https://github.com/PX4/Firmware.git --recursive

可以将其分成

git clone https://github.com/PX4/Firmware.git
cd Firmware
git submodule update --init --recursive

git submodule update --init --recursive出错将--init去掉,使用命令git submodule update --recursive即可

  1. 还可以使用码云加速,然后修改.gitmodules文件,具体步骤参考https://blog.csdn.net/qq_44939973/article/details/120965458
git clone https://gitee.com/robin_shaun/PX4_Firmware
cd PX4_Firmware
git checkout -b xtdrone/dev v1.11.0-beta1
bash ./Tools/setup/ubuntu.sh --no-nuttx --no-sim-tools

我在git clone https://gitee.com/robin_shaun/PX4_Firmware时,出现了fatal: repository 'https://xxx/xxx.git/' not found,后面把https的s去掉就可以,但是后面git submodule update --init --recursive的时候又出现了这种类型的错误(我的不是这个,这个是在网上找到的一种类型的错误),看别人给的解决方法是我写的上一个方法。

error: Server does not allow request for unadvertised object 5be5d61e5e5a93911256b5f2106e50da0ca81e8d
Fetched in submodule path 'squashfs-tools', but it did not contain 5be5d61e5e5a93911256b5f2106e50da0ca81e8d. Direct fetching of that commit failed.

后面发现是我之前配置过全局配置,git config --global url."https://gitclone.com/".insteadOf https://,将全局配置删除即可直接git clone https://gitee.com/robin_shaun/PX4_Firmware,具体操作参考博客



2.ROS安装

1) 设置密钥

官网上的命令为

sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

直接执行第二条命令会报错gpg: 找不到有效的 OpenPGP 数据
解决方法为,第二条命令中,将其拆分为

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

这里参考了https://blog.csdn.net/wiborgite/article/details/52840371



2)E: 无法定位软件包 ros-melodic-desktop-full

这里找了很多个解决方案,换源什么的都不行,后面发现有人安装的是ros-melodic,有人安装的是ros-noetic,然后搜了一下才发现melodic—对应ubuntu 18.04,noetic —对应ubuntu20.04,各位根据对应的Ubuntu版本下载对应的版本

sudo apt install ros-melodic-desktop-full
sudo apt install ros-noetic-desktop-full


3) sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential未满足的依赖关系

我是因为没有创建catkin_ws文件夹,创建了再运行命令就没报错,一开始用aptitude安装这些包就直接把我的melodic删除了。
报错如下:

下列软件包有未满足的依赖关系:
 python3-rosdep : 依赖: python3-catkin-pkg 但是它将不会被安装
                  依赖: python3-rosdistro 但是它将不会被安装
                  依赖: python3-rospkg 但是它将不会被安装
                  依赖: python3-rosdep-modules (>= 0.21.0) 但是它将不会被安装
 python3-rosinstall : 依赖: python3-rosdistro (>= 0.3.0) 但是它将不会被安装
                      依赖: python3-catkin-pkg 但是它将不会被安装
 python3-rosinstall-generator : 依赖: python3-catkin-pkg (>= 0.1.28) 但是它将不会被安装
                                依赖: python3-rosdistro (>= 0.7.3) 但是它将不会被安装
                                依赖: python3-rospkg 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

创建catkin_ws文件夹:

mkdir -p ~/catkin_ws/src
mkdir -p ~/catkin_ws/scripts
cd catkin_ws/src 
catkin_init_workspace
cd .. 
catkin_make


4) rosdep update超时

https://blog.csdn.net/weixin_44023934/article/details/121242176



3. mavros安装

1) 正在连接 raw.githubusercontent.com,无法建立 SSL 连接

注意:用我的方法第一次成功了,后面想重新尝试命令时又不成功(我也不知道为啥)

用命令wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh时报了如下错误:正在连接 raw.githubusercontent.com,无法建立 SSL 连接,用了网上的方法查找raw.githubusercontent.com的ip地址再将其放入/etc/hosts里面,发现没用

我hosts里面的内容是这样的(按照教程修改后):

127.0.0.1	localhost
127.0.1.1	xw-virtual-machine
20.205.243.166   github.com
199.96.59.19   github.global.ssl.fastly.net

199.232.28.133 raw.githubusercontent.com
151.101.228.133 raw.github.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

我把151.101.228.133 raw.github.com注释掉后,发现权限不够

--2022-03-22 20:52:46--  https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 1244 (1.2K) [text/plain]
install_geographiclib_datasets.sh: 权限不够

无法写入 “install_geographiclib_datasets.sh” (成功)

加上sudo后又报错无法建立 SSL 连接,后面把https改成http再在最后加上--no-check-certificate后成功了

sudo wget http://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh --no-check-certificate

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

PX4无人机安装问题及解决方案 的相关文章

  • ardupilot & px4 书写自己的app & drivers (二)

    新建任务列表任务 打印时间 任务列表 const AP Scheduler span class hljs tag Task span Copter span class hljs tag scheduler tasks span span
  • 下载并构建PX4

    根据官方的文档 xff0c PX4下载和构建的方式有两种 xff1a Linux系列的Console模式 xff08 当然也支持Windows下的MINGW32 xff09 和Windows模式 在Windows平台下 xff0c 我们习惯
  • PX4使用I2C方式添加自定义传感器(1)

    PX4使用I2C方式添加自定义传感器 xff08 1 xff09 前言 毕业设计就是要在PX4上添加一个传感器 xff08 角度传感器 xff09 xff0c 由于板子上的接口数量很少 xff0c 很是宝贵 最后只能选择通过I2C通信方式
  • PX4通过I2C方式添加自定义传感器(3)

    添加自定义传感器并实现数据的发送和订阅 1 前期准备 1 1 建立文件夹和相关文件配置 我是在src drivers distance sensor文件夹下操作的 xff0c 当然其他文件夹下都类似 首先建立了两个文件夹angle sour
  • px4: v2的主板刷写v2的固件

    v2的主板刷写v2的固件 fengxuewei 64 fengxuewei Legion Y7000 2019 PG0 src Firmware changwei rc span class token function make span
  • PX4 SITL Gazebo 仿真时 libgazebo_multirotor_base_plugin 插件运行时出错

    PX4 SITL Gazebo 仿真时 libgazebo multirotor base plugin 插件运行时出错 问题描述原因分析解决办法总结 问题描述 在 Gazebo 中进行 PX4 的软件在环仿真时 xff0c 执 make
  • PX4位置控制offboard模式说明

    offboard模式的开发及应用 一 px4固件的模式 px4固件支持10几种飞行模式 xff0c 从代码结构上分析 xff0c 分为基本模式 自定义模式和自定义子模式 1 基本模式 基本模式又分为 xff0c 位置控制模式 自稳模式 手动
  • 关于PX4中的高度若干问题

    飞行的高度是如何测量的 xff1f 地面的高度和海平面的高度差别很大 xff0c 飞控又是如何有效判别进行降落的 xff1f 这是我脑子里的疑问 搜索的一圈发现很少有人讨论这方面的问题 xff0c 于是本次我就直接看一下源代码 xff0c
  • Ubuntu下构建PX4软件

    本搭建过程基于http dev px4 io starting building html xff0c 希望大家互相交流学习 原文 xff1a Building PX4 Software xff08 构建PX4软件 xff09 PX4 ca
  • PX4源代码下载编译

    sudo git clone https github com PX4 PX4 Autopilot git recursivegit submodule update init recursivegit submodule update r
  • 从Simulink到PX4——Simulink-PX4插件安装与环境搭建

    从Simulink到PX4 Simulink PX4插件安装与环境搭建 前言0 准备工作1 安装WSL2 Setting up the PX4 Toolchain on Windows3 Setting up the PX4 Tool Ch
  • PX4模块设计之三:自定义uORB消息

    PX4模块设计之三 xff1a 自定义uORB消息 1 新增自定义uORB消息步骤2 应用ext hello world消息示例3 编译执行结果4 参考资料 基于PX4开源软件框架简明简介和PX4模块设计之二 xff1a uORB消息代理
  • PX4模块设计之二十一:uORB消息管理模块

    PX4模块设计之二十一 xff1a uORB消息管理模块 1 uORB模块构建模式2 uORB消息管理函数2 1 状态查询2 2 资源利用2 3 模块启动2 4 模块停止3 uORB消息接口3 1 消息主题注册3 2 消息主题去注册3 3
  • PX4模块设计之三十四:ControlAllocator模块

    PX4模块设计之三十四 xff1a ControlAllocator模块 1 ControlAllocator模块简介2 模块入口函数2 1 主入口control allocator main2 2 自定义子命令custom command
  • PX4模块设计之三十九:Commander模块

    PX4模块设计之三十九 xff1a Commander模块 1 Commander模块简介2 模块入口函数2 1 主入口commander main2 2 自定义子命令custom command 3 Commander模块重要函数3 1
  • PX4模块设计之四十三:icm20689模块

    PX4模块设计之四十三 xff1a icm20689模块 1 icm20689模块简介2 模块入口函数2 1 主入口icm20689 main2 2 自定义子命令custom command2 3 模块状态print status 重载 3
  • 【px4】运行mavsdk中的offboard example

    运行MAVSDK中的offboard例子时无人机不执行 想控制无人机前后左右移动 xff0c 在按照官方教程实现offboard 插件的时候 发现用action插件能正常起飞和降落 但是一旦执行到offboard的插件代码的时候就会自动降落
  • px4无人机常识介绍(固件,px4等)

    专业名词解释 aircraft 任何可以飞或者可以携带物品还是搭载旅客的飞行器统称为飞机 航空器 uav 无人驾驶飞机 vehicle 飞行器 airplane plane aero plane 有机翼和一个或多个引擎的飞行器统称为飞机 D
  • pixhawk px4 commander.cpp

    对于复杂的函数 xff0c 要做的就是看函数的输入是什么 来自哪里 xff0c 经过处理后得到什么 给谁用 xff0c 这样就可以把程序逻辑理清 中间的分析就是看函数如何处理的 span class hljs keyword extern
  • PX4 OffBoard Control

    终于还是走上了这一步 xff0c 对飞控下手 xff0c 可以说是一张白纸了 记录一下学习的过程方便以后的查阅 目录 一 ubuntu18 04配置px4编译环境及mavros环境 二 PX4的OffBoard控制 1 搭建功能包 2 编写

随机推荐