Bird
Raised Fist0
ROSframework~15 mins

ROS 1 vs ROS 2 overview - Trade-offs & Expert Analysis

Choose your learning style10 modes available
Overview - ROS 1 vs ROS 2 overview
What is it?
ROS 1 and ROS 2 are versions of the Robot Operating System, a set of software tools and libraries that help robots understand their environment and perform tasks. ROS 1 is the original version, widely used for many years, while ROS 2 is a newer version designed to improve on ROS 1's limitations. Both provide ways for different parts of a robot to communicate and work together smoothly.
Why it matters
Robots need reliable and flexible software to work well in real life. ROS 1 helped many robots get started but had limits in safety, real-time control, and modern hardware support. ROS 2 was created to solve these problems, making robots safer, faster, and easier to build for new uses. Without ROS 2, robots might struggle with complex tasks or fail in critical situations.
Where it fits
Before learning about ROS 1 vs ROS 2, you should understand basic robotics concepts and how software controls hardware. After this, you can explore how to build robot applications using ROS 2, which is the future standard. This topic connects foundational robotics software knowledge to advanced robot system design.
Mental Model
Core Idea
ROS 2 is the modern, improved version of ROS 1 designed to support real-time, safety, and new hardware needs while keeping the core idea of robot software communication.
Think of it like...
Think of ROS 1 as an older model car that runs well but struggles with new roads and safety features, while ROS 2 is the newer model designed to handle highways, traffic rules, and advanced safety systems.
┌─────────────┐       ┌─────────────┐
│   ROS 1    │──────▶│   Limitations│
│ (Original) │       │ - No real-time│
└─────────────┘       │ - Limited safety│
                      │ - Old middleware│
                      └─────────────┘
                             │
                             ▼
                      ┌─────────────┐
                      │   ROS 2     │
                      │ (Improved)  │
                      │ - Real-time │
                      │ - Safety    │
                      │ - DDS-based │
                      └─────────────┘
