是时候放下ROS1,开启ROS2的旅程了。It's time to put down ROS1 and start the journey of ROS2.
ROS2官方在线文档链接 ROS2 official online documentation:https://index.ros.org/doc/ros2/
ROS2教程文档使用说明与为什么选择ROS2?ROS2 tutorial documentation instructions and why choose ROS2?https://blog.csdn.net/ZhangRelay/article/details/93601114
ROS2常规学习路径 ROS2 regular learning path:

ROS2进阶学习路径 ROS2 advanced learning path:

学习分享从安装配置开始,首先详细介绍教程,然后是两个专题:Navigation2和MoveIt!2。This article starts with ROS2 installation and configuration, first introduces the tutorial in detail, then two topics: Navigation2 and MoveIt!2.
ROS教程 ROS 2 tutorials:https://github.com/zhangrelay/ros2_tutorials
配置教程包 Tutorial package configuration:
- 下载:git clone
- 编译:colcon build
- 使用:ros2 run

导入编译的环境 Import the compiled environment:
source install/setup.bash
输入ros2 run turtlesim,可以看到如下节点 Enter ros2 run turtlesim, you can see the following nodes:
draw_square --prefix turtle_teleop_key
mimic turtlesim_node
常用命令如下 Common commands are as follows:
- ros2 run turtlesim turtlesim_node
- ros2 topic list
- ros2 run turtlesim draw_square
- ros2 topic echo /turtle1/pose
- ……
更多内容参考下图 For more details, please refer to the following figure:
欢迎大家下载案例调试玩耍, 更多内容后续介绍。You are welcome to download the case, debug and play, more will be introduced in subsequent articles.
思考题 Thinking:
回顾roslaunch, 写一个ros2 launch,同时启动turtlesim_node和draw_spuare。Looking back at roslaunch, write a ros2 launch and start both the turtlesim_node and draw_spuare node.
扩展题 Extended:
对比ROS1和ROS2的turtlesim包,分析和思考两代ROS编程和使用中的差异。Compare the turbulsim package of ROS1 and ROS2, analyze and think about the difference between the two generations of ROS in programming and use.
draw_square.launch.py
from launch import LaunchDescription
import launch_ros.actions
def generate_launch_description():
return LaunchDescription([
launch_ros.actions.Node(
node_namespace= "ros2", package='turtlesim', node_executable='turtlesim_node', output='screen'),
launch_ros.actions.Node(
node_namespace= "ros2", package='turtlesim', node_executable='draw_square', output='screen'),
])
教程 Tutorials
基础 Basic
- 使用colcon构建包 Using colcon to build packages
- 使用Ament Using Ament
- ament_cmake用户文档 ament_cmake User Documentation
- 交叉编译 Cross-Compilation
- 关于ament和catkin(catment)的混合 On the mixing of ament and catkin (catment)
- 使用命令行工具进行自检 Introspection with command line tools
- RQt的概述和使用 Overview and Usage of RQt
- 将RQt插件移植到Windows Porting RQt plugins to Windows
- 通过命令行将ROS参数传递给节点 Passing ROS arguments to nodes via the command-line
- 使用Launch启动/监控多个节点 Launching/monitoring multiple nodes with Launch
- 使用多个ROS 2中间件实现 Working with multiple ROS 2 middleware implementations
- 在单个进程中组合多个节点 Composing multiple nodes in a single process
- msg和srv接口简介 Introduction to msg and srv interfaces
- ROS 2接口的新功能 New features in ROS 2 interfaces
- 定义自定义接口(msg / srv) Defining custom interfaces (msg/srv)
- 操作 Actions
- Eclipse氧气与ROS 2和rviz2 [社区贡献] Eclipse Oxygen with ROS 2 and rviz2 [community-contributed]
- 使用Eclipse Oxygen在Linux上构建ROS2 [社区贡献] Building ROS2 on Linux with Eclipse Oxygen [community-contributed]
- 为ROS 2构建实时Linux [社区贡献] Building Realtime Linux for ROS 2 [community-contributed]
- 发布带有bloom的ROS 2包 Releasing a ROS 2 package with bloom
高级 Advanced
使用docker Using Docker
- 在单个docker容器中运行2个节点[community-contributions] Running 2 nodes in a single docker container [community-contributed]
- 在2个独立的docker容器中运行2个节点[community-contributions] Running 2 nodes in 2 separate docker containers [community-contributed]
案例 Demos
-
使用服务质量设置来处理有损网络。Use quality-of-service settings to handle lossy networks.
-
ROS 1和ROS 2之间的桥接通信。Bridge communication between ROS 1 and ROS 2.
-
使用ROS 1桥接器使用rosbag记录和回放主题数据。Recording and playback of topic data with rosbag using the ROS 1 bridge.
-
使用ROS 2的TurtleBot 3演示。[社区贡献] TurtleBot 3 demo using ROS 2. [community-contributed]
-
编写使用ROS 2 API的实时安全代码。Write real-time safe code that uses the ROS 2 APIs.
-
使用rclpy API在Python中编写ROS 2程序。Use the rclpy API to write ROS 2 programs in Python.
-
使用机器人状态发布者发布联合状态和TF。Use the robot state publisher to publish joint states and TF.
示例 Examples