笔者在Ubuntu16.04 及 Ubuntu18.04 下均成功安装ROS,二者的debug思路和步骤一致。以下debug指令及步骤笔者均亲自试验过,请放心使用,一定能安装成功!
物质准备和知识储备:
Ubuntu 16.04/18.04 :最好买一个笔记本专运行linux软件。学生党们可以用双系统安装,不过千万不要浪费时间安装虚拟机运行ROS,除非真的仅仅想随便玩玩,真的绝对卡!
知识:看得懂linux基本常见命令。例如:cd sudo apt-get 等
安装ROS:
总体按着
Ubuntu16.04 ROS官网安装Kenetic教程
Ubuntu18.04 ROS官网安装Melodic教程
进行,除了在1.2步:设置软件源应当从Mirror里用推荐的软件源:
在此推荐USTC的软件源
其他的跟随教程。如果安装顺利,一路没有error,在终端输入 roscore 后会显示详细资料,或是调试后能够显示乌龟,说明安装成功。
没有成功?OK .
rosdep init 找不到命令。请输入:
sudo apt-get install python-rosdep
再sudo rosdep init
website down ,解决方案:
首先修改系统host文件中的ip地址:
sudo gedit /etc/hosts
,在文件最上面添加一下语句:151.101.84.133 raw.githubusercontent.com
,保存退出,再sudo rosdep init
机理:执行sudo rosdep init会在/etc/ros/rosdep/sources.list.d产生一个名为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
因此假如在上述步骤sudo rosdep init
仍旧失败,则把/etc/ros/rosdep/sources.list.d
的20-default.list
内容清空,复制粘贴上面的黑色框内容,保存。完成。sudo rosdep update
。
sudo rosdep update 报错
执行rosdep update会在/home/xxx/.ros/rosdep/sources.cache(xxx是你的用户名)产生一个文件夹,里面有一堆缓存文件