Bird
Raised Fist0
ROSframework~20 mins

ROS 1 vs ROS 2 overview - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
ROS 1 vs ROS 2 Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Key architectural difference between ROS 1 and ROS 2
Which of the following best describes a major architectural change from ROS 1 to ROS 2?
AROS 2 replaces the ROS 1 master node with a decentralized discovery system using DDS.
BROS 2 uses a centralized master node to manage all communication like ROS 1.
CROS 2 removes support for message passing and uses only shared memory.
DROS 2 requires all nodes to run on the same machine for communication.
Attempts:
2 left
💡 Hint
Think about how nodes find each other in ROS 2 compared to ROS 1.
❓ component_behavior
intermediate
2:00remaining
Behavior of ROS 2 nodes compared to ROS 1 nodes
What is a new behavior of ROS 2 nodes that differs from ROS 1 nodes?
AROS 2 nodes can be written in multiple languages and support real-time execution better.
BROS 2 nodes only support Python and cannot be written in C++.
CROS 2 nodes require manual registration with the master node before communication.
DROS 2 nodes cannot communicate over a network and only work locally.
Attempts:
2 left
💡 Hint
Consider language support and real-time capabilities.
📝 Syntax
advanced
2:00remaining
ROS 2 launch file syntax difference
Which option shows a correct way to launch a ROS 2 node using the new Python-based launch system?
ROS
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([
        Node(
            package='demo_nodes_cpp',
            executable='talker',
            output='screen'
        )
    ])
AUse YAML files to define nodes and parameters.
BUse XML launch files like ROS 1 with <launch> and <node> tags.
CUse shell scripts to start nodes directly without launch files.
DUse Python scripts with launch and Node classes as shown in the code.
Attempts:
2 left
💡 Hint
ROS 2 uses a new launch system based on Python.
🔧 Debug
advanced
2:00remaining
Identifying a communication error in ROS 2
You have two ROS 2 nodes: a talker and a listener. The listener never receives messages. Which option is the most likely cause?
AThe talker node is not running because of a syntax error in its code.
BThe talker and listener use different DDS domains, so they cannot discover each other.
CThe listener node is subscribed to the wrong topic name, but the talker publishes correctly.
DThe ROS 2 master node is down, preventing communication.
Attempts:
2 left
💡 Hint
Think about how ROS 2 nodes find each other without a master.
❓ state_output
expert
2:00remaining
Output behavior of QoS settings in ROS 2
Given a ROS 2 publisher with QoS set to 'reliable' and a subscriber with QoS set to 'best effort', what will happen to the messages?
AThe publisher will automatically downgrade to best effort to match the subscriber.
BAll messages are guaranteed to be received because the publisher is reliable.
CMessages may be lost because the subscriber accepts best effort, even if the publisher is reliable.
DThe subscriber will raise an error due to QoS mismatch.
Attempts:
2 left
💡 Hint
Consider how QoS policies affect message delivery guarantees.

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