Untitled

Publisher publishes to topic.

No one knows who subscribes.

Topic is independent.

Even if there is no subscriber, it is still okay.

Untitled

A node can contain multiple publishers and subscribers.

echo the topic

ros2 topic echo {name of topic}

publish a topic in terminal

ros2 topic pub -r 10 /robot_news example_interfaces/msg/String "{data: 'hellop from terminal'}"

10 is the frequency.

rename (remap) the topic

// publishing
ros2 run my_py_pkg  robot_news_station  --ros-args -r __node:=my_station -r robot_news:=my_news

// subscribing
ros2 run my_py_pkg  smartphone --ros-args -r robot_news:=my_news

So, we can use same nodes for multiple purposes !