ROS学习笔记(十二)ROS noetic ubuntu20.04 版本 rosdep init,rosdep update 问题解决方法
ROS1 noetic 版本在ubuntu20.04安裝出現問題,rosdep update無法下載,網絡地址訪問超時。
ROS1 noetic 版本在ubuntu20.04系統上的安裝方法見博客:Ubuntu Server 20.04 based on Raspberry- Pi-4B 安裝 ROS1 Noetic_Wogg的博客-CSDN博客
一、rosdep init問題
1. sudo rosdep init 出現安全問題
sudo rosdep init命令時出現訪問安全性問題,通過將
sudo vim /etc/apt/sources.list.d/ros-latest.list在ros-latest.list文件中進行修改?
deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ focal main改為:deb [trusted=yes]?http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ focal main可以順利通過sudo rosdep init命令。
2. sudo rosdep init 出現網絡問題
出現一下問題:
ubuntu@ubuntu:~$ sudo rosdep init ERROR: cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down.方法一: 增加raw.githubusercontent.com域名與ip之間的映射
$ sudo vim /etc/hosts151.101.84.133 raw.githubusercontent.com方法二: 直接創建文件
sudo rosdep init ?作用就是在cd /etc/ros/rosdep/sources.list.d下創建下載列表20-default.list,網站掛掉,直接在相關文件夾下創建即可,無需再執行命令
cd /etc/ros/rosdep/sources.list.d touch 20-default.list?20-default.list文件內容如下:
# os-specific listings first yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx# generic yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead二、rosdep update問題
rosdep update 核心問題就是raw.githubusercontent.com無法訪問,導致相關文件無法下載。
使用IP138?查詢raw.githubusercontent.com,發現該域名已經被禁止。
按照網上的方法,通過在/etc/hosts中添加域名解析的ip:【151.101.84:133 ?raw.githubusercontent.com】也無法解決,更換過多個ip也無濟于事。
將需要的文件下載到本地,然后指定文件的位置,即可解決該問題。
1. 從github上下載所需要的rosdistro
git clone https://github.com/ros/rosdistro.gitgit下載較慢,可從這里下載:?
rosdistro-master.zip-互聯網文檔類資源-CSDN下載
將下載好的包移動到指定位置,例如:
sudo cp -r rosdistro /etc/ros*** 也可不用移動,在下邊的步驟中將?20-default.list中的文件路徑指定到此包的相應文件即可。
2. 更改sources.list.d
sudo vim /etc/ros/rosdep/sources.list.d/20-default.list在20-default.list文件更改下載項所在的位置。
# os-specific listings first yaml file:///etc/ros/rosdistro/rosdep/osx-homebrew.yaml osx# generic yaml file:///etc/ros/rosdistro/rosdep/base.yaml yaml file:///etc/ros/rosdistro/rosdep/python.yaml yaml file:///etc/ros/rosdistro/rosdep/ruby.yaml gbpdistro file:///etc/ros/rosdistro/releases/fuerte.yaml fuerte# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead但是,此時,還有部分文件仍然無法下載。
$ rosdep update reading in sources list data from /etc/ros/rosdep/sources.list.d Hit file:///etc/ros/rosdistro/rosdep/osx-homebrew.yaml Hit file:///etc/ros/rosdistro/rosdep/base.yaml Hit file:///etc/ros/rosdistro/rosdep/python.yaml Hit file:///etc/ros/rosdistro/rosdep/ruby.yaml ERROR: unable to process source [file:///etc/ros/rosdistro/releases/fuerte.yaml]:Failed to download target platform data for gbpdistro:<urlopen error timed out> Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml ERROR: error loading sources list:<urlopen error <urlopen error timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>?此時需要修改index-v4.yaml所在的位置
3. 更改python中的ros相關下載項
ros noetic版本基于python3,所以在/usr/lib/python3路徑下修改,其他ros版本若基于python2的,需要找到對應的python2 路徑進行修改。
3.1 修改在__init__.py文件中修改index-v4.yaml的位置
sudo vim /usr/lib/python3/dist-packages/rosdistro/__init__.py #DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml' DEFAULT_INDEX_URL = 'file:///etc/ros/rosdistro/index-v4.yaml'3.2在rep3.py中修改targets.yaml文件的位置?
sudo vim /usr/lib/python3/dist-packages/rosdep2/rep3.py # location of targets file for processing gbpdistro files #REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml' REP3_TARGETS_URL = 'file:///etc/ros/rosdistro/releases/targets.yaml'4. 進行更新
rosdep update ubuntu@ubuntu:/etc/ros/rosdep/sources.list.d$ sudo rosdep update reading in sources list data from /etc/ros/rosdep/sources.list.d Warning: running 'rosdep update' as root is not recommended.You should run 'sudo rosdep fix-permissions' and invoke 'rosdep update' again without sudo. Hit file:///etc/ros/rosdistro/rosdep/osx-homebrew.yaml Hit file:///etc/ros/rosdistro/rosdep/base.yaml Hit file:///etc/ros/rosdistro/rosdep/python.yaml Hit file:///etc/ros/rosdistro/rosdep/ruby.yaml Hit file:///etc/ros/rosdistro/releases/fuerte.yaml Query rosdistro index file:///etc/ros/rosdistro/index-v4.yaml Skip end-of-life distro "ardent" Skip end-of-life distro "bouncy" Skip end-of-life distro "crystal" Skip end-of-life distro "dashing" Skip end-of-life distro "eloquent" Add distro "foxy" Add distro "galactic" Skip end-of-life distro "groovy" Skip end-of-life distro "hydro" Skip end-of-life distro "indigo" Skip end-of-life distro "jade" Skip end-of-life distro "kinetic" Skip end-of-life distro "lunar" Add distro "melodic" Add distro "noetic" Add distro "rolling" updated cache in /root/.ros/rosdep/sources.cacheenjoy!
參考:
rosdep update一定能通過簡單方法rosdep update_努力是明天快樂的源泉-CSDN博客
解決ROS系統 rosdep update超時問題的新方法_leida_wt的博客-CSDN博客_rosdep update 超時
ros 中ERROR: cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdist_果肉蟲的博客-CSDN博客
ubuntu18 ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/ros_蛇皮怪皮蛇的博客-CSDN博客
rosdep update 的解決_快樂男生總冠軍的博客-CSDN博客_rosdep update
Ubuntu 18.04.05 LTS配置ROS Melodic各種問題詳細解決(填坑)_曉晨的博客-CSDN博客
總結
以上是生活随笔為你收集整理的ROS学习笔记(十二)ROS noetic ubuntu20.04 版本 rosdep init,rosdep update 问题解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dp备份错误:Mount request
- 下一篇: 【读书2】【2014】基于MATLAB的