【ubuntu20.04】【ROS Noetic】【ROS安装】【Website may be down.】【gpg:
提示:文章写完后,目录可以主动生成,如何生成可参考右边的帮助文档前言
提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越告急,很多人都开启了学习机器学习,本文就先容了机器学习的基础内容。
提示:以下是本篇文章正文内容,下面案例可供参考
一、登入www.ros.org
https://i-blog.csdnimg.cn/direct/7cf35d93cceb4047a206332a5fb9eb59.png#pic_center
ubuntu系统版本为20.04,对应的ros版本为Noetic.
点击下载,根据提示信息设置安装环境:(下列的界面点击安装会加载一(亿)阵子,这是正常现象)
https://i-blog.csdnimg.cn/direct/a2e87e99fc514f388c268d54cadd5e81.png#pic_center来到下载提示界面,跟着官方教程一样寻常可以正常安装(如果你在国外的话),对于国内用户,经常会出现网络等原因的报错,接下来本文将表明安装ros的每一步,并给出安装过程中的报错问题的解决方法,下列案例仅供参考,希望对各位读者有帮助。
1.Setup your sources.list
https://i-blog.csdnimg.cn/direct/52082bab0551420c8e354407e96feff2.png#pic_center
https://i-blog.csdnimg.cn/direct/eaa5800c25064c6b94c6cdce531682d8.png#pic_center
把ros的安装源添加到.lst文件的列表中(相当于给ubuntu装了一个ros商店)
sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
这里的网址是国外的,可以换成国内的源。(点击上图中黄色的Mirrors图标选项)
选择符合的源:
USTC(中国科技大学-安徽合肥)
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.ustc.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
Tsinghua University(清华大学-北京)
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’
Beijing Foreign Studies University(北京外国语大学-北京)
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.bfsu.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
Shanghai Jiao Tong University
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.sjtug.sjtu.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
Zhejiang University
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.zju.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
2.Set up your keys
设置安装密钥
先安装curl工具(#后注释部分不需要复制输入,提示就Y+回车确定)
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 数据。
解决方法:
第一步:
wget http://packages.ros.org/ros.key
第二步:
sudo apt-key add ros.key
第三步:
sudo apt-get update --fix-missing
第四步:
sudo apt install ros-noetic-desktop-full
4.Installation下载安装ros
sudo apt update
从更新后的索引列表中安装ROS系统
sudo apt install ros-noetic-desktop-full
5.环境参数的设置
Environment setup
You must source this script in every bash terminal you use ROS in.
source /opt/ros/noetic/setup.bash
It can be convenient to automatically source this script every time a new shell is launched. These commands will do that for you.
起首需要将ROS的环境设置脚本添加到终端程序的初始化脚本里;
(之后每次打开终端程序都会主动进行ROS系统环境的初始化)
echo “source /opt/ros/noetic/setup.bash” >> ~/.bashrc
source ~/.bashrc
6.测试环节
roscore
出现下列界面表现ros的核心已经运行起来了:
read-normal-img
rosdep初始化
对ros的依赖包工具进行初始化,方便以后安装第三方的扩展软件包
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
read-normal-img
下面这条指令前面已经安装过了
sudo apt install python3-rosdep
7. sudo rosdep init报错 Website may be down.
sudo 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
Website may be down.
<urlopen error <urlopen error Connection refused> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list)>
网站(raw.githubusercontent.com)访问不了,解决方案是添加网址对应的主机IP所在到/etc/hosts文件中:
出现Website may be down.原因是https://raw.githubusercontent.com/是网址访问不稳定(可多实验几次sudo rosdep init)
8、Website may be down.报错解决方案
1)方案一 参考下列博客
https://blog.csdn.net/JIEJINQUANIL/article/details/106164903
比较靠谱的博客:
https://blog.csdn.net/Iamsonice/article/details/116018915
(1)打开/etc/hosts:
sudo gedit /etc/hosts
(2) 添加如下:
199.232.28.133 raw.githubusercontent.com(实测日期24.10.22不可了)
151.101.84.133 raw.githubusercontent.com
保存退出,Website may be down的问题即可解决。
如果照旧不可就登入https://www.ipaddress.com/网址
(右上角)输入raw.githubusercontent.com查询IP所在:
read-normal-img
将查询到的IP替换上面代码的 151.101.84.133,末了输入效果是185.199.108.133 raw.githubusercontent.com,然后再次sudo rosdep init一样寻常就会成功了
(这个页面很靠后,需要一直往下翻)
read-normal-img
2)方案二 安装pip
sudo apt-get install python3-pip
使用pip安装修改工具
sudo pip3 install 6-rosdep
运行刚刚下载好的设置修改工具
sudo 6-rosdep
上述工具原理说明:这是将rosdep的资源文件设置从国外所在修改成国本所在,这样即可顺遂获取资源了,注意这三条指令都会对系统的设置经行修改,需要管理员sudo权限;
关闭终端重新打开新终端,继承执行
sudo rosdep init
rosdep update
安装完毕提示下列信息:
https://i-blog.csdnimg.cn/direct/9f5a6ccbb5bf45d48c66535cae6b8ba1.png#pic_center
9.部分报错解决汇总(仅作参考)
若出现no valid OpenPGP data found,找不到openpgp数据。
wget http://packages.ros.org/ros.key
sudo apt-key add ros.key
sudo apt-get update --fix-missing
sudo apt install ros-noetic-desktop-full
rosdep连接超时的问题,在终端程序中依次执行如下三条指令:
sudo apt-get install python3-pip
sudo pip3 install 6-rosdep
sudo 6-rosdep
然后继承按照官方步调操作即可。
总结
简单讲解了一下ubuntu20.04环境下ROS Noetic版本的安装以及依赖环境的安装,另外给出了ROS安装报错的解决方案,希望对各位读者有帮助,如果遇到问题,接待来到批评区讨论。
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]