文章目录

  • 1. ubuntu设置为中文界面
  • 2.配置Ubuntu软件仓库
  • 3.设置sources.list
  • 4.设置密钥
  • 5. 安装ros
  • 6. 设置环境
  • 7. 测试ROS安装是否成功
  • 8. 初始化rosdep
    • 8.1 如/etc/ros/rosdep/sources.list.d目录存在
    • 8.2 /etc/ros/rosdep/sources.list.d目录不存在

1. ubuntu设置为中文界面

Ubuntu20.04 英文界面换成中文界面

2.配置Ubuntu软件仓库



3.设置sources.list

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

利用 “sh -c” 命令,它可以让 bash 将一个字串作为完整的命令来执行,这样就可以将 sudo 的影响范围扩展到整条命令,这条命令的意思是把"deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main"双引号中的内容添加到/etc/apt/sources.list.d/ros-latest.list文件中。

4.设置密钥

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

5. 安装ros

安装之前先执行sudo apt update更新软件源,我们这里安装桌面完整版本:

sudo apt install ros-noetic-desktop-full

6. 设置环境

你需要在使用ROS的每个bash终端中source这个脚本。

source /opt/ros/noetic/setup.bash

而下面这些命令可以在每次启动新的shell窗口时很方便地为你自动source一下这个脚本

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

7. 测试ROS安装是否成功

在终端输入:
roscore 启动RosMaster
再新建一个终端,输入:
rosrun turtlesim turtlesim_node
再新建一个终端,输入:
rosrun turtlesim turtle_teleop_key

8. 初始化rosdep

开始使用ROS之前,先初始化rosdep,rosdep能够轻松地安装要编译的源代码的系统依赖关系,rosdep是ROS核心组件运行的基础

rosdep是ros的一个功能包,在安装ros时会自动安装.在使用时需要初始化.ros包有两个不同类型的依赖项:build依赖项和run依赖项。rosdep就是用来检查包的丢失依赖项,并且完成下载和安装。

执行sudo rosdep init,提示sudo: rosdep:找不到命令
需要安装sudo apt-get install python3-rosdep2
然后重新

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.

如果 /etc/ros/rosdep/sources.list.d目录存在,则只需修改/etc/ros/rosdep/sources.list.d目录下的文
件,如果/etc/ros/rosdep/sources.list.d目录不存在,需要手动创建上面所述的目录:
/etc/ros/rosdep/sources.list.d (当然说的是在etc目录下…),自己制作20-default.list文件。

8.1 如/etc/ros/rosdep/sources.list.d目录存在

cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list

在每一个https://raw.githubusercontent.com/前面添加https://ghproxy.com/
修改好的

# 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,前面4个网址访问成功,但最后1个还是访问,错误信息如下:

kandi@ubuntu:/etc/ros/rosdep/sources.list.d$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:Failed to download target platform data for gbpdistro:<urlopen error [Errno 111] Connection refused>
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
ERROR: error loading sources list:<urlopen error <urlopen error [Errno 111] Connection refused> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>

提示无法访问https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml和https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml,此时需要修改index-v4.yaml所在的位置。
需要特别注意:

ros noetic版本基于python3,所以在/usr/lib/python3路径下修改,其他ros版本若基于python2的,需要找到对应的python2 路径进行修改。

修改的方法是在下面这些文件中https://raw.githubusercontent.com前面加上https://ghproxy.com/
(1) 修改

sudo gedit /usr/lib/python3/dist-packages/rosdep2/gbpdistro_support.py

(2) 修改在__init__.py文件中修改index-v4.yaml的位置

sudo gedit /usr/lib/python3/dist-packages/rosdistro/__init__.py


继续rosdep update,但还有出错的信息:

把下面几个文件对应的地方也改了

/usr/lib/python3/dist-packages/rosdep2/sources_list.py/usr/lib/python3/dist-packages/rosdep2/rep3.py
/usr/lib/python3/dist-packages/rosdistro/manifest_provider/github.py此文件两个地方需要修改

继续rosdep update,还是有问题,比如:

ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]

在多执行几次rosdep update就ok了,信息如下:

kandi@ubuntu:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/kandi/.ros/rosdep/sources.cache

8.2 /etc/ros/rosdep/sources.list.d目录不存在

手动创建上面所述的目录: /etc/ros/rosdep/sources.list.d ,自己创建20-default.list文件。
在终端输入

cd /etc
sudo mkdir ros
cd ros
sudo mkdir rosdep
cd rosdep
sudo mkdir sources.list.d
cd sources.list.d
Sudo gedit 20-default.list

在gedit 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

