Introduction

The Robot Operating System 2 (ROS 2) has transformed how roboticists build, test, and deploy autonomous systems. Unlike its predecessor ROS 1, which was designed for academic research, ROS 2 is built for production — with real-time support, multi-robot coordination, and robust security. At its core, ROS 2 is a distributed middleware framework that lets you run robotic software components (nodes) across multiple machines — making it inherently suited for self-hosted deployment.

In this article, we compare the three foundational frameworks of the ROS 2 ecosystem: ROS 2 Core (the middleware and build system), Navigation2 (autonomous navigation stack), and MoveIt2 (motion planning and manipulation). Together, these three projects power everything from warehouse AMRs to robotic arms on factory floors — all running on self-hosted Linux servers.

Quick Comparison

FeatureROS 2 CoreNavigation2MoveIt2
Stars5,5874,3111,841
PurposeMiddleware frameworkAutonomous navigationMotion planning
Primary LanguageC++ / PythonC++C++
Real-Time SupportYes (RT kernel)YesYes
DDS MiddlewareFast RTPS / CycloneInherits from ROS 2Inherits from ROS 2
SimulationGazebo / IgnitionGazebo + nav2Gazebo + MoveIt
Docker SupportOfficial imagesOfficial imagesCommunity images
Multi-RobotYes (native)Yes (namespaced)Limited

ROS 2 Core: The Distributed Middleware

ROS 2 Core provides the communication layer that makes self-hosted robotics possible. It uses the Data Distribution Service (DDS) protocol for pub/sub messaging between nodes, with built-in discovery, quality of service (QoS) policies, and security.

Key Architecture Features

  • Decentralized discovery: No master node — nodes find each other automatically via DDS
  • QoS profiles: Reliable, best-effort, and sensor data delivery modes
  • Lifecycle nodes: Managed node states for production deployment
  • Security: DDS-Security for authentication, encryption, and access control

Docker Compose for Self-Hosted ROS 2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
version: "3.8"
services:
  ros2-base:
    image: osrf/ros:humble-desktop
    container_name: ros2-core
    network_mode: host
    environment:
      - DISPLAY=$DISPLAY
      - ROS_DOMAIN_ID=42
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - ./ros2_ws:/root/ros2_ws
    command: >
      bash -c "source /opt/ros/humble/setup.bash &&
               ros2 run demo_nodes_cpp talker"
    restart: unless-stopped

  ros2-listener:
    image: osrf/ros:humble-desktop
    container_name: ros2-listener
    network_mode: host
    environment:
      - ROS_DOMAIN_ID=42
    command: >
      bash -c "source /opt/ros/humble/setup.bash &&
               ros2 run demo_nodes_cpp listener"
    restart: unless-stopped

With this setup, the talker and listener containers automatically discover each other via DDS and begin exchanging messages — no central server required.

Navigation2 (Nav2) is the successor to the ROS 1 Navigation Stack, rewritten from the ground up for ROS 2. It provides everything needed for autonomous mobile robot navigation: mapping, localization, path planning, and obstacle avoidance — all running as a self-hosted service.

Nav2 uses a behavior tree-based architecture that makes it highly modular and configurable:

1
2
3
Map Server → [Global Costmap] → Global Planner → [Local Costmap] → Local Planner → Controller
                          ↑                                                    ↓
                     AMCL Localization ←←←←←←←←←←←←←←←←←←←←←←← [Sensor Data: LIDAR, IMU, Odometry]

Deploying Nav2 for Fleet Management

For warehouse and factory deployments, Nav2 can run on a central server managing multiple robots:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
version: "3.8"
services:
  nav2-master:
    image: osrf/ros:humble-desktop
    container_name: nav2-server
    network_mode: host
    environment:
      - ROS_DOMAIN_ID=42
    volumes:
      - ./maps:/maps
      - ./nav2_params.yaml:/params.yaml
    command: >
      bash -c "source /opt/ros/humble/setup.bash &&
               ros2 launch nav2_bringup bringup_launch.py
               params_file:=/params.yaml map:=/maps/warehouse.yaml"
    restart: unless-stopped

Each physical robot runs a lightweight Nav2 client that communicates with the centralized server for path planning and coordination.

MoveIt2: Robotic Manipulation

MoveIt2 is the industry-standard framework for motion planning, manipulation, and grasping with robotic arms. It handles inverse kinematics, collision checking, trajectory planning, and execution — essential for pick-and-place, assembly, and inspection tasks.

Core Capabilities

  • Motion Planning: Integration with OMPL, Pilz, and STOMP planners
  • Collision Checking: FCL-based collision detection with continuous validation
  • Kinematics: Built-in IKFast, KDL, and TRAC-IK solvers
  • Grasping: Generate grasp poses with the MoveIt Grasps library
  • Scene Management: Real-time collision object updates from sensor data

Self-Hosted MoveIt2 Server

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
version: "3.8"
services:
  moveit-server:
    image: osrf/ros:humble-desktop
    container_name: moveit2-server
    network_mode: host
    environment:
      - ROS_DOMAIN_ID=42
      - DISPLAY=$DISPLAY
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - ./robot_config:/config
    command: >
      bash -c "source /opt/ros/humble/setup.bash &&
               ros2 launch moveit2_tutorials demo.launch.py"
    restart: unless-stopped

