After training a first policy in MuJoCo or LeRobot, the obvious next question is whether it is time to learn ROS 2. This article separates what you can finish with simulation-only tooling from the concrete signals that make ROS 2 worth the setup cost, narrows the learning scope to eight concepts with a small rclpy example, and lists the distributions the official docs currently support. By the end you should be able to decide whether to start now, and on which distribution.
What simulation-only tooling covers, and five signals that you need ROS 2
Start with what works without ROS 2. The LeRobot hardware integration guide has you subclass a Robot base class and implement connect(), get_observation() and send_action(), while Feetech and Dynamixel servos are driven directly through FeetechMotorsBus and DynamixelMotorsBus. In other words, collecting SO-101 data and training ACT with LeRobot fits in a single Python process with no ROS 2 at all. MuJoCo likewise runs simulation and evaluation from its Python bindings; how to pick a simulator in the first place is covered in our physics simulator comparison.
ROS 2 earns its place when the assumption “one robot equals one process” breaks. If any of the following five applies, it is time to start.
- The hardware driver ships only as a ROS 2 package. Some industrial arms, lidars and depth cameras are distributed by their vendors as ROS 2 nodes. Without a separate Python SDK, subscribing to those topics is the shortest path to the data.
- Sensors are split across processes or computers. Two cameras, an IMU and joint encoders running at different rates, some on a separate board, call for topics and
ros2 bagrather than a hand-built IPC, logging and replay layer. - Three or more coordinate frames interact. The tf2 concept page frames the questions directly: what is the pose of the object in my gripper relative to my base, and where was the head frame relative to the world five seconds ago? Once you are tracking those transforms by hand, you want tf2, which keeps time-stamped frame relationships available across a distributed system.
- The arm needs collision-aware motion planning. MoveIt 2 describes itself as the robotic manipulation platform for ROS 2. If the learned policy outputs a goal pose and a planner generates the path, that planner lives on ROS 2.
- A mobile base navigates a map. Nav2 is a ROS 2 navigation framework that coordinates planner, controller and recovery servers through behavior trees. Fleet layers above it, such as Open-RMF, are also built on ROS 2.
Simulation-only path versus ROS 2 path
| Aspect | Simulation-only path (MuJoCo, LeRobot Python) | ROS 2 path |
|---|---|---|
| Execution unit | One Python process | Many nodes across processes and machines |
| Hardware connection | LeRobot Robot class, direct motor bus control | Vendor ROS 2 drivers, ros2_control hardware interfaces |
| Sensor synchronization | Sequential reads inside one loop | Topics with timestamps, delivery set by QoS |
| Coordinate transforms | Matrices written in your own code | tf2 tree, lookupTransform |
| Planning and navigation | Policy outputs joint targets directly | MoveIt 2 (arms), Nav2 (mobile bases) |
| Data recording | LeRobotDataset format | ros2 bag (convert when needed) |
| Setup cost | pip or conda environment | Distribution and Ubuntu pinning, colcon builds, environment sourcing |
| Best fit | Policy training and evaluation, a single low-cost arm | Multi-sensor physical robots, reuse of the ROS 2 ecosystem |
A practical rule: if you are rebuilding two or more items from the right-hand column yourself, you are already paying for ROS 2 without getting it.
Eight core concepts and when each one first matters
The ROS 2 documentation is large, but deploying a learned policy on real hardware needs roughly these eight ideas.
| Concept | One-line definition | First needed when |
|---|---|---|
| Node | An executable unit that does one job | You separate the camera driver from policy inference |
| Topic | One-way publish/subscribe message stream | Images and joint states flow continuously |
| Service | A single request/response call | Opening the gripper, starting calibration |
| Action | A long-running task with feedback and cancel | “Move to this pose”, “drive to this waypoint” |
| Parameter | Per-node configuration value | Changing control rate or camera resolution |
| Launch | Starts many nodes and parameters at once | Driver, policy and visualization together |
| tf2 | Time-aware tree of coordinate frames | Converting a camera-frame detection into the base frame |
| QoS | Reliability and retention policy for messages | A sensor topic never reaches your subscriber |
QoS is where most newcomers get stuck first. According to the QoS documentation, the default profile is history keep last with a queue depth of 10, reliable and volatile. The sensor data profile instead uses best effort with a smaller queue, because timely readings matter more than receiving every one. A connection forms only when every policy the subscriber requests is no more stringent than what the publisher offers, so a best effort publisher and a reliable subscriber never connect, while the reverse pairing does. Durability follows the same model: a late-joining subscriber only receives earlier messages when both sides use transient local.
| Publisher reliability | Subscriber reliability | Connects |
|---|---|---|
| best effort | best effort | Yes |
| best effort | reliable | No |
| reliable | best effort | Yes |
| reliable | reliable | Yes |
A minimal rclpy example: a publisher and a sensor-friendly subscriber
The code below is the MinimalPublisher from the official Python publisher/subscriber tutorial with one parameter added. It publishes a std_msgs/String on topic every 0.5 seconds, and the interval can be changed through the period parameter.
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
class MinimalPublisher(Node):
def __init__(self):
super().__init__('minimal_publisher')
self.declare_parameter('period', 0.5) # seconds
period = self.get_parameter('period').value
self.publisher_ = self.create_publisher(String, 'topic', 10) # depth 10
self.timer = self.create_timer(period, self.timer_callback)
self.i = 0
def timer_callback(self):
msg = String()
msg.data = 'Hello World: %d' % self.i
self.publisher_.publish(msg)
self.get_logger().info('Publishing: "%s"' % msg.data)
self.i += 1
def main(args=None):
rclpy.init(args=args)
node = MinimalPublisher()
rclpy.spin(node)
node.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
On the receiving side of a sensor stream, match the sensor profile. qos_profile_sensor_data from rclpy.qos subscribes as best effort, so according to the table above it connects whether the publisher is reliable or best effort.
from rclpy.qos import qos_profile_sensor_data
from sensor_msgs.msg import Image
self.sub = self.create_subscription(
Image, '/camera/image_raw', self.on_image, qos_profile_sensor_data)
The build-and-run sequence follows the tutorial: add rclpy and std_msgs as exec_depend entries in package.xml, and register talker = py_pubsub.publisher_member_function:main under console_scripts in setup.py.
cd ~/ros2_ws/src
ros2 pkg create --build-type ament_python --license Apache-2.0 py_pubsub
# write py_pubsub/py_pubsub/publisher_member_function.py, edit package.xml and setup.py
cd ~/ros2_ws
rosdep install -i --from-path src --rosdistro jazzy -y
colcon build --packages-select py_pubsub
source install/setup.bash
ros2 run py_pubsub talker --ros-args -p period:=0.1
# in another terminal: inspect publisher and subscriber QoS
ros2 topic info -v /topic
ros2 topic info -v prints the reliability and durability of every publisher and subscriber on a topic, which makes it the first command to run when “messages are not arriving”.
Choosing a distribution: the official support list as of October 31, 2026
The ROS 2 distributions page marks the following as currently supported. Tier 1 Ubuntu releases come from each distribution’s supported-platforms section.
| Distribution | Released | End of life | Tier 1 Ubuntu | Notes |
|---|---|---|---|---|
| Lyrical Luth | 2026-05-22 | May 2031 | 26.04 (Resolute) | Stated as LTS; 24.04 (Noble) is Tier 3 |
| Kilted Kaiju | 2025-05-23 | December 2026 | 24.04 (Noble) | Non-LTS, ending soon |
| Jazzy Jalisco | 2024-05-23 | May 2029 | 24.04 (Noble) | |
| Humble Hawksbill | 2022-05-23 | May 2027 | 22.04 (Jammy) | |
| Rolling Ridley | Continuous | — | — | Development; can receive breaking in-place updates |
The Lyrical supported-platforms page lists Ubuntu 26.04 on amd64 and arm64 as Tier 1 and Ubuntu 24.04 as Tier 3, which means building from source. The distributions page also states that nodes on different distributions are not guaranteed to communicate, so the robot computer and the development machine should run the same one.
In practice the tools you plan to use decide the distribution more than ROS 2 itself. Here is what each tool’s documentation showed on October 31, 2026.
| Tool | Distributions listed in its docs |
|---|---|
| Isaac Sim 6.2.0 ROS 2 bridge | Humble and Jazzy tested; Ubuntu 24.04 with Jazzy recommended |
| ros2_control | Stable: Kilted, Jazzy, Humble / in development: Rolling, Lyrical |
| Nav2 | Active support: Lyrical, Jazzy; maintained: Kilted, Humble |
| mujoco_ros2_control | Humble, Jazzy, Kilted, Lyrical |
Only Jazzy and Humble appear in all four, and Humble ends in May 2027. That makes Ubuntu 24.04 with Jazzy the broadest-compatible starting point right now. Lyrical has the longest support window, but the sensible order is to confirm that each tool you depend on lists it as stable before moving.
Where LeRobot, MuJoCo and Isaac Sim meet ROS 2
Each of the three tools connects to ROS 2 differently.
- Isaac Sim: enabling the
isaacsim.ros2.bridgeextension lets the simulator publish and subscribe to ROS 2 topics directly. The installation page says the simulator includes ROS libraries for the default interfaces and falls back to its bundled Humble or Jazzy libraries when no ROS environment is sourced. Custom message types must be built separately for the simulator’s Python 3.12 runtime. - MuJoCo: MuJoCo itself has no ROS 2 dependency. mujoco_ros2_control wraps it as a
ros2_controlsystem interface, so the controller configuration you would use on hardware can run against the simulator. It also ships sensor, RGB-D camera and lidar plugins and can generate MuJoCo models from URDF; the demo starts withros2 launch mujoco_ros2_control_demos demo.launch.py. - LeRobot: the official docs do not treat ROS 2 as a built-in path. Instead they define a plugin convention in which a separate Python package prefixed
lerobot_robot_registers your robot. Running a LeRobot policy on a ROS 2 robot therefore means writing aRobotimplementation whoseget_observation()fills values from subscribed ROS 2 topics and whosesend_action()publishes to a command topic. This is a design derived from the documented interface contract, not an officially provided bridge.
In that layout the policy inference loop becomes a single ROS 2 node while the camera and joint drivers stay as existing ROS 2 nodes. The separate problem of the gap between simulated and physical behavior is covered in our sim-to-real gap article.
A learning order that keeps ROS 2 from stalling policy work
To keep ROS 2 from eating into policy development time, this order works well.
- Pin the distribution first. Use the tool table above to settle on Jazzy (or Lyrical once your tools confirm it) and the matching Ubuntu release, and put the development and robot machines on the same combination.
- Look at topics from the CLI before writing code. Launch the vendor driver and inspect message types and QoS with
ros2 topic list,ros2 topic echoandros2 topic info -v. Most integration problems surface here. - Wrap the policy in one rclpy node. Put inference into the structure of the example above: subscribe to observation topics and publish to a command topic.
- Bundle everything in a launch file. Start driver, policy and visualization nodes from one launch file and move parameters into a file.
- Add tf2, then MoveIt 2, Nav2 or ros2_control only when needed. Bring in only the pieces that match the five signals.
Before any of this, aligning simulator and Python versions matters; our MuJoCo and LeRobot install version guide helps you spot where those versions might collide with the Python version your ROS 2 distribution expects.