Skip to content

ROS 2 — how robot software talks

ROS 2 (Robot Operating System) is the industry-standard way to structure robot software: many small programs that talk over named channels, instead of one giant program. PhysiCar runs ROS 2 Lyrical on Ubuntu 26.04 — the same stack as production robots.

Nodes and topics

  • A node is one program with one job: read the camera, filter the lidar, drive the wheels.
  • A topic is a named stream: a node publishes messages, any number of nodes subscribe. The camera node publishes /camera/image; your node subscribes and reacts.
  • Messages are typed (Float64, LaserScan, Image, ...) — both sides agree on the shape.
ros2 topic list                 # what exists
ros2 topic echo /scan --once    # look at one message
ros2 topic hz /camera/image     # how fast it flows

Services and actions

  • A service is request/response: ask once, get an answer (like a function call between nodes).
  • An action is a long-running goal with feedback and cancel — "navigate to X" reports progress until it arrives.

Rule of thumb: streams → topic, questions → service, missions → action.

Why this design wins

Decoupling: nodes don't know who listens. The same driving node works whether the frames come from the simulator or the real camera — which is precisely how PhysiCar's Sim2Real works. Swap the world, keep the graph.

The exact PhysiCar topic contract → physicar-ros reference · Practice → use the APIs

AI