专栏首页机器人课程与技术ROS 2 Eloquent Elusor安装和使用汇总

ROS 2 Eloquent Elusor安装和使用汇总

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。


ROS 2的迭代和更新速度非常快,而ROS 1基本已经发展稳定,目前最新LTS版为Melodic,2020年5月将发布ROS 1终极版Noetic Ninjemys。

ROS 2目前LTS版为Dashing,最新版为Eloquent Elusor。ROS 2支持在Ubuntu上同时部署多种发行版,


如果之前安装过ROS 2,那么新版eloquent安装非常简洁:

$ sudo apt install ros-eloquent-desktop



Eloquent Elusor is the fifth release of ROS 2. 是ROS 2的第五个版本

Setup Locale


Make sure you have a locale which supports UTF-8. If you are in a minimal environment, such as a docker container, the locale may be something minimal like POSIX. We test with the following settings. It should be fine if you’re using a different UTF-8 supported locale.


sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

Setup Sources


You will need to add the ROS 2 apt repositories to your system. To do so, first authorize our GPG key with apt like this:

需要在系统中添加ROS 2 apt存储库。为此,请首先使用如下所示的apt授权GPG密钥:

sudo apt update && sudo apt install curl gnupg2 lsb-release
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

And then add the repository to your sources list:


sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

Install ROS 2 packages

安装ROS 2软件包

Update your apt repository caches after setting up the repositories.


sudo apt update

Desktop Install (Recommended): ROS, RViz, demos, tutorials.


sudo apt install ros-eloquent-desktop

ROS-Base Install (Bare Bones): Communication libraries, message packages, command line tools. No GUI tools.


sudo apt install ros-eloquent-ros-base

See specific sections below for how to also install the ros1_bridge, TurtleBot packages, or alternative RMW packages.


Try some examples


In one terminal, source the setup file and then run a talker:


. ~/ros2_dashing/install/local_setup.bash
ros2 run demo_nodes_cpp talker

In another terminal source the setup file and then run a listener:


. ~/ros2_dashing/install/local_setup.bash
ros2 run demo_nodes_py listener

You should see the talker saying that it’s Publishing messages and the listener saying I heard those messages. Hooray!

应该看到talker发布it’s Publishing消息同时listener接受并告知I heard这些消息。大功告成!!!

See the demos for other things to try. 请参阅演示以尝试其他案例。

Environment setup


(optional) Install argcomplete


ROS 2 command line tools use argcomplete to autocompletion. So if you want autocompletion, installing argcomplete is necessary.

ROS 2命令行工具使用argcomplete自动完成。因此,如果要自动补全,则必须安装argcomplete。

sudo apt install python3-argcomplete

Sourcing the setup script


Set up your environment by sourcing the following file.


source /opt/ros/eloquent/setup.bash

You may want to add this to your .bashrc.


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

Install additional RMW implementations


By default the RMW implementation FastRTPS is used. If using Ardent OpenSplice is also installed.


To install support for OpenSplice or RTI Connext on Bouncy:

在Bouncy上安装对OpenSplice或RTI Connext的支持:

sudo apt update
sudo apt install ros-eloquent-rmw-opensplice-cpp # for OpenSplice
sudo apt install ros-eloquent-rmw-connext-cpp # for RTI Connext (requires license agreement)

By setting the environment variable RMW_IMPLEMENTATION=rmw_opensplice_cpp you can switch to use OpenSplice instead. For ROS 2 releases Bouncy and newer, RMW_IMPLEMENTATION=rmw_connext_cpp can also be selected to use RTI Connext.

通过设置环境变量,RMW_IMPLEMENTATION=rmw_opensplice_cpp可以切换为使用OpenSplice。对于ROS 2版本,Bouncy和更高版本RMW_IMPLEMENTATION=rmw_connext_cpp也可以选择使用RTI Connext。

If you want to install the Connext DDS-Security plugins please refer to this page. 如果要安装Connext DDS-Security插件,请参阅此页面

University, purchase or evaluation options are also available for RTI Connext. RTI Connext还提供大学,购买或评估选项。

Install additional packages using ROS 1 packages

使用ROS 1软件包

The ros1_bridge as well as the TurtleBot demos are using ROS 1 packages. To be able to install them please start by adding the ROS 1 sources as documented here. 在ros1_bridge还有TurtleBot演示使用ROS 1包。为了能够安装它们,请首先添加ROS 1源,如此处所述

If you’re using Docker for isolation you can start with the image ros:melodic or osrf/ros:melodic-desktop (or Kinetic if using Ardent). This will also avoid the need to setup the ROS sources as they will already be integrated.


Now you can install the remaining packages:


sudo apt update
sudo apt install ros-eloquent-ros1-bridge

The turtlebot2 packages are not currently available in Eloquent. Eloquent目前不支持turtlebot2软件包。

Build your own packages


If you would like to build your own packages, refer to the tutorial "Using Colcon to build packages".




