Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 rosdep init/rosdep update问题

安装ROS-kinetic-desktop-full,Ubuntu16.04安装ROS kinetic

    • Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 rosdep init/rosdep update问题。如:(
    • 之后问题来了,rosdep init/rosdep update报错问题

Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 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.)

正文:
第一步
1.
打开 “Ubuntu 软件” Tab 页,勾选 “restricted”,”universe” 和 “multiverse” 等选项

Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 rosdep init/rosdep update问题_第1张图片

  1. 设置Ubuntu的sources.list

sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’

  1. 设置key

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

如果无法连接上述服务器,可以尝试hkp://pgp.mit.edu:80或者hkp://keyserver.ubuntu.com:80

  1. 更新package

sudo apt-get update

  1. 安装ROS kinetic完整版

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

(注意很慢的哦,请耐心等待。据说电信和联通的wifi热点最快,其次是他俩的宽带。最慢的是移动的wifi和宽带)

参考:https://blog.csdn.net/softimite_zifeng/article/details/78632211
也可参考:https://blog.csdn.net/tq08g2z/article/details/79209435

第二步

  1. 初始化rosdep
    在使用ROS之前必须要初始化rosdep

sudo rosdep init
rosdep update

之后问题来了,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.)

如果朋友们在这里遇到问题了那么解决方案看这里:
这里我强烈推荐这个解决方案:https://blog.csdn.net/super_sean/article/details/105433250 (对init和update都适用)
其次也可以参考:https://blog.csdn.net/JanKin_BY/article/details/105509383

总结下来是这样:
解决方案:

sudo mkdir -p /etc/ros/rosdep/source.list.d

进入这个终端:

cd /etc/ros/rosdep/sources.list.d

输入命令:

sudo gedit 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

之后再尝试 :
sudo rosdep init

  1. 执行rosdep update失败请直接参考文章 https://blog.csdn.net/super_sean/article/details/105433250 中的方法二。这里我再把那个文件传一次吧,防止原文里面的失踪了:http://www.jianyii.top/index.php/s/yK4ogLzkHsjWzs6

第三步:
好了,我们到了第三步,胜利就在眼前。

  1. 配置环境

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

(如果安装了多个 ROS 发行版,则 ~/.bashrc 必须只 source 当前正在使用的那一版的 setup.bash。

如果你只想要修改当前 shell 的环境,则输入如下的命令来替换上面的命令:

source /opt/ros/kinetic/setup.bash
##一般用不到,我也没试过。请略过##)

  1. 安装building package的依赖

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

  1. 测试ROS安装成功
  1. 打开Termial,输入以下命令,初始化ROS环境:

roscore

  1. 打开新的Termial,输入以下命令,弹出一个小乌龟窗口:

rosrun turtlesim turtlesim_node
Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 rosdep init/rosdep update问题_第2张图片3) 打开新的Termial,输入以下命令,可以在Termial中通过方向键控制小乌龟的移动:

rosrun turtlesim turtle_teleop_key

Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 rosdep init/rosdep update问题_第3张图片4) 打开新的Termial,输入以下命令,弹出新的窗口查看ROS节点信息:

rosrun rqt_graph rqt_graph

Ubuntu16.04安装ROS 完整教程,看这个就够了。特别是关于 rosdep init/rosdep update问题_第4张图片好了,今天到此为止。mark一下。有问题请联系:[email protected]
再次感谢:https://blog.csdn.net/softimite_zifeng/article/details/78632211
和:https://blog.csdn.net/super_sean/article/details/105433250
的博主。希望知识得到更多的分享。

你可能感兴趣的:(ros,linux,ubuntu,python)