🔹 1. Publisher & Subscriber (Pub/Sub model)

image.png

📌 Example:

Message type (.msg) defines what kind of data flows through a topic.

geometry_msgs/msg/Twist   → linear & angular velocity
std_msgs/msg/String       → simple string


🔹 2. Service (Request–Response)

image.png

📌 Example:

Service type (.srv) has two parts:

Request  → input data
Response → output data

Example std_srvs/srv/Empty: