ROS学习——Ubuntu18.04下安装ROS Melodic

前言:

        本篇文章记录了一个ROS小白安装ROS的过程。本博文参考连接在文章最后。

        首先要知道的是不同的Ubuntu版本会对应着不同的ROS发行版,而18.04对应的是Melodic。

一、软件配置要求:

        配置Ubuntu 软件和更新界面,允许"main", “restricted” ,“universe,” and “multiverse”,如图:

        在下载自处,修改服务器配置。我选择的是中科大的源(USTC)

二、安装Melodic

1.配置ROS软件源

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 C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3.更新软件源

sudo apt update

4.安装Melodic

sudo apt install ros-melodic-desktop-full

5.初始化rosdep

sudo rosdep init
rosdep update

若出现问题

git clone https://github.com/ros/rosdistro.git

然后修改文件: (1). /usr/lib/python3/dist-packages/rosdep2/rep3.py

# REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'
REP3_TARGETS_URL = 'https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'

(2). /usr/lib/python3/dist-packages/rosdistro/__init__.py

# DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'

(3). /etc/ros/rosdep/sources.list.d/20-default.list

# os-specific listings first
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://ghproxy.com/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

再执行 rosdep update,成功:

 6. 用户环境设置

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

7. 安装包编译依赖

sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

8. 验证安装

rosversion -d

9. 参考链接:

ROS Melodic安装教程_MAVER1CK的博客-CSDN博客_ros melodic安装

ROS学习——rosdep update 超时解决方法_senlijiu的博客-CSDN博客_rosdep update超时

Ubuntu18.04安装ROS Melodic(详细,亲测安装完成,有清晰的截图步骤)_爱跑步的mango的博客-CSDN博客_ubuntu1804安装ros

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值