Build-Up - 6 Steps
1
FoundationWhat is ROS and its purpose
🤔
Concept: Introduce ROS as a software framework that helps robots communicate and perform tasks.
ROS stands for Robot Operating System. It is not an operating system like Windows but a set of tools and libraries that help different parts of a robot talk to each other. It allows sensors, motors, and software to work together smoothly.
Result
Learners understand the basic role of ROS in robotics as a communication and coordination tool.
Understanding ROS as a communication framework sets the stage for why different versions matter.
2
FoundationBasics of ROS 1 architecture
🤔
Concept: Explain the core components of ROS 1 like nodes, topics, and messages.
In ROS 1, robots are made of nodes, which are small programs that do specific jobs. Nodes talk by sending messages over topics. For example, a camera node sends images, and a processing node receives them. This system helps robots work in parts but act as one.
Result
Learners see how ROS 1 organizes robot software into communicating parts.
Knowing ROS 1's architecture helps compare what changes in ROS 2.
3
IntermediateLimitations of ROS 1 in modern robotics
🤔Before reading on: do you think ROS 1 supports real-time control and safety features well? Commit to yes or no.
Concept: Identify the challenges ROS 1 faces with real-time control, safety, and new hardware.
ROS 1 was designed when robots were simpler. It lacks built-in real-time control, meaning it can't guarantee actions happen exactly when needed. It also has limited safety features and uses older communication methods that don't work well with new hardware or networks.
Result
Learners recognize why ROS 1 can struggle in advanced or safety-critical robot applications.
Understanding ROS 1's limits explains why a new version was necessary.
4
IntermediateCore improvements introduced in ROS 2
🤔Before reading on: do you think ROS 2 keeps the same communication style as ROS 1 or changes it? Commit to your answer.
Concept: Explain how ROS 2 uses new middleware and adds real-time and safety support.
ROS 2 uses DDS (Data Distribution Service) middleware, which is a modern way for software to talk reliably and quickly. It supports real-time control, better security, and works on more types of hardware and operating systems. ROS 2 keeps the idea of nodes and messages but improves how they connect.
Result
Learners see how ROS 2 solves ROS 1's problems with new technology and design.
Knowing ROS 2's core changes helps learners understand its advantages and migration challenges.
5
AdvancedMigration challenges from ROS 1 to ROS 2
🤔Before reading on: do you think migrating from ROS 1 to ROS 2 is simple or requires significant changes? Commit to your answer.
Concept: Discuss the practical difficulties in moving existing ROS 1 projects to ROS 2.
ROS 2 is not fully backward compatible with ROS 1. Some tools and packages need rewriting or adaptation. The communication middleware is different, so nodes may need changes. Also, ROS 2 supports more platforms, which can complicate testing. Migration requires planning and learning new APIs.
Result
Learners understand that upgrading to ROS 2 is a meaningful effort, not just a version bump.
Knowing migration challenges prepares learners for real-world project decisions.
6
ExpertROS 2 internal design for real-time and safety
🤔Before reading on: do you think ROS 2 achieves real-time by changing only middleware or also node design? Commit to your answer.
Concept: Explore how ROS 2's design supports real-time and safety beyond middleware choice.
ROS 2 uses DDS for communication but also redesigns node lifecycle management to control startup, shutdown, and error states safely. It supports executors that manage how nodes run to meet timing constraints. Security features like encryption and authentication are built-in. These combined changes enable real-time and safety-critical robot applications.
Result
Learners gain deep insight into how ROS 2 supports advanced robot needs internally.
Understanding ROS 2's layered design reveals why it is suited for modern robotics challenges.
Under the Hood
ROS 1 uses a custom TCP/IP-based communication system called ROS Master to connect nodes, which can cause delays and lacks real-time guarantees. ROS 2 replaces this with DDS, a standardized middleware that supports multiple communication patterns, real-time quality of service, and discovery without a central master. ROS 2 nodes have managed lifecycles allowing controlled startup and shutdown, improving safety and reliability.
Why designed this way?
ROS 1 was designed when robotics was less complex, focusing on ease of use and flexibility. As robots became more advanced, the need for real-time control, safety, and support for multiple platforms grew. DDS was chosen for ROS 2 because it is an industry standard with real-time and security features. The lifecycle and executor designs address production needs that ROS 1 could not meet.
ROS 1 Architecture:
┌─────────────┐      ┌─────────────┐
│   ROS Master│◀────▶│    Nodes    │
└─────────────┘      └─────────────┘
       ▲                    ▲
       │                    │
    Centralized        Custom TCP/IP

ROS 2 Architecture:
┌─────────────┐      ┌─────────────┐
│    DDS      │◀────▶│    Nodes    │
└─────────────┘      └─────────────┘
       ▲                    ▲
       │                    │
