一 .解决 rosdep init 命令执行不成功 :
不成功信息:
RROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
解决方法:
第一步:登陆 IPAddress.com 首页并输入 raw.githubusercontent.com 查询最新网址,一般选择第一个网址就可以,再与 raw.githubusercontent.com 以如下格式输入到/etc/hosts 文件的最后一行.
185.199.108.133 raw.githubusercontent.com
第二步:执行 sudo rosdep init 即可成功.
二 . 解决rosdep update 命令不成功:
不成功信息大体如下:
eading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
<urlopen error timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
<urlopen error timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)
ERROR: error loading sources list:
The read operation timed out
解决方法:
第一步: 克隆 rosdistro 文件版本地, 执行:
git clone https://github.com/ros/rosdistro.git
保存到一个明确的位置.
第二步: 将URL路径改为本地 rosdistro 文件路径
1.
cd /文件路径/rosdistro/rosdep/sources.list.d/
sudo vim 20-default.list
修改后:
# os-specific listings first
yaml file:///home/rosSoftware/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/rosSoftware/rosdistro/rosdep/base.yaml
yaml file:///home/rosSoftware/rosdistro/rosdep/python.yaml
yaml file:///home/rosSoftware/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/rosSoftware/rosdistro/releases/fuerte.yaml fuerte
2. 需注意: melodic 版本及以前版本在 python2.7 路径下修改, Noetic 在 python3 路径下修改
cd /usr/lib/python3/dist-packages/rosdep2/
sudo vim gbpdistro_support.py
修改后:
FUERTE_GBPDISTRO_URL = 'file:///home/rosSoftware/rosdistro/' \
'releases/fuerte.yaml'
3.
cd /usr/lib/python3/dist-packages/rosdep2/
sudo gedit rep3.py
修改后:
REP3_TARGETS_URL = 'file:///home/rosSoftware/rosdistro/releases/targets.yaml'
4.
cd /usr/lib/python3/dist-packages/rosdistro/
sudo gedit __init__.py
修改后:
DEFAULT_INDEX_URL = 'file:///home/rosSoftware/rosdistro/index-v4.yaml'
5.
cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list
修改后:
yaml file:///home/rosSoftware/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/rosSoftware/rosdistro/rosdep/base.yaml
yaml file:///home/rosSoftware/rosdistro/rosdep/python.yaml
yaml file:///home/rosSoftware/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/rosSoftware/rosdistro/releases/fuerte.yaml fuerte
第三步: 执行 rosdep update
执行结果若如下则成功:
eading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///home/rosSoftware/rosdistro/rosdep/osx-homebrew.yaml
Hit file:///home/rosSoftware/rosdistro/rosdep/base.yaml
Hit file:///home/rosSoftware/rosdistro/rosdep/python.yaml
Hit file:///home/rosSoftware/rosdistro/rosdep/ruby.yaml
Hit file:///home/rosSoftware/rosdistro/releases/fuerte.yaml
Query rosdistro index file:///home/rosSoftware/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 /home/.ros/rosdep/sources.cache
*rosdistro本地路径及内部文件路径一定要正确*
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)