PX4配置过程与踩坑
0.前言
由于需要在GitHub下载代码,而国内访问受限,可能会出现一些问题,这里建议使用github国内镜像,参看:GitHub国内镜像网站,当然下面会给出具体解决方案。
1.步骤
1.1下载源码:git clone https://github.com/PX4/PX4-Autopilot.git
注意:
若该步骤出错,使用镜像,也就是运行:git clone https://hub.fastgit.xyz/PX4/PX4-Autopilot.git
或者使用gitee镜像:git clone https://gitee.com/robin_shaun/PX4_Firmware(注意使用这个方法时的源码文件名是PX4_Firmware)
1.2 切换到源码文件夹:cd PX4-Autopilot
1.3 更新工程子模块git submodule update --init --recursive
注意:
若该步骤出错,归根到底还是因为github访问不稳定。解决方案如下:
(方案的总体原则就是改变源码里面各个.gitmodules文件里的下载地址,需要注意的是源码位置,我这里是将源码放在主文件夹下,也就是 ~/PX4_Autopilot)
(1)源码主文件夹下
cd ~/PX4_Autopilotgedit .gitmodules
(注意:这里主要是为了修改文件,我用的是gedit编辑器,也可以用vim, nano,vs code之类的,后面相同)
将 .gitmodules 中的内容更换为:
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://gitee.com/robin_shaun/c_library_v2.git
branch = master
[submodule "src/drivers/uavcan/libuavcan"]
path = src/drivers/uavcan/libuavcan
url = https://gitee.com/robin_shaun/uavcan.git
branch = px4
[submodule "Tools/jMAVSim"]
path = Tools/jMAVSim
url = https://gitee.com/robin_shaun/jMAVSim.git
branch = master
[submodule "Tools/sitl_gazebo"]
path = Tools/sitl_gazebo
url = https://gitee.com/robin_shaun/sitl_gazebo.git
branch = master
[submodule "src/lib/matrix"]
path = src/lib/matrix
url = https://gitee.com/robin_shaun/Matrix.git
branch = master
[submodule "src/lib/ecl"]
path = src/lib/ecl
url = https://gitee.com/robin_shaun/ecl.git
branch = master
[submodule "boards/atlflight/cmake_hexagon"]
path = boards/atlflight/cmake_hexagon
url = https://gitee.com/robin_shaun/cmake_hexagon.git
branch = px4
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://gitee.com/robin_shaun/GpsDrivers.git
branch = master
[submodule "src/modules/micrortps_bridge/micro-CDR"]
path = src/modules/micrortps_bridge/micro-CDR
url = https://gitee.com/robin_shaun/micro-CDR.git
branch = px4
[submodule "platforms/nuttx/NuttX/nuttx"]
path = platforms/nuttx/NuttX/nuttx
url = https://gitee.com/robin_shaun/NuttX.git
branch = px4_firmware_nuttx-9.1.0+
[submodule "platforms/nuttx/NuttX/apps"]
path = platforms/nuttx/NuttX/apps
url = https://gitee.com/robin_shaun/NuttX-apps.git
branch = px4_firmware_nuttx-9.1.0+
[submodule "platforms/qurt/dspal"]
path = platforms/qurt/dspal
url = https://gitee.com/robin_shaun/dspal.git
[submodule "Tools/flightgear_bridge"]
path = Tools/flightgear_bridge
url = https://gitee.com/robin_shaun/PX4-FlightGear-Bridge.git
branch = master
[submodule "Tools/jsbsim_bridge"]
path = Tools/jsbsim_bridge
url = https://gitee.com/robin_shaun/px4-jsbsim-bridge.git
[submodule "src/examples/gyro_fft/CMSIS_5"]
path = src/examples/gyro_fft/CMSIS_5
url = https://gitee.com/mirrors/CMSIS_5
git submodule update --init
(2) libuavcan文件夹
cd ~/PX4_Autopilot/src/drivers/uavcan/libuavcangedit .gitmodules
将 .gitmodules 中的内容更换为:
[submodule "dsdl"]
path = dsdl
url = https://gitee.com/robin_shaun/dsdl
branch = legacy-v0
[submodule "libuavcan/dsdl_compiler/pyuavcan"]
path = libuavcan/dsdl_compiler/pyuavcan
url = https://gitee.com/robin_shaun/pyuavcan
[submodule "libuavcan_drivers/kinetis"]
path = libuavcan_drivers/kinetis
url = https://gitee.com/robin_shaun/libuavcan_kinetis.git
git submodule update --init
(3) jMAVSim文件夹
cd ~/PX4_Autopilot/Tools/jMAVSimgedit .gitmodules
将 .gitmodules 中的内容更换为:
[submodule "jMAVlib"]
path = jMAVlib
url = https://gitee.com/robin_shaun/jMAVlib
branch = master
git submodule update --init
(4) sitl_gazebo文件夹
cd ~/PX4_Autopilot/Tools/sitl_gazebogedit .gitmodules
将 .gitmodules 中的内容更换为:
[submodule "external/OpticalFlow"]
path = external/OpticalFlow
url = https://gitee.com/robin_shaun/OpticalFlow
git submodule update --init
(5) dspal文件夹
cd ~/PX4_Autopilot/platforms/qurt/dspalgedit .gitmodules
将 .gitmodules 中的内容更换为:
[submodule "cmake_hexagon"]
path = cmake_hexagon
url = https://gitee.com/robin_shaun/cmake_hexagon
git submodule update --init
(6) pyuavcan文件夹
cd ~/PX4_Autopilot/src/drivers/uavcan/libuavcan/libuavcan/dsdl_compiler/pyuavcangedit .gitmodules
将 .gitmodules 中的内容更换为:
[submodule "dsdl"]
path = dsdl
url = https://gitee.com/robin_shaun/dsdl
git submodule update --init
(7) OpticalFlow文件夹
cd ~/PX4_Autopilot/Tools/sitl_gazebo/external/OpticalFlowgedit .gitmodules
将 .gitmodules 中的内容更换为:
[submodule "external/klt_feature_tracker"]
path = external/klt_feature_tracker
url = https://gitee.com/robin_shaun/klt_feature_tracker
git submodule update --init
(8)终于修改完了,可以再次运行下这句命令
git submodule update --init
1.4 编译
cd ~/PX4_Firmware
make px4_sitl_default gazebo
注意:
这一步可能会报错:ninja: build stopped: subcommand failed.

