Ubuntu14.04安装 ROS 安装步骤和问题总结

参考:

1.http://wiki.ros.org/indigo/Installation/Ubuntu

 

2.安装出现依赖库问题:

https://answers.ros.org/question/310473/ros-indigo-installation-dependency-issue/

 

 

首先看好自己的版本对应:(本人是Ubuntu14.04 对应的就是ROS Indigo

 

 

step1搜索Software&updates 使用清华的源文件

http://wiki.ros.org/ROS/Installation/UbuntuMirrors#Tsinghua_University

 

 

STEP2

sudo apt-get update && sudo apt-get install dpkg

 

就是一般因为dpkg版本低

需要更新 否则出现依赖库问题:

 

所以这一步相当重要,曾经被卡过得难受的一、塌糊涂

 

可能错误点:

(一定要有此步,如果跳过将会出现依赖库错误,依赖库错误如下:

Reading package lists... Done

Building dependency tree       

Reading state information... Done

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

 python-rosdep : Depends: python-rosdistro (>= 0.4.0) but it is not going to be installed

 ros-indigo-desktop-full : Depends: ros-indigo-desktop but it is not going to be installed

                           Depends: ros-indigo-perception but it is not going to be installed

                           Depends: ros-indigo-simulators but it is not going to be installed

                           Depends: ros-indigo-urdf-tutorial but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

 

 

此时如果按照他的提示使用apt-get -f install 会出现:

 

dpkg-deb: error: archive '/var/cache/apt/archives/python-rosdistro-modules_0.7.0-1_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up

dpkg: error processing archive /var/cache/apt/archives/python-rosdistro-modules_0.7.0-1_all.deb (--unpack):

 subprocess dpkg-deb --control returned error exit status 2

dpkg-deb: error: archive '/var/cache/apt/archives/python-rosdistro_0.7.0-100_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up

dpkg: error processing archive /var/cache/apt/archives/python-rosdistro_0.7.0-100_all.deb (--unpack):

 subprocess dpkg-deb --control returned error exit status 2

Errors were encountered while processing:

 /var/cache/apt/archives/python-rosdistro-modules_0.7.0-1_all.deb

 /var/cache/apt/archives/python-rosdistro_0.7.0-100_all.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

 

 

 

STEP3

设置url

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

 

设置key

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

 

STEP4设置完之后更新一下

sudo apt-get update

 

STEP5安装ROS(注意对应的版本)

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

 

 

STEP6

初始化rosdep

sudo rosdep init

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

ERROR: error loading sources list:

The read operation timed out

网络问题,多尝试几次就ok了。或者换个网络。

 

 

 

STEP7设置环境变量

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

source ~/.bashrc

 

 

 

STEP8安装插件rosinsatll

sudo apt-get install python-rosinstall

 

STEP9测试ROS安装是否成功

1.启动ROS环境:

roscore

 

 

 

 

 

2.测试一下

1)启动一个终端

roscore

启动服务。

(2)再启动一个终端

rosrun turtlesim turtlesim_node __name:=my_turtle

(3)再再启动一个终端,键盘控制turtlesim

rosrun turtlesim turtle_teleop_key

效果如图:

 

 

鼠标必须放在第三个控制小乌龟运动的终端上才行

 

转载于:https://www.cnblogs.com/1228073191Blog/p/10604319.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值