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

在这里插入图片描述

  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
在这里插入图片描述3) 打开新的Termial,输入以下命令,可以在Termial中通过方向键控制小乌龟的移动:

rosrun turtlesim turtle_teleop_key

在这里插入图片描述4) 打开新的Termial,输入以下命令,弹出新的窗口查看ROS节点信息:

rosrun rqt_graph rqt_graph

在这里插入图片描述好了,今天到此为止。mark一下。有问题请联系:3271076312@qq.com
再次感谢:https://blog.csdn.net/softimite_zifeng/article/details/78632211
和:https://blog.csdn.net/super_sean/article/details/105433250
的博主。希望知识得到更多的分享。

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值