Ubuntu18.04 melodic 安装与下载ROS

安装软件源

包安装方法主要有两种:软件源安装和源码编译安装。软件源(Repository)为系统提供了一个庞大的应用程序仓库,只要通过简单的命令即可从仓库中找到需要安装的软件并完成下载安装。相反,源码编译安装相对来说比较复杂,需要手动解决软件的依赖关系。

配置系统软件源

Ubuntu系统允许restricted(不完全的自由软件)、universe(Ubuntu官方不提供支持与补丁,全靠社区支持)、multiverse(非自由软件,完全不提供支持和补丁)这三种软件源。 sources.list是Ubuntu系统保存软件源地址的文件,位于/etc/apt/目录下,在这一步中我们需要将 ROS的软件源地址添加到该文件中。

⒈、添加ROS软件源(TX2使用自带源即可,该步可省去)

 
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) 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

   检查cmake的版本,尽量升级到最新版本:https://blog.csdn.net/RNG_uzi_/article/details/107016899  

4、安装ros

这里介绍桌面完整版(推荐): 包含 ROS、rqt、rviz、机器人通用库、2D/3D 模拟器、导航以及 2D/3D 感知包, 其他参考官方网站。 

 
sudo apt install ros-melodic-desktop-full

  

5、初始化 rosdep

 
sudo rosdep init
rosdep update

   sudo rosdep init错误 

 
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

   解决办法1 

 
打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.84.133 raw.githubusercontent.com
#保存后退出再尝试

   解决办法2 

 
sudo c_rehash /etc/ssl/certs
sudo -E rosdep init
rosdep update

   如果还是提示错误,请将源更更换为清华源,然后sudo apt update (请将网络换成手机热点)   rosdep update出错 

 
reading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
<urlopen error _ssl.c:495: The handshake operation timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
ERROR: error loading sources list:
The read operation timed out

   运行:(网络换成手机热点,如果是time out,那就多尝试几次) 

 
sudo apt-get update
sudo apt-get install python-rosdep

  

6、设置环境

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

  

7、安装rosinstall,便利的工具

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

   使用下面命令安装ROS插件(包括3D包围框) 

 
sudo apt install ros-melodic-jsk-rviz-plugins

  

8、检验

打开终端,输入roscore命令,可以看到ROS已经成功在ubuntu上运行起来。

卸载melodic

 
sudo apt-get remove ros-melodic-*
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值