在 Ubuntu18.04 中安装 ROS Melodic

Ubuntu 中安装 ROS Melodic

  1. 配置软件源:

Arm ubuntu 18.04国内源:

 

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse

 

# 预发布软件源,不建议启用

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse

 

 

  1. sudo apt-get update

参考T600的源以及域名的修改.docx

修改域名:

sudo gedit /etc/resolv.conf

.

然后再执行sudo apt-get update

  1. 安装ros

3.1安装桌面完整版:

sudo apt install ros-melodic-desktop-full

要查找可用软件包,请运行:

apt search ros-melodic

  1. 安装rosdep

sudo apt install python-rosdep

注意:这是python2 的版本, 若是版本不对应,安装了python3-rodep会卸载掉ros-melodic-desktop-full ,若是想安装pythin3-rosdep,自己在想办法看是否是ros-melodic-desktop-full版本问题。

  1. 初始化 rosdep

在你使用 ROS 之前,需要初始化 rosdep。rosdep 让你能够轻松地安装被想要编译的源代码,或被某些 ROS 核心组件需要的系统依赖。

sudo rosdep init

rosdep update

  1. 设置环境

将 ROS 环境变量自动添加到新 bash 会话会很方便:

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

source ~/.bashrc

如果你只想设置当前 bash 会话的 ROS 环境变量,只需要输入:

source /opt/ros/melodic/setup.bash

  1. 构建工厂依赖

到目前为止,你已经安装了运行核心 ROS 包所需的内容。为了创建和管理自己的 ROS 工作区,有各种各样的工具和需求分别分布。例如:rosinstall 是一个经常使用的命令行工具,它使你能够轻松地从一个命令下载许多 ROS 包的源树。

 

要安装这个工具和其他构建ROS包的依赖项,请运行:

 

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

  1. 测试

输入命令roscore

在安装ROS后启动ROS,输入:roscore 时报错:

 

这个问题是由于该路径下ros文件权限造成的。

输入以下命令修改权限:

sudo chmod 777 -R ~/.ros/

修改完成后再次输入roscore就ok了

 

此时我们再另外打开一个终端,然后执行如下命令

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值