- 配置 Ubuntu 仓库
打开系统设置里的软件更新,配置
Ubuntu 仓库,勾选 “restricted”,”universe” 和 “multiverse” 等选项
- 设置 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)sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8C718D3B5072E1F5
(2)sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 58712A2291FA4AD5
(3)sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
4、安装
- sudo apt-get update
- sudo apt-get install ros-kinetic-desktop-full
- 初始化 rosdep(initialize rosdep)
- sudo rosdep init
此时若出现:
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.
采用以下方法:
- 在终端输入sudo chmod 777 /etc
(2)打开文件,点击左侧的计算机,打开etc文件夹,新建一个文件夹ros,进入ros文件夹内再新建一个文件夹rosdep,进入rosdep内创建一个文档sources.list.d,在文件夹内打开终端输入sudo gedit 20-default.list,出现一个空白文档,在空白文档里输入:
# os-specific listings first
yaml https://raw.github.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://raw.github.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.github.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.github.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.github.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 gedit /etc/hosts,打开一个文档后将以下代码
151.101.84.133 raw.githubusercontent.com 粘贴到里面.点击保存后关闭。在终端输入rosdep update此时初始化配置结束。
- 设置环境
输入 echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
再输入 source ~/.bashrc
- 安装rosinstall
sudo apt-get install python-rosinstall
- 验证是否安装成功
- 另外打开一个终端输入Roscore
- 再打开一个终端输入rosrun turtlesim turtlesim_node 开启一个小乌龟界面
- 再打开一个终端输入rosrun turtlesim turtle_teleop_key可以控制小乌龟的移动