Short Summarize of Basic ROS2 Concepts

JaneJane
1 min read

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

FeatureTopicServiceAction
Communicationone-way (pub/sub)request–responserequest–response with feedback
CancellationNoNoYes (can be canceled anytime)
FeedbackNoNo (only 1 result)Yes (gives periodic updates)
DurationContinuousShort / instantLong-running

Launch

  • allow to run bunch of nodes simultaneously
0
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!