ROS 2 Eloquent Elusor安装和使用汇总
ROS 2的迭代和更新速度非常快,而ROS 1基本已经发展稳定,目前最新LTS版为Melodic,2020年5月将发布ROS 1终极版Noetic Ninjemys。
ROS 2目前LTS版为Dashing,最新版为Eloquent Elusor。ROS 2支持在Ubuntu上同时部署多种发行版,
Eloquent Elusor简要说明:
除了功能开发以外,还着重于组织和改进ROS2的教程。希望社区与Eloquent Elusor 一起尝试这些教程,并在可能的情况下提供反馈。该反馈有助于团队不断改进文档。
以下是期待在此版本中重点介绍的一些功能和改进:
- 支持基于标记的启动文件(XML / YAML)
- Support for markup-based launch files (XML/YAML)
- 改进的基于发布的测试
- Improved launch-based testing
- 在CLI上传递键值参数
- Passing key-value parameters on CLI
- 支持流记录宏
- Support stream logging macros
- 每节点日志记录 - 节点的所有stdout / stderr输出都记录在〜/ .ros中
- Per-node logging - All stdout/stderr output from nodes are logged in ~/.ros
- ros2doctor
- 改善采购设置文件的性能
- Improved performance of sourcing setup files
- rviz:交互式标记,扭矩环,tf消息过滤器
- rviz: interactive markers, torque ring, tf message filters
- rqt:参数插件,tf树插件,机器人控制插件(也反向移植到Dashing)
- rqt: parameter plugin, tf tree plugin, robot steering plugin (also backported to Dashing)
- turtlesim(也移植到了Dashing)
- turtlesim (also backported to Dashing)
- RMW实施:
- rmw_iceoryx使用的用于零复制借出消息的API
- FastRTPS 1.9.3
- 第2层的新实现:rmw_cyclonedds(也反向移植到了Dashing)
- 环境变量ROS_LOCALHOST_ONLY以限制与本地主机的通信
- MacOS Mojave支持
- RCL和RCLCPP的跟踪仪表
最后,计划于2020年5月发布的下一个ROS 2版本的名称为:
Foxy Fitzroy
如果之前安装过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_bridge,TurtleBot软件包或替代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:melodic
或osrf/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
andarm64
-
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
andarm32
-
OpenEmbedded Thud (2.6) / webOS OSE:
arm32
andx86
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
文章来源: zhangrelay.blog.csdn.net,作者:zhangrelay,版权归原作者所有,如需转载,请联系作者。
原文链接:zhangrelay.blog.csdn.net/article/details/103070027
- 点赞
- 收藏
- 关注作者
评论(0)