ubuntu20.04安装noetic版本ros相关推荐

  1. Ubuntu20.04安装过程及ROS(noetic)安装过程

    Ubuntu20.04安装过程及ROS_noetic安装过程 前段时间给笔记本加装了一块1T固态硬盘,打算将Ubuntu系统安装到这个盘上,一开始下载了Ubuntu18.04版本,结果后来安装的时候没 ...

  2. ubuntu20.04安装多版本的cuda9.0 cuda10.0

    条件:服务器上已有cuda10.0.g++7.g++9 目的:再安装一个版本cuda9.0(只支持g++6.0以下的):如果你是安装单个版本cuda的,又是不熟悉怎么安装的小白,在处理上会有些不一样, ...

  3. ubuntu20.04双系统安装及ROS安装

    PS:本博客记录博主双系统安装及ROS安装,大家可以选择性参考 一.双系统安装 材料准备: 1.8G以上U盘,且U盘需要清空 2.电脑 步骤一:制作启动盘 (1)ubuntu20.04镜像下载 在网盘 ...

  4. ubuntu20.04安装ROS及常见问题

    ubuntu20.04安装ROS及常见问题 一.ubuntu安装参考(双系统) 1.ios镜像官网下载地址: https://releases.ubuntu.com/?_ga=2.239339907. ...

  5. Ubuntu20.04 安装向日癸远程控制11版本

    Ubuntu20.04 安装向日癸远程控制11版本 向日葵官网下载:https://sunlogin.oray.com/download/ 下载后远程控制出现: 解决方法: 注意一定要选择lightd ...

  6. ubuntu20.04安装PX4固件错误总结

    ubuntu20.04安装PX4固件错误总结 笔者小白一枚,意欲实现PX4"Hello Sky"仿真开发,在进行仿真模拟之前,需要在主机操作系统上安装开发人员工具链(Develop ...

  7. ubuntu20.04安装以及后续配置

    1. Ubuntu安装过程中如何分区 比较复杂的方案: 安装时如果遇到关于boot的错误提示框,使用如下方法解决: win 10 U盘启动安装ubuntu遇到的问题和解决方式 预装win8的电脑上U盘 ...

  8. Ubuntu20.04 ORB-SLAM2(含ROS)配置并在Gazebo下测试-Part1

    前言 Ubuntu20.04系统安装ROS noetic(含Gazebo11).安装ORB-SLAM2,并在此基础上实现基于ROS与Gazebo的ORB-SLAM2测试. Part1:ROS.ORB- ...

  9. Ubuntu20.04安装RMF组件

    安装Galactic版本的rmf组件(traffic-editor等) 系统环境:Ubuntu20.04 参考: ROS2 Galactic Installation CSDN@Ac君 Ubuntu2 ...

最新文章

  1. ECMA_作用域深入This关键字
  2. 解释一下SQLSERVER事务日志记录
  3. 算法-----三数之和等于0
  4. Observer观察者设计模式
  5. linux vlc流媒体服务器,vlc media server rtsp 流媒体服务器搭建成功经验分享
  6. 51nod1743-雪之国度【最小生成树,LCA,并查集】
  7. 论文推荐|Mask TextSpotter:An End-to-End Trainable Neural Network
  8. oracle rac war配置,Oracle RAC安装配置流程
  9. Linux第二周学习笔记(12)
  10. delphi源码分析
  11. idea开发java前端_Web前端开发神器 Intellij IDEA
  12. 加密软件不能安装软件
  13. OpenCC的编译与多语言使用
  14. 如何在win10中迅速打开命令提示符
  15. win7服务器未能登录怎么解决,win7系统出现User Profile Service服务未能登录的解决方法...
  16. 查询,珍爱网ID,百合网ID,世纪佳缘ID,有缘网ID
  17. Python一行代码搞定炫酷可视化,Cufflinks值得拥有 !
  18. Nowcoder java-二维数组中的查找
  19. 【NoteBook】刘润:新零售:低价高效的数据赋能之路
  20. 开启了npm run dev命令以后,如何关闭或者退出

热门文章

  1. 用java解决国王的金币问题_国王赏赐金币问题(减治法)
  2. npm安装不上nodemon_node.js - NPM安装在nodemon@1.18.9后安装脚本处失败 - 堆栈内存溢出...
  3. Java数据结构与算法:栈
  4. proe输入数字时成双出现_Proe/Creo步进电机正反转仿真详解
  5. oracle nodemanage,Linux 下Weblogic集群搭建-04通过nodemanage进行节点的启动与关闭
  6. linux和java_java内存和linux关系
  7. 在ubuntu16.4中安装mysql_【Linux】Ubuntu16.04环境下MySQL的安装与使用
  8. sqlserver2012不是有效的安装文件夹_SQL Server 2012软件安装说明
  9. ajax省市联动案例,AJAX案例四:省市联动(示例代码)
  10. C语言变参函数的实现,C语言的那些小秘密之变参函数的实现