200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > ubuntu16安装ros kinetic详细过程(踩多个坑 终于安装完成)

ubuntu16安装ros kinetic详细过程(踩多个坑 终于安装完成)

时间:2022-07-23 22:11:51

相关推荐

ubuntu16安装ros kinetic详细过程(踩多个坑 终于安装完成)

(一)Ubuntu16.04换成清华大学源

(1)备份源文件

# 源文件sources.list 在/etc/apt/目录下# 备份源文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

(2)替换源文件

如果一个源运行更新后一直出现忽略,那就不是好源换一个能够不断出现获取的源,才可以以下,第一个是清华源,第二个是阿里源这里我们将两个源都加入文件中,全一点还是比较好的

sudo gedit /etc/apt/sources.list

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (0420.1)]/ xenial main restricteddeb http://mirrors.tuna./ubuntu/ xenial main restricteddeb http://mirrors.tuna./ubuntu/ xenial-updates main restricteddeb http://mirrors.tuna./ubuntu/ xenial universedeb http://mirrors.tuna./ubuntu/ xenial-updates universedeb http://mirrors.tuna./ubuntu/ xenial multiversedeb http://mirrors.tuna./ubuntu/ xenial-updates multiversedeb http://mirrors.tuna./ubuntu/ xenial-backports main restricted universe multiversedeb http://mirrors.tuna./ubuntu/ xenial-security main restricteddeb http://mirrors.tuna./ubuntu/ xenial-security universedeb http://mirrors.tuna./ubuntu/ xenial-security multiverse

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (0420.1)]/ xenial main restricteddeb-src /ubuntu xenial main restricted #Added by software-propertiesdeb /ubuntu/ xenial main restricteddeb-src /ubuntu/ xenial main restricted multiverse universe #Added by software-propertiesdeb /ubuntu/ xenial-updates main restricteddeb-src /ubuntu/ xenial-updates main restricted multiverse universe #Added by software-propertiesdeb /ubuntu/ xenial universedeb /ubuntu/ xenial-updates universedeb /ubuntu/ xenial multiversedeb /ubuntu/ xenial-updates multiversedeb /ubuntu/ xenial-backports main restricted universe multiversedeb-src /ubuntu/ xenial-backports main restricted universe multiverse #Added by software-propertiesdeb /ubuntu xenial partnerdeb-src /ubuntu xenial partnerdeb /ubuntu/ xenial-security main restricteddeb-src /ubuntu/ xenial-security main restricted multiverse universe #Added by software-propertiesdeb /ubuntu/ xenial-security universedeb /ubuntu/ xenial-security multiverse

(3)更新源

sudo apt-get update 更新源 sudo apt-get upgrade 更新软件(选择性更新,有可能出现版本不兼容情况)

(二)设置sources.list

sudo sh -c 'echo "deb /ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

(三)设置公钥(Key)

sudo apt-key adv --keyserver 'hkp://:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

导入结果如下:

C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654gpg: 下载密钥‘AB17C654’,从 hkp 服务器 gpg: 密钥 AB17C654:公钥“Open Robotics <info@>”已导入gpg: 合计被处理的数量:1gpg:已导入:1 (RSA: 1)

(四)更新package

sudo apt-get update

(五)安装ROS kinetic完整版

sudo apt-get install ros-kinetic-desktop-full

(六)初始化rosdep

sudo rosdep init

rosdep update

(七)配置ROS环境

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc

source ~/.bashrc

(八)安装依赖项

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

(九)测试是否成功

(1)初始化ROS环境:

roscore

(2)再打开一个新的终端(Termial),输入以下命令,弹出一个小乌龟窗口:

rosrun turtlesim turtlesim_node

(3)再打开一个新的终端(Termial),输入以下命令,使用键盘控制海龟运动:

rosrun turtlesim turtle_teleop_key

若键盘能正常控制海龟,代表安装成功。

(4)打开新的Termial,输入以下命令,可以查看ROS节点信息:

rosrun rqt_graph rqt_graph

如果你能顺利进行到这一步,说明ROS安装成功了。

(十)安装遇见的的错误

第(六)步sudo rosdep init 错误

(1)打开控制文件

sudo gedit /etc/hosts

(2)通过首页,输入查询到最新的真实IP地址:

151.101.84.133

将上述地址写入文件最后一行,保存并退出。

(3)如果提示已经存在,则将存在的文件删除并重复以上操作:

sudo rm /etc/ros/rosdep/sources.list.d/20-default.list

(4)最后结果是可观的,初始化成功代码如下:

wmj@wmj-Inspiron-5580:~$ sudo rosdep initWrote /etc/ros/rosdep/sources.list.d/20-default.listRecommended: please runrosdep updatewmj@wmj-Inspiron-5580:~$ rosdep updatereading in sources list data from /etc/ros/rosdep/sources.list.dERROR: unable to process source [/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:<urlopen error ('_ssl.c:574: The handshake operation timed out',)> (/ros/rosdistro/master/rosdep/osx-homebrew.yaml)ERROR: unable to process source [/ros/rosdistro/master/rosdep/base.yaml]:<urlopen error ('_ssl.c:574: The handshake operation timed out',)> (/ros/rosdistro/master/rosdep/base.yaml)ERROR: unable to process source [/ros/rosdistro/master/rosdep/python.yaml]:<urlopen error ('_ssl.c:574: The handshake operation timed out',)> (/ros/rosdistro/master/rosdep/python.yaml)ERROR: unable to process source [/ros/rosdistro/master/rosdep/ruby.yaml]:<urlopen error timed out> (/ros/rosdistro/master/rosdep/ruby.yaml)ERROR: unable to process source [/ros/rosdistro/master/releases/fuerte.yaml]:Failed to download target platform data for gbpdistro:<urlopen error timed out>Query rosdistro index /ros/rosdistro/master/index-v4.yamlERROR: error loading sources list:<urlopen error <urlopen error timed out> (/ros/rosdistro/master/index-v4.yaml)>wmj@wmj-Inspiron-5580:~$

到这里,经过好多错误的安装提示,我们终于将ros kinetic安装成功了,接下来好好体验ROS吧!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。