Bird
Raised Fist0
ROSframework~10 mins

ROS 1 vs ROS 2 overview - Visual Side-by-Side Comparison

Choose your learning style10 modes available
Concept Flow - ROS 1 vs ROS 2 overview
Start: ROS 1
↓
Limitations found
↓
Design ROS 2
↓
ROS 2 Features
↓
Transition & Coexistence
↓
Future with ROS 2
This flow shows how ROS 1 led to identifying limitations, which inspired the design of ROS 2 with new features, followed by transition and future focus.
Execution Sample
ROS
# ROS 1 vs ROS 2 key differences
ros1_features = ['Single master', 'No real-time', 'Limited security']
ros2_features = ['DDS middleware', 'Real-time support', 'Security enhancements']
print('ROS 1:', ros1_features)
print('ROS 2:', ros2_features)
This code lists main features of ROS 1 and ROS 2 to compare their differences.
Execution Table
StepActionROS 1 FeaturesROS 2 FeaturesOutput
1Initialize ROS 1 features list['Single master', 'No real-time', 'Limited security']
2Initialize ROS 2 features list['DDS middleware', 'Real-time support', 'Security enhancements']
3Print ROS 1 features['Single master', 'No real-time', 'Limited security']['DDS middleware', 'Real-time support', 'Security enhancements']ROS 1: ['Single master', 'No real-time', 'Limited security']
4Print ROS 2 features['Single master', 'No real-time', 'Limited security']['DDS middleware', 'Real-time support', 'Security enhancements']ROS 2: ['DDS middleware', 'Real-time support', 'Security enhancements']
5End of comparison['Single master', 'No real-time', 'Limited security']['DDS middleware', 'Real-time support', 'Security enhancements']Comparison complete
💡 All features printed, comparison ends
Variable Tracker
VariableStartAfter Step 1After Step 2Final
ros1_featuresundefined['Single master', 'No real-time', 'Limited security']['Single master', 'No real-time', 'Limited security']['Single master', 'No real-time', 'Limited security']
ros2_featuresundefinedundefined['DDS middleware', 'Real-time support', 'Security enhancements']['DDS middleware', 'Real-time support', 'Security enhancements']
Key Moments - 3 Insights
Why does ROS 1 use a single master while ROS 2 does not?
ROS 1 relies on a central master node to coordinate communication, which can be a single point of failure. ROS 2 uses DDS middleware allowing decentralized communication without a single master, improving reliability. This is shown in the feature lists in execution_table steps 1 and 2.
How does ROS 2 support real-time better than ROS 1?
ROS 1 lacks real-time guarantees due to its communication design. ROS 2 uses DDS which supports real-time Quality of Service settings, enabling predictable timing. This difference is highlighted in the ros1_features and ros2_features variables in the execution_table.
What role does security play in the difference between ROS 1 and ROS 2?
ROS 1 has limited security features, making it less suitable for sensitive applications. ROS 2 includes security enhancements like authentication and encryption via DDS security plugins, as seen in the ros2_features list in the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3, what is the content of ros1_features?
A[]
B['Single master', 'No real-time', 'Limited security']
C['DDS middleware', 'Real-time support', 'Security enhancements']
Dundefined
💡 Hint
Check the 'ROS 1 Features' column at step 3 in the execution_table.
At which step does ros2_features get initialized?
AStep 3
BStep 1
CStep 2
DStep 4
💡 Hint
Look at the 'Action' and 'ROS 2 Features' columns in the execution_table.
If we added 'Multi-master support' to ros2_features, how would the execution_table change?
AThe 'ROS 2 Features' column would include 'Multi-master support' from step 2 onward
BThe 'ROS 1 Features' column would include 'Multi-master support'
CThe output at step 3 would change
DNo change in any column
💡 Hint
Consider how variables are initialized and printed in the execution_table rows.
Concept Snapshot
ROS 1 uses a single master node for communication.
ROS 2 replaces this with DDS middleware for decentralized communication.
ROS 2 adds real-time support and security features.
Transition involves coexistence but future focus is on ROS 2.
Key difference: ROS 2 is more scalable, secure, and real-time capable.
Full Transcript
This visual execution compares ROS 1 and ROS 2 by listing their key features step-by-step. ROS 1 starts with a single master, no real-time support, and limited security. ROS 2 introduces DDS middleware, real-time capabilities, and security enhancements. The execution table shows initialization and printing of these features. Variable tracking confirms how feature lists are set and remain unchanged. Key moments clarify why ROS 2 improves on ROS 1 in architecture, real-time, and security. The quiz tests understanding of these steps and variable states. The snapshot summarizes the main differences and future direction.

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