栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Ubuntu 18.04 安装ros 记录

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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.

  • 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'

  • Set up your keys  


替换官网的方法

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

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, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

    • sudo apt install ros-melodic-desktop-full

  • 踩坑一: 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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/983265.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号