It is about my ROS2 Humble Distro learning travelling.
Concept
Intermediate Concepts
The communication strategy for different networks within ROS2 is DDS. In DDS, in order to have different logical networks share a physical network is known as the Domain ID. We can regard each program running in ROS2 as a ROS2 node. And those ROS2 nodes which are in the same domain can freely discover and send messages to each other, while ROS2 nodes on different domains cannot.
The default value of Domain ID is 0, while is can also be reset manually. There are 2 versions of domain ID, i.e. short version and long version.
Understanding nodes
The ROS 2 graph is a network of ROS 2 elements processing data together at the same time. It encompasses all executables and the connection between them.
In this graph, every single element/executable can be regarded as a node or multiple nodes, while each node should be responsible for a single, modular purpose. Each node can send and receive data from other nodes via topics, services, actions or parameters.
The command ros run
can launch an executable from a package.
$ ros2 run <package_name> <executable_name>
Use the following command to check nodes that are running.
$ ros2 node list
Remapping allows you to reassign default node properties, like node name, topic name, service name, ect, to custom values. For example, reassign the name of /turtlesim
node:
$ ros2 run turtlesim turtlesim_node --ros-args --remap __node:=my_turtle
# Return more info
$ ros2 node info <node_name>
Understanding Topics
Topics are a vital element of the ROS graph, which act as a but for nodes to exchange message.