不要慌!
- 先看看子模块是否更新成功。执行命令:
git submodule update --init --recursive
linux哲学,没有消息就是好消息,如果没有出现任何内容,说明子模块更新成功(看不懂什么是子模块也没问题,意思就是到此为止,没问题)。 - 接下来清理下make环境就ok了:
make clean - 最后再执行一次编译命令:
make px4_sitl_default gazebo
以下是我成功的界面

2. 祝你配置顺利!如有问题,欢迎讨论!
PX4配置过程与踩坑的更多相关文章
- 菜鸟帮你跳过openstack配置过程中的坑
一:前言 对于一个以前做java全栈工程师而言,而且没学过Linux,很少用虚拟机(还是在大学的时候简单的用过),去配置openstack我想我入的坑肯定比有基础的一定要多,躺在每个坑中徘徊思索的时间 ...
- 菜鸟帮你跳过openstack配置过程中的坑[文末新添加福利]
一:前言 对于一个以前做java全栈工程师而言,而且没学过Linux,很少用虚拟机(还是在大学的时候简单的用过),去配置openstack我想我入的坑肯定比有基础的一定要多,躺在每个坑中徘徊思索的时间 ...
- 《Python3 网络爬虫开发实战》开发环境配置过程中踩过的坑
<Python3 网络爬虫开发实战>学习资料:https://www.cnblogs.com/waiwai14/p/11698175.html 如何从墙内下载Android Studio: ...
- jenkins配置过程中踩过的一些坑
1,编译通过之后,想要将编译好的war包放到远程服务器上,并解压 unzipBus.sh的脚本如下: #!/bin/bash jar -xvf bus.war 编译后报错:jar:Command no ...
- kafka 并发数配置过程中踩到的坑 InstanceAlreadyExistsException
] WARN org.apache.kafka.common.utils.AppInfoParser- Error registering AppInfo mbean javax.management ...
- SpringMVC自定义配置消息转换器踩坑总结
问题描述 最近在开发时候碰到一个问题,springmvc页面向后台传数据的时候,通常我是这样处理的,在前台把数据打成一个json,在后台接口中使用@requestbody定义一个对象来接收,但是这次数 ...
- 多页应用 Webpack4 配置优化与踩坑记录
前言 最近新起了一个多页项目,之前都未使用 webpack4 ,于是准备上手实践一下.这篇文章主要就是一些配置介绍,对于正准备使用 webpack4 的同学,可以做一些参考. webpack4 相比之 ...
- 通过PAML中的CODEML模块计算dnds的过程以及踩坑
最近帮女朋友做毕业设计的时候用到了 PAML这个软件的codeml功能,发现网上相关的资料很少,于是把自己踩的一些坑分享一下,希望能帮到其他有相同困难的人 一.下载与安装 PAML软件下载地址 htt ...
- VirtualBox 下 CentOS7 静态 IP 的配置 → 多次踩坑总结,蚌埠住了!
开心一刻 一个消化不良的病人向医生抱怨:我近来很不正常,吃什么拉什么,吃黄瓜拉黄瓜,吃西瓜拉西瓜,怎样才能恢复正常呢? 医生沉默片刻:那你只能吃屎了 环境准备 VirtualBox 6.1 网络连接方 ...
随机推荐
- 手把手教你学vue-4(vuex)
1.首先明白vuex是做什么用的. 管理统一组件状态state.每个应用将仅仅包含一个 store 实例.单一状态树让我们能够直接地定位任一特定的状态片段,在调试的过程中也能轻易地取得整个当前应用状态 ...
- 如何使用vue-cli搭建好的项目
本人是一枚前端小白,也是从零开始学习vue.js.由于闲着蛋疼,写一点自己的经验,可能有点low.是新手想上道的话,可以看看,如果有大神,也可以给我指导一下,小生感激不尽. 关于如何使用vue-cli ...
- vs技巧 - 调试asp.net core源码
学习asp.net core的方式除了看官方文档,看源码是也是一种很好的方式.本文介绍一种方法,简单配置vs,无需第三方插件就可以将asp.net core的源码链接自己的项目,随时穿梭于core的源 ...
- Jenkins忘记admin密码
我的解决方法: 1.找到Jenkins的comfig.xml配置文件 可以使用find或者locate来查找. 2.备份原来的配置文件,cp备份. 3.修改配置文件: 因为在comfig.xml中ad ...
- 网卡激活-up(dhcp方式获得ip)
一次修复记录 采样: [root@fp-web-124 network-scripts]# cat /etc/redhat-release CentOS Linux release 7.2.1511 ...
- APSI - 2
上一篇 APSI-1 其实就是对开源库README文件的一个翻译加上自己的一点点理解,因为篇幅过大,导致继续编辑有些卡顿,所以新开一篇继续. 前面介绍了APSI的大致技术.优化方法.以及举例说明了主要 ...
- LibreOffice(开源免费办公软件)
LibreOffice(开源免费办公软件) 官方地址 中文网站:https://zh-cn.libreoffice.org/ 下载地址: https://zh-cn.libreoffice.org/d ...
- linux压缩及解压命令
.zip文件:压缩:zip,解压:unzip 如果要解压到指定目录,可以加上 -d 选项 .gz文件:压缩:gzip,解压:gunzip 压缩.解压缩后原文件丢失,可以加上 -c 选项利用 linux ...
- Linux内核--链表结构(二)
Linux内核链表定义了一系列用于链表遍历的宏,本章详细描述. 一.container_of和offsetof 首先介绍两个很好用的宏container_of和offsetof.offsetof宏用于 ...
- 从实例学习 Go 语言、"基础与进阶" 学习笔记及心得体会、Go指南
第一轮学习 golang "基础与进阶"学习笔记,Go指南练习题目解析.使用学习资料 <Go-zh/tour tour>.记录我认为会比较容易忘记的知识点,进行补充,整 ...