赞
踩
一开始尝试了这个解决方案发现可以clone了但是很慢后面直接又fatal error,然后就把校园网关掉,改成连接手机热点即可
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
即可
.gitmodules
文件,具体步骤参考https://blog.csdn.net/qq_44939973/article/details/120965458git 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
,具体操作参考博客
官网上的命令为
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
这里找了很多个解决方案,换源什么的都不行,后面发现有人安装的是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
我是因为没有创建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
https://blog.csdn.net/weixin_44023934/article/details/121242176
注意:用我的方法第一次成功了,后面想重新尝试命令时又不成功(我也不知道为啥)
用命令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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。