ROS-Noetic安装简述

概述

本文主要介绍ROS的安装过程,总结安装过程中的问题点。

安装

软件仓库配置

  • 打开Software & Update
  • 确保勾选restricted,universemultiverse.在这里插入图片描述
  • 关闭后,会提示重新加载。

设置软件源

打开terminal终端,输入下方代码

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

设置密钥

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

如果使用代理服务器,可以使用curl替代apt-key命令,具体内容如下:

curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

成功后返回

gpg: key F42ED6FBABXXXXXX: public key "Open Robotics <info@osrfoundation.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1

ROS安装

安装前,确保Debian包索引到最新

sudo apt-get update

下面就是选择安装多大的ROS包

  • 桌面完整版(官方推荐):包含2D/3D仿真和感知包
sudo apt install ros-noetic-desktop-full
  • 桌面版:基本的ROS功能并包含rqt和rviz等图形化工具
sudo apt install ros-noetic-desktop
  • 基础版:包含基础的ROS包、编译工具和通信库
sudo apt install ros-noetic-ros-base

如果需要安装其他包文件,可以选择相应的包直接安装

sudo apt install ros-noetic-PACKAGE

其中,PACKAGE对应你所要安装的包,详细可参考安装包列表

环境配置

如果需要使用ROS,在每个bash终端中需更新ros的配置脚本,具体命令如下:

source /opt/ros/noetic/setup.bash

也可以设置每次打开终端时,自动更新ROS的配置脚本

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

编译包依赖

  • 安装rosdep

如果未安装rosdep工具,输入下述命令:

$ sudo apt install python-rosdep

如果系统(ubuntu2020)默认只包含python3,相应命令修改如下:

$ sudo apt install python3-rosdep
  • 依赖初始化
$ sudo rosdep init

返回下述结果说明初始化成功

Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

        rosdep update
  • 更新依赖
$ rosdep update

返回下述结果说明更新成功

eading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index 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"
Add distro "dashing"
Add distro "eloquent"
Add distro "foxy"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Add distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/zgh/.ros/rosdep/sources.cache

验证

输入下述命令,验证ROS是否安装成功。

roscore

命令行返回如下结果,就表明ROS已安装成功。

Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://zgh-VirtualBox:36577/
ros_comm version 1.15.7


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.7

NODES

auto-starting new master
process[master]: started with pid [29713]
ROS_MASTER_URI=http://zgh-VirtualBox:11311/

setting /run_id to 70500dfa-cbc5-11ea-8c25-9b0cacf5f716
process[rosout-1]: started with pid [29723]
started core service [/rosout]
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

参考

ROS官网教程

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

henry.zhu51

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值