Ubuntu 18.04 安装ros 记录

系统版本

~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

安装参考:

http://wiki.ros.org/melodic/Installation/Ubuntu

根据官网的步骤,修改一下。

Installation

  • Configure your Ubuntu repositories


Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.

1. Setup your sources.list


Setup your computer to accept software from packages.ros.org.

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

2. Set up your keys  


替换官网的方法

wget http://packages.ros.org/ros.key
sudo apt-key add ros.key
 

3. Installation


  • sudo apt update

There are many different libraries and tools in ROS. We provided four default configurations to get you started. You can also install ROS packages individually.

In case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed

Desktop-Full Install: (Recommended) : ROS, rqtrviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

  • sudo apt install ros-melodic-desktop-full
  • source ~/.bashrc
  • roscore

    运行roscore 没问题,即安装完成。

  • 踩坑一: python 版本


报错,猜测是python 版本问题

        Errors were encountered while processing:
         python3-lib2to3.

发现默认版本是3.7.5

踩坑二:

sudo rosdep init ERROR: cannot download default sources list from:

解决办法: 本文之后,世上再无rosdep更新失败问题!如果有....小鱼就...

用上述内容里的指令代替官网指令。

用 pip install又出错,见下文,设置PIP_NO_CACHE_DIR


设置密钥语句:curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
出现错误:gpg:no valid OpenPGP data found
解决方法:不用官网那个,用下面这个

wget http://packages.ros.org/ros.key
sudo apt-key add ros.key

遇到pip install 安装什么都报错 AttributeError: ‘int‘ object has no attribute ‘endswith‘

1、错误的解决方式,在使用pip2安装命令之前设置:PIP_NO_CACHE_DIR=off,例如我在python2的环境中安装pyquaternion,安装命令就修改为:

PIP_NO_CACHE_DIR=off pip2 install pyquaternion

设置为off,其作用就是安装的时候不禁用pip缓存目录

2、当然你也可以把:PIP_NO_CACHE_DIR=off的值设置为:0 或 no 或 off 或 false

3、在配置文件中设置,就不用每次安装都在开头都加上这句话了

如果是在python3中可以在配置文件(linux环境):

vim ~/.pip/pip.conf

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值