Short Summarize of Basic ROS2 Concepts

Node
Each node can SEND & RECEIVE data from other nodes
ros2 node list
can see which node is running
Topic
publisher & subscriber
publisher: sending the data
subscriber: receiving and handle the data
publisher : subscriber = n : n
ros2 topic echo <topic name>
can see the data being published
ros2 topic pub <topic name> <msg type> '<args>'
publish data to a topic directly
Service
client & server
client: request
server: response
server : client = 1 : n
ros2 service call <service name> <service type> <args>
call service direcetly
Action
goal & feedback & result
client & server
client: send the goal
server: return a stream of feedback and result
Topic vs Service vs Action
Feature | Topic | Service | Action |
Communication | one-way (pub/sub) | request–response | request–response with feedback |
Cancellation | No | No | Yes (can be canceled anytime) |
Feedback | No | No (only 1 result) | Yes (gives periodic updates) |
Duration | Continuous | Short / instant | Long-running |
Launch
- allow to run bunch of nodes simultaneously
Subscribe to my newsletter
Read articles from Jane directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Jane
Jane
Hello! I am junior computer engineering student and I am interested in robotics and autonomous system. I started this blog to share what I’m learning along the way from personal projects to coding challenges. Thanks for stopping by!