如何解决ROS安装过程中rosdep init和rosdep update报错误的问题

这篇具有很好参考价值的文章主要介绍了如何解决ROS安装过程中rosdep init和rosdep update报错误的问题。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

几年没手工安装ros了,一般拉个安装好了cuda和ros等工具软件的docker image直接使用,以前安装过程中很顺利不会有什么报错,最近按照melodic/Installation/Ubuntu - ROS Wiki这里的步骤安装melodic

sudo apt install lsb-core
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
sudo apt update
sudo apt install ros-melodic-desktop-full
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo rosdep init
rosdep update

或noetic/Installation/Ubuntu - ROS Wiki

sudo apt install lsb-core
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
sudo apt update
sudo apt install ros-noetic-desktop-full
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo rosdep init
rosdep update

这里的步骤安装noetic,执行到curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -时

死掉,rosdep init和rosdep update时总是下面的报错:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
    <urlopen error [Errno 111] Connection refused> (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 [Errno 111] Connection refused> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)

...

根本原因是执行这些步骤时需要连到raw.githubusercontent.com这个已经被墙掉的网站下载一些文件,网上推荐的解决办法一般是去修改/etc/resolve.conf或者/etc/hosts增加谷歌的服务器ip地址或githubusercontent.com的ip地址,点击这个网址raw.githubusercontent.com获取githubusercontent.com的ip地址:

如何解决ROS安装过程中rosdep init和rosdep update报错误的问题,ROS,ros,rosdep

 把这些地址加入到/etc/hosts里发现,每个地址访问一次后就被阻住,要过好一阵才能再访问,所以安装不能顺利进行下去。

被逼着去翻看了一下ros源码和网上信息,其实解决比较简单,对于ros.asc(我下载后上传到了这里)下载不了,可以从国内镜像网站上下载这个文件到本地,然后执行:

sudo apt-key add ros.asc

对于rosdep init和rosdep update报错思路就是把从githubusercontent.com上下载文件改成从国内的镜像网站下载即可,

执行下面的命令即完成了rosdep init 和rosdep update:

sudo apt-get install wget
sudo mkdir -p /etc/ros/rosdep/sources.list.d
wget https://mirrors.tuna.tsinghua.edu.cn/github-raw/ros/rosdistro/master/rosdep/sources.list.d/20-default.list -O /etc/ros/rosdep/sources.list.d/20-default.list
export ROSDISTRO_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/rosdistro/index-v4.yaml && rosdep update

后来看到网上有人单独做了个工具rosdepc来替代rosdep,可以执行下面的命令安装:


sudo apt-get install python3-pip 
sudo pip install rosdepc

然后执行rosdepc init和rosdepc update

但是因为OS环境支持的字符集的不同,执行过程中可能会报下面的错误:

Traceback (most recent call last):
  File "/usr/local/bin/rosdepc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rosdepc/rosdepc.py", line 52, in main
    print(hints['welcome'])
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-7: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/local/bin/rosdepc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rosdepc/rosdepc.py", line 52, in main
    print(hints['welcome'])
UnicodeEncodeError: 'ascii' codec can't encode character '\u201c' in position 145: ordinal not in range(128)

原因是这个rosdepc工具的/usr/local/lib/python3.6/dist-packages/rosdepc/rosdepc.py这个文件里写了大量的用于提示的中文字符以及@等ascii码字符集不支持的字符,把里面的包含的中文和特殊格式符都删掉即可,这些信息其实没啥用,删干净了再执行rosdepc init即可,可以看到rosdepc.py这个文件里的核心语句其实就是我上面写的那几句命令,所以完全不用安装这个工具包,直接执行这两句命令更简捷:文章来源地址https://www.toymoban.com/news/detail-571926.html

wget https://mirrors.tuna.tsinghua.edu.cn/github-raw/ros/rosdistro/master/rosdep/sources.list.d/20-default.list -O /etc/ros/rosdep/sources.list.d/20-default.list
export ROSDISTRO_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/rosdistro/index-v4.yaml && rosdep update

