1 Node
1.1 Running
ros2 run <package_name> <executable_name>
1.2 View
ros2 node list
ros2 node info <node_name>
1.3 Remapping
ros2 run turtlesim turtlesim_node --ros-args --remap __node:=my_turtle
2 Topic
2.1 Introduction
2.1.1 Communication Model
Topic is divided into Publisher and Subscriber, many-to-many model
2.1.2 Message Type
The message type is: .msg file
Applicable scenarios: based on asynchronous streaming data
2.2 Commands
2.2.1 View graphical nodes
rqt_graph
2.2.2 View all topics
ros2 topic list
2.2.3 View the topic being published
ros2 topic echo <topic_name>
2.2.4 View the specific information of the topic
ros2 topic info <topic_name>
2.2.5 Publishing data using topic
ros2 topic pub <topic_name> <msg_type> '<args>'
2.2.6 View the frequency of topic publishing data
ros2 topic hz <topic_name>
3 Service
3.1 Introduction
3.1.1 Communication Model
Service is divided into Server and Client, one-to-one model
3.1.2 Message Type
File Type: .srv file
Applicable scenario: based on synchronous RPC style communication
3.2 Commands
3.2.1 View service
ros2 service list
ros2 service list -t
3.2.2 Judgment Type
ros2 service type <service_name>
3.2.3 Find
ros2 service find <type_name>
3.2.4 Display
ros2 interface show <type_name>
3.2.5 Callback
ros2 service call <service_name> <service_type> <arguments>
4 Parameters
4.1 Introduction
4.1.1
4.1.2 Data Format
4.2 Commands
4.2.1 Addition
1.Add parameters at startupros2 run <package_name> <executable_name> --ros-args --params-file <file_name>
2.Add parameters from fileros2 param load <node_name> <parameter_file>
4.2.2 Delete
4.2.3 Change
1.Set the parameters of the noderos2 param set <node_name> <parameter_name> <value>
2.Dump the parameters to the file,node_name.yamlros2 param dump <node_name>
4.2.4 Check
ros2 param list
ros2 param get <node_name> <parameter_name>
5 Actions
5.1 Introduction
5.1.1 Main use
for data storage
5.1.2 File format
.action ends
5.1.3 Content Format
# Request
---
# Result
---
# Feedback
5.1.4 Related instructions
Request message: from action client -> action server
Result message:action server -> action client
Feedback message: Periodically, action server -> action client
5.2 Commands
- Check
ros2 action list
ros2 action list -t
ros2 action info /turtle1/rotate_absolute
ros2 interface show turtlesim/action/RotateAbsolute
ros2 action send_goal <action_name> <action_type> <values>
6 Check**
6.1 System Check
ros2 doctor
6.2 Obtain inspection report
ros2 doctor --report