Troubleshooting techniques can be found here. 故障排除技术可以在这里找到。

Supported Platforms


Eloquent Elusor is primarily supported on the following platforms:

支持Eloquent Elusor主要平台如下:

Tier 1 platforms 第一类:

  • Ubuntu 18.04 (Bionic): amd64 and arm64
  • Mac OS X 10.12 (Sierra)
  • Windows 10 (Visual Studio 2019)

Tier 2 platforms 第二类:

  • Ubuntu 18.04 (Bionic): arm32

Tier 3 platforms 第三类:

  • Debian Stretch (9): amd64, arm64 and arm32
  • OpenEmbedded Thud (2.6) / webOS OSE: arm32 and x86

For more information about RMW implementations, compiler / interpreter versions, and system dependency versions see REP 2000. 有关RMW实现,编译器/解释器版本和系统依赖版本的更多信息,请参见REP 2000

New features in this ROS 2 release 新功能

During the development the Eloquent meta ticket on GitHub contains an up-to-date state (最新状态)of the ongoing high level tasks (高级任务)as well as references specific tickets with more details (更多详细信息).

Changes since the Dashing release



The geometry_msgs/msg/Quaternion.msg interface now default initializes to a valid quaternion, with the following values:






Here is the pull request for more detail(更多详细信息): https://github.com/ros2/common_interfaces/pull/74


API Break with get_actual_qos() API中断与get_actual_qos()

Introduced in Dashing, the get_actual_qos() method on the PublisherBase and SubscriptionBase previously returned an rmw type, rmw_qos_profile_t, but that made it awkward to reuse with the creation of other entities. Therefore it was updated to return a rclcpp::QoS instead. 之前使用rmw类型rmw_qos_profile_t,但是在创建其他实体时很难重用,更新为rclcpp::QoS。

Existing code will need to use the rclcpp::QoS::get_rmw_qos_profile() method if the rmw profile is still required. For example:


void my_func(const rmw_qos_profile_t & rmw_qos);

/* Previously: */
// my_func(some_pub->get_actual_qos());
/* Now: */

The rationale for breaking this directly rather than doing a tick-tock is that it is a new function and is expected to be used infrequently by users. Also, since only the return type is changing, adding a new function with a different would be to only way to do a deprecation cycle and get_actual_qos() is the most appropriate name, so we would be forced to pick a less obvious name for the method.

API Break with Publisher and Subscription Classes

In an effort to streamline the construction of Publishers and Subscriptions, the API of the constructors were changed.


It would be impossible to support a deprecation cycle, because the old signature takes an rcl type and the new one takes the NodeBaseInterface type so that it can get additional information it now needs, and there’s no way to get the additional information needed from just the rcl type. The new signature could possibly be backported if that would help contributors, but since the publishers and subscriptions are almost always created using the factory functions or some other higher level API, we do not expect this to be a problem for most users.

Please see the original pr for more detail and comment there if this causes issues (更多详细信息):



API Break Due to Addition of Publisher and Subscription Options 由于添加了发布和订阅选项而导致API中断

The rmw_create_publisher() method had a new argument added of type const rmw_publisher_options_t *. This new structure holds options (beyond the typesupport, topic name, and QoS) for new publishers.

The rmw_create_subscription() method had one argument removed, bool ignore_local_publications, and replaced by the new options of type const rmw_subscription_options_t *. The ignore_local_publications option was moved into the new rmw_subscription_options_t type.

In both cases the new argument, which are pointers, may never be null, and so the rmw implementations should check to make sure the options are not null. Additionally, the options should be copied into the corresponding rmw structure.

See this pull request, and the associated pull requests for more details (更多详细信息):




0 条评论
登录 后参与评论


  • 机器人控制器编程课程-教案02-基础

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

  • 机器人体验营笔记(二)基础

    版权声明:署名,允许他人基于本文进行创作,且必须基于与原先许可协议相同的许可协议分发本文 (Creative Commons)

  • ROS机器人项目开发11例-ROS Robotics Projects(9)虚拟现实VR头戴设备和Leap Motion手势操控


  • 【翻译】在Visual Studio中使用Asp.Net Core MVC创建第一个Web Api应用(二)

    运行应用 In Visual Studio, press CTRL+F5 to launch the app. Visual Studio launches a...

  • NGINX Server Push服务器推送

    Support for HTTP/2 server push is also included in NGINX Plus R15.

  • Spring_总结_03_装配Bean(一)之自动装配


  • POJ-2585-Window Pains

    Window PainsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2915 ...

  • Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2)(A.暴力,B.优先队列,C.dp乱搞)

    A. Carrot Cakes time limit per test:1 second memory limit per test:256 megabytes...

  • Java 延时队列 DelayQueue


  • 【CodeForces 602C】H - Approximating a Constant Range(dijk)

    In Absurdistan, there are n towns (numbered 1 through n) and m bidirectional rai...