Decentralized       Standardized Middleware
with QoS and Security
Myth Busters - 4 Common Misconceptions
Quick: Does ROS 2 completely replace ROS 1 with no overlap? Commit yes or no.
Common Belief:ROS 2 is just a newer version that fully replaces ROS 1 immediately.
Tap to reveal reality
Reality:ROS 2 is a new system with different architecture and is not fully backward compatible. Many projects still use ROS 1, and migration takes time.
Why it matters:Assuming immediate replacement can lead to rushed migrations and broken robot systems.
Quick: Do you think ROS 1 supports real-time control well? Commit yes or no.
Common Belief:ROS 1 can handle real-time robot control effectively.
Tap to reveal reality
Reality:ROS 1 lacks real-time guarantees due to its communication design and centralized master node.
Why it matters:Using ROS 1 for real-time tasks can cause unpredictable delays and failures.
Quick: Is DDS middleware only a minor detail in ROS 2? Commit yes or no.
Common Belief:DDS is just a technical detail and does not affect how ROS 2 works fundamentally.
Tap to reveal reality
Reality:DDS is central to ROS 2's improvements, enabling real-time, security, and decentralized communication.
Why it matters:Ignoring DDS's role can cause misunderstandings about ROS 2's capabilities and design.
Quick: Can you run ROS 1 nodes directly inside ROS 2 without changes? Commit yes or no.
Common Belief:ROS 1 nodes run inside ROS 2 without modification.
Tap to reveal reality
Reality:ROS 1 nodes require a compatibility layer (ROS1_bridge) and cannot run natively in ROS 2.
Why it matters:Expecting seamless node reuse can delay development and cause integration issues.
Expert Zone
1
ROS 2's executor model allows fine-grained control over how nodes are scheduled, enabling custom real-time behavior that ROS 1 cannot match.
2
The ROS 2 lifecycle states provide a formal way to manage node states, improving system robustness and safety in complex robot applications.
3
DDS implementations vary, so choosing the right DDS vendor affects performance, security, and compatibility in ROS 2 deployments.
When NOT to use
ROS 2 may be overkill for simple robots or educational projects where ROS 1's simplicity suffices. In such cases, using ROS 1 or lightweight frameworks like micro-ROS or custom middleware might be better.
Production Patterns
In production, ROS 2 is used with DDS vendors tuned for specific hardware, combined with lifecycle-managed nodes for safety. Hybrid systems use ROS1_bridge to gradually migrate legacy ROS 1 components. Real-time executors and security features are configured per application needs.
Connections
Middleware in Distributed Systems
ROS 2 builds on DDS middleware, a common pattern in distributed computing for reliable communication.
Understanding DDS helps grasp how ROS 2 achieves real-time and scalable communication like other distributed systems.
Real-Time Operating Systems (RTOS)
ROS 2 integrates with RTOS to provide deterministic timing for robot control.
Knowing RTOS principles clarifies how ROS 2 supports real-time constraints critical for robotics.
Safety-Critical Systems Engineering
ROS 2's lifecycle and security features align with practices in safety-critical system design.
Familiarity with safety engineering helps understand ROS 2's design choices for reliable robot operation.
Common Pitfalls
#1Trying to run ROS 1 nodes directly in ROS 2 without adaptation.
Wrong approach:ros2 run my_ros1_node
Correct approach:Use ROS1_bridge to connect ROS 1 nodes with ROS 2 environment.
Root cause:Misunderstanding that ROS 1 and ROS 2 are separate systems requiring bridging.
#2Assuming ROS 2 automatically provides real-time performance without configuration.
Wrong approach:Deploy ROS 2 nodes on any OS without real-time settings and expect deterministic timing.
Correct approach:Configure ROS 2 with real-time OS and use real-time executors and QoS settings.
Root cause:Overlooking that real-time support depends on system setup, not just ROS 2 itself.
#3Ignoring security features in ROS 2 and deploying robots without encryption or authentication.
Wrong approach:Run ROS 2 nodes with default DDS settings on public networks.
Correct approach:Enable DDS security plugins and configure authentication and encryption.
Root cause:Underestimating security risks in robot communication.
Key Takeaways
ROS 1 and ROS 2 are robot software frameworks with ROS 2 designed to overcome ROS 1's limitations in real-time, safety, and modern hardware support.
ROS 2 uses DDS middleware and node lifecycle management to provide decentralized, secure, and real-time capable communication.
Migrating from ROS 1 to ROS 2 requires effort due to architectural differences and new APIs.
Understanding ROS 2's internal design helps build safer and more reliable robots for complex tasks.
Knowing when to use ROS 1 or ROS 2 depends on project needs, complexity, and real-time requirements.

Practice

(1/5)
1. Which statement best describes the main difference between ROS 1 and ROS 2?
easy
A. ROS 1 is older and simpler, while ROS 2 supports real-time and better scalability.
B. ROS 1 supports real-time better than ROS 2.
C. ROS 2 is older and less flexible than ROS 1.
D. ROS 1 and ROS 2 have the same features and design.

Solution

  1. Step 1: Understand ROS 1 characteristics

    ROS 1 is the original version, simpler but limited in real-time and scalability.
  2. Step 2: Understand ROS 2 improvements

    ROS 2 was designed to fix these limits, adding real-time support and better scalability.
  3. Final Answer:

    ROS 1 is older and simpler, while ROS 2 supports real-time and better scalability. -> Option A
  4. Quick Check:

    ROS 1 simpler, ROS 2 modern and scalable = A [OK]
Hint: Remember ROS 2 is the newer, more advanced version [OK]
Common Mistakes:
  • Thinking ROS 2 is older than ROS 1
  • Believing ROS 1 has better real-time support
  • Assuming both versions have identical features
