Skip to content
Search

ROS2:Basic

lastmod 2026-10-27created 2026-03-099 edits

Notes on the basics of Robot Operating System 2.

Categories

Communication model architecture

  • TOPIC - many-to-many · async · no reply
  • SERVICE - 1-to-1 · sync · request/reply
  • ACTION - 1-to-1 · long-running · goal + feedback + result
  • PARAMETER - per-node KV store · changeable at runtime
  • BAG (rosbag2) - record/replay of topic streams — the source of ML training sets from sensor data

URDF

URDF · robot description — geometry + inertia + joints + collision.

URDF (Unified Robot Description Format) is an XML format that represents a robot as a graph of links (link) + joints (joint). rviz2, Gazebo, MoveIt2, and ros2_control all run on the same description. Xacro is a template language that adds macros, variables, and include to URDF; in practice, Xacro is almost always used.

Cheat sheet

Purpose

Command

List nodes

ros2 node list

Node details

ros2 node info /your_node

Topic list / types / QoS

ros2 topic list -v · ros2 topic info -v /scan

Topic contents

ros2 topic echo /scan

Topic rate/bandwidth/delay

ros2 topic hz /scan · bw · delay

Call a service

ros2 service call /set_mode my_pkg/srv/SetMode "{mode: 'idle'}"

Call an action

ros2 action send_goal /scan my_pkg/action/Scan "{num_samples: 100}"

Parameters

ros2 param list · get · set · dump · load

Show interface definition

ros2 interface show sensor_msgs/msg/PointCloud2

Dump TF tree to PDF

ros2 run tf2_tools view_frames

One-off check of a specific transform

ros2 run tf2_ros tf2_echo base_link tool0

Environment diagnostics

ros2 doctor --report

Package path

ros2 pkg prefix my_pkg

Log level

--ros-args --log-level my_node:=debug

See also

author Zer0 sitemap