ROS melodic版本安装及问题总结

ROS melodic版本安装及问题总结

安装步骤

  1. 添加ROS软件源
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main"> /etc/apt/sources.list.d/ros-latest.list'
  1. 添加密钥
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  1. 安装ROS
apt update
apt install ros-melodic-desktop-full
  1. 初始化rosdep
rosdep init
rosdep update

错误1:

rosdep init找不到命令

解决

sudo apt install python-rosdep2

错误2:

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.

由于https://raw.githubusercontent.com被墙无法访问,我们可以查询它的IP并添加到Host中

打开https://site.ip138.com/ 并查询
在这里插入图片描述
选择一个IP,接下来打开终端,输入

sudo vi /etc/hosts

输入i键进行编辑,插入以下一行内容
在这里插入图片描述
前面的IP为你选的IP,如果还是不行,可以多换几个试试。
按esc,再输 :wq保存退出。
如果还一直显示The read operation timed out,还可以作如下修改

sudo vim /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py

找到DOWNLOAD_TIMEOUT = 15.0,将15.0改得大一点即可。

  1. 设置环境变量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
  1. 安装rosinstall
apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

错误3:

运行至
roscore
命令时,发生错误
Command ‘roscore’ not found,but can be installed with:
sudo apt install python-roslaunch

解决
安装ros-melodic-desktop解决

sudo apt-get install ros-melodic-desktop
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值