到了这里,关于如何解决ROS安装过程中rosdep init和rosdep update报错误的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • git submodule update --init 失败解决办法

    我们在github上寻找开源项目的源码,clone下来研究的时候,由于项目需要多个开源项目的支持,所有还需要二次clone子工程的源码支持,比如最近在使用: grpc 在clone子模块的时候会出现失败或无法访问的情况,其原因众所周知无非就是有些东西需要科学上网 找到项目的.gitmodul

    2024年02月16日
    浏览(31)
  • ARM板上 rosdep update 遇到的问题

    RROR: Rosdep experienced an error: Unable to handle \\\'index\\\' format version \\\'3\\\', please update rosdistro Please go to the rosdep page [1] and file a bug report with the stack trace below. [1] : http://www.ros.org/wiki/rosdep rosdep version: 0.10.25 Traceback (most recent call last): File \\\"/usr/lib/pymodules/python2.7/rosdep2/main.py\\\", line 121, in rosdep_main

    2024年02月14日
    浏览(34)
  • git submodule update --init命令速度太慢的解决方法

    我们在 clone 某个代码库时,代码库可能使用了其他代码库的资源,开发者为避免重复开发,将使用到的其他库以链接的方式作为公共资源保存,我们需要在 clone 之后执行以下命令才能得到完整的依赖: 但是在执行 git submodule update --init 命令时,由于没有提示条,且看不到实

    2024年02月12日
    浏览(42)
  • 【Android】adb安装错误:INSTALL_FAILED_UPDATE_INCOMPATIBLE可尝试的解决方法

    1、问题描述 最近打包在测试机上安装应用遇到了这样的错误: 网上的说法是因为包体签名有修改过,旧包虽然卸载了,但还有信息残留在手机里。我回想一下好像确实干过更换包体签名这个事。 2、解决方法 在出现安装错误的测试机上通过adb命令卸载包名对应包体,即便你

    2024年02月11日
    浏览(36)
  • 虚拟机Ubuntu18.04安装对应ROS版本详细教程!(含错误提示解决)

    参考链接: Ubuntu18.04安装Ros(最新最详细亲测)_向日葵骑士Faraday的博客-CSDN博客 1.4 ROS的安装与配置_哔哩哔哩_bilibili ROS官网:http://wiki.ros.org/melodic/Installation/Ubuntu 安装ROS时会自动安装旧版的Cmake3.10.2。所以在安装Ros之前,需要先检查此先是否有安装Cmake。如果之前已经安装新版

    2024年02月02日
    浏览(53)
  • 【carla】ubuntu20.04 编译carla-ros-bridge 安装过程、报错及其解决方法

    下载后进行catkin_make会报错3个错误 Create a catkin workspace: Clone the ROS Bridge repository and submodules: Set up the ROS environment according to the ROS version you have installed: Install the required ros-dependencies: 安装rosdepc,然后运行: 7.创建虚拟环境 8.安装pip依赖 方法1:在conda环境中安装empy: conda instal

    2024年02月11日
    浏览(44)
  • 解决Ubuntu软件更新命令:sudo apt-get update的“N: 无法安全地用该源进行更新,所以默认禁用该源”错误并安装gcc

    使用快捷键:Ctrl+Alt+T打开终端进入命令行 使用命令确认Ubuntu版本: 镜像源网址: https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/ 打开之后如图所示,因为没有找到完全对应的Ubuntu版本号,尝试选择了Ubuntu版本:22.10,亲测可行 因为初始的Ubuntu不自带vim工具,所以这里用vi进行编辑文件

    2024年01月19日
    浏览(33)
  • Ubuntu sudo apt update 过程中遇到的报错解决

    E: 仓库 “https://mirrors.aliyun.com/docker-ce/linux/ubuntu kylin Release” 没有 Release 文件。 sudo apt update:仓库 “http://mirrors.aliyun.com/docker-ce/linux/debian ulyana Release” 没有 Release 文件 Linux更换国内源–解决终端下载速度慢的问题 在使用 sudo apt update 更新源时,发现报了一大堆错。例如 起初我

    2024年02月02日
    浏览(71)
  • 解决 adb install 错误INSTALL_FAILED_UPDATE_INCOMPATIBLE

             最近给游戏出包,平台要求 v1 签名吧,AS 打包后,adb 执行安装到手机,我用的设备是google pixel6 , android 系统 13, 提示如下: 字面意思理解就是安装包没有 V2 或更高等级的签名。我又尝试在三星平板android系统 8 上安装,咦,安装成功了。那可能就是跟设备 Api 版

    2024年02月12日
    浏览(42)
  • ROS下配置OpenCV+一些错误解决(段错误,核心已转储)

    进入opencv文件夹,创建编译文件夹 选择OpenCV 源码所在路径 和 编译文件所在路径 ,单击【Configure】按钮,默认选项即可,单击【Finish】后,在cmake界面会出现很多变量。 BUILD_opencv_world和OPENCV_ENABLE_NONFREE两个变量,在其后面的方框上打勾。 OPENCV_EXTRA_MODULES_PATH变量,选择路径为

    2024年03月17日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包