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

ROS 2 Eloquent Elusor安装和使用汇总

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

本文链接:https://blog.csdn.net/ZhangRelay/article/details/103070027

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

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

课程制作以Dashing为主,点击此处文字即可打开。

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

$ sudo apt install ros-eloquent-desktop

然后,依据官网配置就可以使用了。

2019-11-14功能包如下:


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.

确保语言环境支持UTF-8。如果处于最小环境中(例如docker容器),则语言环境可能像POSIX一样最小。使用以下设置进行测试。如果使用的是其他UTF-8支持的语言环境,那应该没问题。

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.

设置存储库后,更新apt存储库缓存。

sudo apt update

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

桌面安装(推荐):ROS、RViz、演示和教程。

sudo apt install ros-eloquent-desktop

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

ROS-Base安装(精简):通信库、消息包、命令行工具。没有GUI工具。

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.

有关如何安装ros1_bridgeTurtleBot软件包替代RMW软件包信息,请参见下面的特定部分。

Try some examples

尝试一些例子

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

在一个终端中,更新配置文件,然后运行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:

在另一个终端源中,更新配置文件,然后运行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

(可选)安装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.

如果需要将此添加到.bashrc,使用如下命令:

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

Install additional RMW implementations

安装其他RMW实现

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

默认情况下,使用RMW实现FastRTPS。如果使用Ardent,还将安装OpenSplice。

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.

如果使用Docker进行隔离,则可以从镜像ros:melodicosrf/ros:melodic-desktop(或Kinetic(如果使用Ardent))开始。这也将避免设置ROS源的需要,因为它们已经被集成。

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".

如果要构建自定义软件包,请参考教程“使用Colcon来构建软件包”

Troubleshooting

故障排除

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

Dashing版本之后的更新

geometry_msgs

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

现在,geometry_msgs/msg/Quaternion.msg接口默认使用以下值初始化为有效的四元数:

x=0

y=0

z=0

w=1

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

rclcpp

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:

如果仍然需要rmw配置文件,则现有代码将需要使用如下方式:

void my_func(const rmw_qos_profile_t & rmw_qos);

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

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.

为了简化发布和订阅的构造,更改了构造函数的API。

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 (更多详细信息):

https://github.com/ros2/rclcpp/pull/867

rmw

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 (更多详细信息):

https://github.com/ros2/rmw/pull/187


本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

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

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

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

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

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

    除了自动驾驶汽车/人工智能外,还有一个火爆的科技热点就是虚拟现实/增强现实设备,这也是本书的第11章。

    zhangrelay
  • 【翻译】在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.

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

    (2)当必须要显示配置的时候,再使用类型安全并且比XML更强大的JavaConfig

    shirayner
  • 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...

    Angel_Kitty
  • Java 延时队列 DelayQueue

    java延迟队列提供了在指定时间才能获取队列元素的功能,队列头元素是最接近过期的元素。没有过期元素的话,使用poll()方法会返回null值,超时判定是通过ge...

    一个会写诗的程序员
  • 【CodeForces 602C】H - Approximating a Constant Range(dijk)

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

    饶文津

扫码关注云+社区

领取腾讯云代金券