记录一下Ubuntu 18.04安装ROS遇到的问题以及解决方法

基本安装流程

参照官网 中间可能会遇到的问题 1.安装速度较慢,建议使用镜像。

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

2.公钥问题

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

基本上前面的问题就没有什么了

安装重点来了!!!

1.sudo rosdep init 安装问题 website maybe down 的原因还是因为网络原因,这里可以使用热点来进行连接,但到了后面rosdep update这一步还是会有问题。 2.rosdep update一直超时的的原因 raw.githubusercontent.com这个网站容易被墙,这个大家都懂=w= 我安装的时候也是一直卡在这一步用了网上很多种方法都没有成功直到我看到了 他是把rosdep update要用到的文件下载下来保存到本地。然后将bash20-default.list文件进行修改

# os-specific listings first
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:///etc/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
yaml file:///etc/ros/rosdistro-master/rosdep/base.yaml
yaml file:///etc/ros/rosdistro-master/rosdep/python.yaml
yaml file:///etc/ros/rosdistro-master/rosdep/ruby.yaml
gbpdistro file:///etc/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

具体的修改路径按照自己文件路径来设置 然后更改如下文件 1.gbpdistro_support.py 2.rep3.py 3.__init__.py 这三个.py文件中的raw.githubusercontent.com改到刚才下载的文件位置。 最后就是重新

rosdep update

然后就会看到 这就表明成功了 之后对环境进行配置操作

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

然后重新打开一个终端

输入roscore如果出现下图 表明已经安装成功 之后就是打开小王八了

rosrun turtlesim turtlesim_node

至此ros环境搭建完成

参考博文

经验分享 程序员 微信小程序 职场和发展