For production deployments, you can run MoveIt2 headlessly (without GUI) for motion planning as a service, with lightweight clients on each robot arm requesting trajectories over the ROS 2 network.

Why Self-Host Your Robotics Stack?

Running ROS 2 on your own servers means you own the entire autonomy pipeline. Cloud robotics platforms charge per-hour for simulation and planning — at scale, self-hosting on a GPU-equipped Linux server pays for itself within months. A single workstation with an RTX 4090 can run Nav2 path planning for a fleet of 20+ robots simultaneously.

Data privacy is equally important. Your robot’s sensor data, maps, and motion plans contain sensitive operational intelligence. Self-hosting keeps this data within your facility’s network, protected by DDS-Security encryption and access control. For defense, healthcare, and manufacturing applications where IP protection is critical, cloud robotics platforms are a non-starter.

The ROS 2 ecosystem also gives you vendor independence. You’re not locked into any single hardware platform or sensor manufacturer — the framework abstracts hardware drivers behind standardized interfaces. If you’re building industrial automation systems, check out our SCADA systems guide and IoT device management comparison for complementary infrastructure.

For organizations deploying autonomous mobile robots at scale, the combination of ROS 2 Core for messaging, Nav2 for fleet navigation, and MoveIt2 for manipulation creates a complete self-hosted autonomy platform that rivals commercial solutions at a fraction of the cost.

For organizations deploying autonomous mobile robots at scale, the combination of ROS 2 Core for messaging, Nav2 for fleet navigation, and MoveIt2 for manipulation creates a complete self-hosted autonomy platform that rivals commercial solutions at a fraction of the cost. A typical warehouse deployment with 15 autonomous forklifts can save $50,000-$200,000 annually in commercial robotics platform licensing fees by running ROS 2 on a cluster of three Linux servers.

ROS 2’s security model is particularly valuable for self-hosted deployments. DDS-Security provides per-topic access control, encrypted transport, and participant authentication using x.509 certificates or shared secrets. This lets you restrict which robots can access navigation commands, which operators can view sensor data, and which services can modify the world model — all without a cloud dependency. For defense contractors and medical robotics companies where data sovereignty is non-negotiable, this self-hosted security architecture is a fundamental requirement.

The ecosystem around ROS 2 has matured significantly. The Gazebo simulator, now at version Fortress/Ionic, provides high-fidelity physics simulation that lets you test Navigation2 paths and MoveIt2 trajectories before deploying to physical hardware. This simulation capability runs entirely on self-hosted GPU servers — no cloud simulation credits required.

FAQ

What’s the difference between ROS 1 and ROS 2?

ROS 2 is a complete redesign of ROS 1, not an incremental upgrade. Key differences: (1) Decentralized architecture — no ROS Master, nodes discover each other via DDS; (2) Real-time support — ROS 2 can run on RT Linux for deterministic behavior; (3) Multi-platform — native support for Windows, macOS, and embedded Linux; (4) Security — built-in DDS-Security for authentication and encryption; (5) QoS policies — configurable reliability, durability, and deadline settings per topic. ROS 1 reached end-of-life in May 2025 — all new projects should use ROS 2.

Which DDS implementation should I choose for ROS 2?

ROS 2 supports multiple DDS vendors. Cyclone DDS (Eclipse) is the default in recent ROS 2 releases and offers the best open-source performance with zero-configuration networking. Fast DDS (eProsima) provides richer QoS features and is preferred for real-time applications. RTI Connext is the commercial option with the most mature tooling and support. For most self-hosted deployments, Cyclone DDS works out of the box with minimal tuning.

Can I run ROS 2 nodes across different machines?

Yes — that’s the core design principle. ROS 2’s DDS middleware handles cross-machine discovery automatically. As long as all machines are on the same network subnet (or have multicast routing configured) and share the same ROS_DOMAIN_ID, nodes will discover each other. This makes ROS 2 ideal for self-hosted distributed systems where sensor processing runs on edge devices, planning runs on a central server, and visualization runs on operator workstations.

How do I choose between Navigation2’s different planners?

Nav2 supports multiple global planners: NavFn (classic Dijkstra/A*), Smac Planner (Hybrid-A* with improved performance), and Theta Star (any-angle path finding). For local planning, the Regulated Pure Pursuit controller is generally recommended over the older DWB controller — it provides smoother trajectories with fewer tuning parameters. The Smac Planner + Regulated Pure Pursuit combination is the current best-practice default for most indoor mobile robot applications.

Is ROS 2 suitable for non-robotics distributed computing?

Absolutely. ROS 2’s DDS middleware provides reliable pub/sub messaging with QoS guarantees that work well for any distributed system — not just robotics. Projects in industrial IoT, autonomous vehicle telemetry, and even financial trading systems have adopted ROS 2 for its robust discovery mechanism and configurable reliability. For simpler IoT use cases, check our MQTT broker comparison — but when you need QoS guarantees and real-time performance, ROS 2 is the superior choice.


💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com