2. Which of the following is a correct way to describe ROS 2's communication middleware?
easy
A. ROS 2 does not support middleware communication.
B. ROS 2 uses DDS (Data Distribution Service) for flexible communication.
C. ROS 2 uses TCP only for all communication.
D. ROS 2 uses HTTP protocol for message passing.

Solution

  1. Step 1: Identify ROS 2 communication method

    ROS 2 uses DDS, a middleware standard, for flexible and scalable communication.
  2. Step 2: Check other options

    TCP only or HTTP are not used as the main middleware in ROS 2.
  3. Final Answer:

    ROS 2 uses DDS (Data Distribution Service) for flexible communication. -> Option B
  4. Quick Check:

    ROS 2 middleware = DDS [OK]
Hint: DDS is the key middleware in ROS 2 communication [OK]
Common Mistakes:
  • Confusing TCP with DDS
  • Thinking ROS 2 lacks middleware
  • Assuming HTTP is used for ROS 2 messages
3. Consider this code snippet in ROS 1 and ROS 2:
node = Node('example_node')
node.create_publisher(String, 'topic', 10)

What is a key difference in how this code behaves in ROS 1 vs ROS 2?
medium
A. ROS 2 does not support publishers.
B. ROS 1 uses create_publisher with QoS settings; ROS 2 ignores QoS.
C. Both ROS 1 and ROS 2 use create_publisher identically.
D. ROS 1 does not support create_publisher method; ROS 2 does.

Solution

  1. Step 1: Check ROS 1 publisher creation

    ROS 1 uses rospy.Publisher or roscpp::Publisher, not create_publisher.
  2. Step 2: Check ROS 2 publisher creation

    ROS 2 uses create_publisher with QoS settings for flexible communication.
  3. Final Answer:

    ROS 1 does not support create_publisher method; ROS 2 does. -> Option D
  4. Quick Check:

    ROS 2 uses create_publisher, ROS 1 does not [OK]
Hint: Remember ROS 2 introduced create_publisher method [OK]
Common Mistakes:
  • Assuming ROS 1 has create_publisher method
  • Thinking QoS is ignored in ROS 2
  • Believing ROS 2 lacks publisher support
4. You try to run a ROS 2 node but get an error about missing rclcpp::init. What is the likely cause?
medium
A. The error means your topic name is invalid.
B. ROS 1 nodes require rclcpp::init but ROS 2 does not.
C. You forgot to initialize the ROS 2 client library before creating nodes.
D. You used ROS 1 syntax in a ROS 2 project.

Solution

  1. Step 1: Understand ROS 2 initialization

    ROS 2 requires calling rclcpp::init before creating nodes to set up communication.
  2. Step 2: Check error cause

    Missing rclcpp::init causes runtime errors when nodes try to start.
  3. Final Answer:

    You forgot to initialize the ROS 2 client library before creating nodes. -> Option C
  4. Quick Check:

    Missing rclcpp::init means no ROS 2 initialization [OK]
Hint: Always call rclcpp::init before node creation in ROS 2 [OK]
Common Mistakes:
  • Confusing ROS 1 and ROS 2 initialization steps
  • Assuming topic name causes this error
  • Ignoring the need for client library init
5. You want to build a robot system that requires real-time control and works on multiple platforms including Windows and Linux. Which ROS version should you choose and why?
hard
A. Choose ROS 2 because it supports real-time control and multi-platform compatibility.
B. Choose ROS 1 because it is simpler and supports all platforms equally.
C. Choose ROS 1 because ROS 2 does not support Windows.
D. Choose ROS 2 but only if you use Linux, not Windows.

Solution

  1. Step 1: Identify real-time and platform needs

    The project needs real-time control and multi-platform support including Windows and Linux.
  2. Step 2: Match requirements to ROS versions

    ROS 2 supports real-time features and runs on Windows and Linux, unlike ROS 1 which is limited.
  3. Final Answer:

    Choose ROS 2 because it supports real-time control and multi-platform compatibility. -> Option A
  4. Quick Check:

    Real-time + multi-platform = ROS 2 [OK]
Hint: ROS 2 is designed for real-time and multi-platform use [OK]
Common Mistakes:
  • Assuming ROS 1 supports Windows well
  • Thinking ROS 2 lacks real-time features
  • Believing ROS 2 only works on Linux
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard