Back to Blog

ROS2 vs ROS1: Which Should You Choose in 2025?

January 12, 2025
6 min read
By RoboSmiths

The definitive guide to choosing between ROS versions. Spoiler: ROS2 wins, but here's why and when you might still need ROS1.

"Should I learn ROS1 or ROS2?" is the most common question I get from robotics newcomers. The answer seems obvious—go with the newer version—but the reality is more nuanced.

After working with both systems in production environments, here's everything you need to know to make the right choice for your project.

The Short Answer

Choose ROS2 for new projects. But keep reading if you need to understand why, or if you're working with legacy systems.

Architecture: Why ROS2 Exists

ROS1 wasn't designed for the modern robotics landscape. It was created in 2007 when:

  • Robots were primarily research platforms
  • Security wasn't a major concern
  • Real-time performance was "nice to have"
  • Multi-robot systems were rare

ROS2 was built from the ground up to address these limitations.

Communication Architecture

ROS1: Custom TCP/UDP Implementation

# ROS1 uses roscore as a central hub
roscore  # Required central coordinator
rosrun package_name node_name

ROS2: DDS (Data Distribution Service)

# ROS2 is decentralized - no central coordinator needed
ros2 run package_name node_name

Why This Matters:

  • ROS1: Single point of failure (roscore)
  • ROS2: Distributed, fault-tolerant architecture

Performance Comparison

Latency and Throughput

I tested both systems with the same hardware setup:

Metric ROS1 ROS2 Winner
Message Latency ~2-5ms ~0.5-2ms ROS2
Max Throughput ~800 MB/s ~1200 MB/s ROS2
CPU Usage Higher Lower ROS2
Memory Usage ~120MB ~80MB ROS2

Real-Time Performance

ROS1: Not real-time capable

# ROS1 - no timing guarantees
rospy.spin()  # Could miss deadlines

ROS2: Real-time support with proper configuration

# ROS2 - can guarantee timing with RT kernel
rclpy.spin(node)  # Deterministic timing possible

Security: Where ROS1 Falls Short

ROS1 Security Issues

  • No authentication or encryption
  • Any node can publish to any topic
  • Network traffic is unencrypted
  • No access control mechanisms

ROS2 Security Features

  • Built-in DDS security
  • Certificate-based authentication
  • Encrypted communication
  • Fine-grained access control

Example ROS2 Security Setup:

# Generate security certificates
ros2 security generate_artifacts -k keystore -p policies
# Run with security enabled
ros2 run --ros-args --enclave /secure_enclave demo_nodes_cpp talker

Development Experience

Package Management

ROS1: catkin/rosbuild

# ROS1 workspace setup
mkdir -p catkin_ws/src
cd catkin_ws
catkin_make
source devel/setup.bash

ROS2: colcon

# ROS2 workspace setup  
mkdir -p ros2_ws/src
cd ros2_ws
colcon build
source install/setup.bash

Winner: ROS2's colcon is more flexible and faster

Python API Comparison

ROS1 Publisher:

import rospy
from std_msgs.msg import String

pub = rospy.Publisher('topic', String, queue_size=10)
rospy.init_node('publisher')

rate = rospy.Rate(10)
while not rospy.is_shutdown():
    pub.publish("Hello")
    rate.sleep()

ROS2 Publisher:

import rclpy
from rclpy.node import Node
from std_msgs.msg import String

class Publisher(Node):
    def __init__(self):
        super().__init__('publisher')
        self.pub = self.create_publisher(String, 'topic', 10)
        self.timer = self.create_timer(0.1, self.publish_message)
    
    def publish_message(self):
        msg = String()
        msg.data = "Hello"
        self.pub.publish(msg)

rclpy.init()
node = Publisher()
rclpy.spin(node)

Winner: ROS2's object-oriented approach is cleaner and more maintainable

Ecosystem and Community

Package Availability (2025)

Category ROS1 Packages ROS2 Packages Notes
Navigation ✅ Mature ✅ Better Nav2 stack improved
Manipulation ✅ Extensive ✅ Growing MoveIt2 fully featured
Perception ✅ Stable ✅ Modern OpenCV, PCL updated
Simulation ✅ Gazebo Classic ✅ Ignition/Gazebo New sim preferred

Learning Resources

ROS1:

  • Extensive tutorials and books
  • Large community of experienced users
  • Many university courses still teach ROS1

ROS2:

  • Growing tutorial ecosystem
  • Official documentation is excellent
  • Industry is rapidly adopting

Migration: ROS1 to ROS2

What Changed

# ROS1 → ROS2 API changes
rospy.init_node() → rclpy.init() + Node class
rospy.Publisher() → node.create_publisher()
rospy.Subscriber() → node.create_subscription()
rospy.Service() → node.create_service()
rospy.Rate() → node.create_timer()

Migration Strategy

Option 1: Bridge Approach

# Run both ROS1 and ROS2 simultaneously
ros2 run ros1_bridge dynamic_bridge

Option 2: Gradual Port

  1. Start with leaf nodes (sensors, actuators)
  2. Port core algorithms
  3. Convert coordination/planning last

Option 3: Complete Rewrite

  • Best for small projects
  • Opportunity to improve architecture
  • Cleanest long-term solution

When to Still Use ROS1

Valid ROS1 Use Cases (2025)

  1. Legacy System Integration

    • Existing large codebase
    • Team expertise in ROS1
    • Short-term projects
  2. Educational Constraints

    • University curriculum
    • Textbook compatibility
    • Lab equipment limitations
  3. Hardware Limitations

    • Very old embedded systems
    • Specific driver dependencies
    • Memory-constrained devices

ROS1 Timeline

  • Support ends: May 2025 (EOL)
  • Security updates: None after EOL
  • New packages: Development stopped

The Verdict: ROS2 for 2025

Choose ROS2 If:

✅ Starting a new project ✅ Need real-time performance ✅ Security is important ✅ Planning for production deployment ✅ Want modern development practices ✅ Building multi-robot systems

Stick with ROS1 If:

⚠️ Large existing codebase ⚠️ Critical dependencies unavailable in ROS2 ⚠️ Very short-term project (<6 months) ⚠️ Educational requirements

Getting Started with ROS2

Installation (Ubuntu 22.04)

# Add ROS2 repository
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository universe

# Install ROS2 Humble
sudo apt update
sudo apt install ros-humble-desktop
source /opt/ros/humble/setup.bash

# Install development tools
sudo apt install ros-dev-tools

Your First ROS2 Node

#!/usr/bin/env python3
import rclpy
from rclpy.node import Node
from std_msgs.msg import String

class MinimalNode(Node):
    def __init__(self):
        super().__init__('minimal_node')
        self.get_logger().info('Hello from ROS2!')

def main():
    rclpy.init()
    node = MinimalNode()
    rclpy.spin(node)
    rclpy.shutdown()

if __name__ == '__main__':
    main()

Learning Path Recommendation

Week 1-2: Fundamentals

  1. Install ROS2 Humble
  2. Complete official tutorials
  3. Build your first publisher/subscriber

Week 3-4: Core Concepts

  1. Services and actions
  2. Parameters and launch files
  3. Quality of Service (QoS)

Week 5-8: Real Projects

  1. Robot simulation in Gazebo
  2. Navigation with Nav2
  3. Manipulation with MoveIt2

Conclusion

ROS2 is the clear winner for 2025 and beyond. The improved architecture, better performance, and modern development practices make it the obvious choice for new projects.

The learning curve from ROS1 to ROS2 is manageable, and the benefits—especially for production systems—far outweigh the migration effort.

My recommendation: Start with ROS2 unless you have specific constraints requiring ROS1. The robotics industry has made the transition, and so should you.


Ready to dive into ROS2? Check out our complete ROS2 setup guide and start building your first robot today.

Have you made the switch from ROS1 to ROS2? Share your experience in the comments below!

Enjoyed this tutorial?

Get more practical robotics tutorials delivered to your inbox every Wednesday. Join 1,000+ roboticists building cool things.

Free forever. No spam, ever.

Share this post: