ROS安装并运行小乌龟

 

镜像选择:

2. ROS kinetic安装与使用


爲了保證安裝速度,請選擇國內鏡像如下:ustc鏡像

2.1 设置安装源

ROS Kinetic只支持Wily(15.10)Xenial(16.04)对应内核分别为4.2和4.4,其他版本需要编译安装不支持直接deb软件源安装,

使用下面命令:

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

2.2 设置keys

~$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116

Executing: /tmp/tmp.vZcRo5lOC8/gpg.1.sh --keyserver

hkp://ha.pool.sks-keyservers.net:80
--recv-key
0xB01FA116

2.3 安装

~$ sudo apt-get update

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

安装功能包:

~$ sudo apt-get install ros-kinetic-PACKAGE

例如:

~$ sudo apt-get install ros-kinetic-slam-gmapping

查找在kinetic中可以使用的功能包:

~$ apt-cache search ros-kinetic

2.4 初始化


~$ sudo rosdep init

Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

    rosdep update

~$ rosdep update

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index.yaml
Add distro "groovy"
Add distro "hydro"
Add distro "indigo"
Add distro "jade"
Add distro "kinetic"
updated cache in /home/relaybot/.ros/rosdep/sources.cache
 

2.5 环境配置

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

~$ source ~/.bashrc

注意当安装多个ROS发行版,使用kinetic需要用到下面命令:

~$ source /opt/ros/kinetic/setup.bash

2.6 安装rosinstall

~$ sudo apt-get install python-rosinstall

2.7 测试roscore

 

~$ roscore

 

安装ROS成功后,在Beginner Tutorials中有一个简单的示例程序.

  1. 在Terminal中运行以下命令: 
    $ roscore
  2. 新开一个terminal,运行以下命令,打开小乌龟窗口: 
    $ rosrun turtlesim turtlesim_node
  3. 新开一个terminal,运行以下命令,打开乌龟控制窗口,可使用方向键控制乌龟运动: 
    $ rosrun turtlesim turtle_teleop_key
  4. 选中控制窗口,按方向键,可看到小乌龟窗口中乌龟在运动。
  5. 新开一个terminal,运行以下命令,可以看到ROS的图形化界面,展示结点的关系: 
    $ rosrun rqt_graph rqt_graph
  6. 至此,测试完成,说明ROS安装没有问题。
  7.  

个人分类: 软件

相关热词: ubuntu和 在ubuntu ubuntu的 ubuntu时区 ubuntu中

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值