ROS2最新版本发布一晃已经半个多月了,网上现在还没有相关资料,我就来给大家做个搬运工和翻译官吧。
一、前言HumbleHawksbill 是一个长期支持(LTS)版本,将支持到2027年5月。这是 Ubuntu 22.04(Jammy Jellyfish)的第一个 ROS 2版本。这个版本依赖两个操作系统: Ubuntu 22.04 Jammy Jellyfish (arm64和 amd64架构)和 Windows 10。
那么名字有什么意义呢?“谦卑”指的是“以尊敬的精神反思、表达或奉献”,玳瑁是一种遍布世界各地的海龟。玳瑁海龟很容易辨认,是因为它们标志性的喙。我们在社区的帮助下选择了这个名字。
2023年5月的下一个 ROS 2发行版的名称:
Iron,Irwini
二、新特性1.添加了一个新的 CMake 函数,用于生成带有包版本信息的头文件。它将从 package.xml 生成一个包含版本信息的头文件,并将其提供给链接到 my _ lib 库的目标。
project(my_project) add_library(my_lib ...) ament_generate_version_header(my_lib) //引用 #include//头文件安装位置 set(VERSION_HEADER ${CMAKE_INSTALL_PREFIX}/include/my_project/my_project/version.h)
2.群体行为中的范围环境变量
与启动配置类似,现在默认情况下,环境变量的状态作用域为组操作。例如,在下面的启动文件中,执行的进程将回显值1(在 Humble 之前,它将回显值2)。如果希望禁用启动配置和环境变量的范围,可以将范围参数(或属性)设置为 false。
import launch
import launch.actions
def generate_launch_description():
return launch.LaunchDescription([
launch.actions.SetEnvironmentVariable(name='FOO', value='1'),
launch.actions.GroupAction([
launch.actions.SetEnvironmentVariable(name='FOO', value='2'),
]),
launch.actions.ExecuteProcess(cmd=['echo', '$FOO'], output='screen', shell=True),
])
3.添加了一个新的包,laun_ pytest,它可以作为 laun_ test 的替代品。Start _ pytest 是一个简单的 pytest 插件,它提供 pytest fixture 来管理启动服务的生命周期。
Check out the package README for details and examples.
4.允许匹配具有可调用
采用目标操作对象进行匹配的事件处理程序现在也可以采用可调用来进行匹配。
5.计算 Python 表达式时访问数学模块
在 Python 表达式替换(eval)中,我们现在可以使用来自 Python 数学模块的符号。
6.布尔值的替换
新的替换 NotSubstittion、 AndSubstittion 和 OrSubstittion 为执行逻辑操作提供了一种便捷的方法
7.New actions
-
AppendEnvironmentVariable appends a value to an existing environment variable.
-
ResetLaunchConfigurations resets any configuration applied to the launch configuration
-
RosTimer acts like the launch TimerAction, but uses a ROS clock (so it can use simulation time, for example)
-
SetParametersFromFile passes a ROS parameters file to all nodes in a launch file (including node components).
8.将 ROS 参数传递给节点操作
现在可以直接提供特定于 ROS 的节点参数,而无需使用带有前导—— ros-args 标志的 args:
launch: - node: pkg: demo_nodes_cpp exec: talker ros_args: '--log-level debug'
Python 启动文件中 Node 操作的相应参数是 ros _ words:
from launch import LaunchDescription
import launch_ros.actions
def generate_launch_description():
return LaunchDescription([
launch_ros.actions.Node(
package='demo_nodes_cpp',
executable='talker',
ros_arguments=['--log-level', 'debug'],
),
])
9.对可组合节点的前端支持
我们现在可以启动节点容器,并从前端启动文件将组件加载到它们中
launch:
- node_container:
pkg: rclcpp_components
exec: component_container
name: my_container
namespace: ''
composable_node:
- pkg: composition
plugin: composition::Talker
name: talker
- load_composable_node:
target: my_container
composable_node:
- pkg: composition
plugin: composition::Listener
name: listener
10.参数替换
通过使用新参数替换,可以使用 SetParameter 操作替换以前在启动时设置的参数值
11.内容过滤主题
ContentFilteredTopics 支持更复杂的订阅,这表明订阅者不一定希望看到在 Topic 下发布的每个实例的所有值。当基础 RMW 实现支持此特性时,可以使用 Content Filted Topics 请求基于内容的订阅。
| rmw_fastrtps | supported |
| rmw_connextdds | supported |
| rmw_cyclonedds | not supported |
To learn more, see the content_filtering examples.
12.新的参数
ros2 launch has a --launch-prefix argument
这允许将前缀传递给启动文件中的所有可执行文件,这在许多调试情况下都很有用。与此相关的是,添加了—— start-prefix-filter 命令行选项以有选择地将前缀 from —— laun- prefix 添加到可执行文件。
ros2 topic echo has a --flow-style argument
这允许用户强制主题上数据的 YAML 表示形式的流样式。如果没有这个选项,ros2主题 echo/tf _ static 的输出可能类似于:
transforms:
- header:
stamp:
sec: 1651172841
nanosec: 433705575
frame_id: single_rrbot_link3
child_frame_id: single_rrbot_camera_link
transform:
translation:
x: 0.05
y: 0.0
z: 0.9
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
使用这个选项,输出类似于:
transforms: [{header: {stamp: {sec: 1651172841, nanosec: 433705575}, frame_id: single_rrbot_link3}, child_frame_id: single_rrbot_camera_link, transform: {translation: {x: 0.05, y: 0.0, z: 0.9}, rotation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}]
13. rviz2
13.1 将纹理应用于任意三角形列表
我们已经添加了使用 UV 坐标将通过 URI 定义的纹理应用到任意三角形列表的能力。现在我们可以从纹理贴图中创建一个渐变拉取来代替默认的灰度。这将允许标记的复杂着色。为了使用它,您应该使用 vision _ msgs/Marker.msg 并填充题材资源、纹理、 uv _ 坐标和网格文件字段。
You can find more information here.
13.2 质量特性(包括惯性)的可视化
我们还增加了可视化惯性的能力。为此,在机器人模型下的“质量属性”中选择启用“惯性”:
13.3 在 RViz 中可视化 YUV 图像
现在可以在 RViz 中直接可视化 YUV 图像,而不必首先转换为 RGB。
13.4 允许渲染超过100米的物体
默认情况下,RViz 只渲染距离相机100米以内的对象。一个新的配置属性称为“远平面距离”在 rviz 相机插件允许渲染距离配置。



