Skip to content

ROS1 vs ROS2: Which One Should You Use for Your Robotics Project in 2024

  • ROS

ROS1 vs ROS2: It has been over 10 years since the Robot Operating System (ROS) was first introduced to the robotics research community. During this time, the ROS ecosystem has seen numerous changes, with the most significant being the shift to ROS2, which represents a complete overhaul of the existing system. While we are still in a transitional phase where both versions coexist, this transition is expected to accelerate once official support for ROS1 ends in 2025.

In this post, I will outline the key differences between ROS2 and its predecessor, highlighting the advantages and disadvantages of the new version.

For a more in-depth introduction to ROS, a separate post provides a detailed explanation. You can also find an overview of ROS2 here.



ROS1 vs ROS2

Why ROS2 came out and the Reason for the Transition

Although ROS1 is a robust framework for robotic research, it came with inherent issues that were difficult to resolve. As a result, ROS2 was developed and released. Here are some of the primary reasons for this transition:

Scalability and Real-Time Performance

ROS1 was not designed with real-time performance in mind. While it was excellent for prototyping and research, many modern applications—especially in industries or missions where precision is critical—require real-time processing and strict timing control. The communication infrastructure in ROS1, built to prioritize ease of implementation, did not adequately address communication delays, making it less suitable for multi-robot systems and high-bandwidth data streams.

Limitations of the Communication Method

ROS1 relies on a custom, non-standard communication layer based on TCP and UDP. While this was sufficient for many purposes, it lacked the Quality of Service (QoS) features necessary for reliable communication in distributed systems. As robotic systems have become increasingly complex and are deployed in dynamic environments, such as autonomous vehicles and drones, the need for a more robust and flexible communication system became apparent. This led to the development of a new version that incorporates these considerations.

Cross-Platform Compatibility

ROS1 was initially developed on Linux, leveraging the flexibility and openness of the platform to support robotic development. As a result, most robot development in research has been conducted on Ubuntu. However, as ROS has grown in scope, there has been a growing demand for compatibility with other operating systems beyond Ubuntu.

Developing a system that operates consistently across multiple operating systems is a complex task, and maintaining the original ROS architecture made it difficult to achieve cross-platform compatibility.

Information Security

ROS1, being primarily designed for research, did not include features for system-wide data protection. While this may not have been a critical issue in research environments where resources are often shared openly, the expansion of ROS into more industries has created a necessity for security features. The limitations of the original architecture made it challenging to incorporate such features, prompting the development of a new version that includes enhanced security measures.

ROS1 vs ROS2: Differences and Comparisons

Let’s explore the changes introduced in ROS2, which was developed to address the limitations of the previous version. To summarize briefly, the biggest difference lies in the communication method between processes. While some mention the difference in Python 3 support, it’s important to note that the last version of ROS1 already supports Python 3, so this is not accurate.

Communication Middleware – Presence of ROS Master

One of the most visible differences between the two versions is the presence of the ROS Master node. In ROS1, the Master node, acting as a central manager, had to be launched first to enable communication between nodes. This setup works well for small, centralized systems but poses issues in distributed systems where no single entity should take on the role of a manager. To resolve this, ROS2 eliminates the need for a Master node and adopts DDS (Data Distribution Service), allowing for independent communication between nodes.

  • ROS1: Uses a custom communication protocol based on TCP/ROS and UDP/ROS. While functional, it has limitations in terms of message reliability, latency, and real-time performance.
  • ROS2: Adopts DDS, a widely used standard protocol designed for high-performance real-time distributed systems. With DDS, ROS2 provides QoS (Quality of Service) settings that allow fine control over message behavior, such as reliability, durability, and deadlines.

Real-Time Capabilities

  • ROS1: Was not designed with real-time tasks in mind. Its scheduling and communication mechanisms can introduce delays, limiting its use in systems requiring strict timing control.
  • ROS2: Introduces better control over node execution and communication to meet real-time requirements. ROS2 nodes can run on RTOS (Real-Time Operating Systems), enabling deterministic behavior, which is crucial for robot control loops and mission-critical applications.

Information Security

  • ROS1: Does not include built-in security features. Communications between nodes are unencrypted, and it lacks support for authentication or access control, leaving the system vulnerable to attacks.
  • ROS2: Integrates security features from the start. By using DDS, it supports encryption, authentication, and access control, making it suitable for applications where data privacy and integrity are crucial, such as in healthcare or autonomous systems.

Cross-Platform Support

  • ROS1: Primarily designed for Linux-based systems, though workarounds exist to use it on Windows and macOS. However, performance on non-Linux systems is not optimized.
  • ROS2: Natively supports Linux, Windows, and macOS, allowing developers to work seamlessly across different platforms. This is particularly useful for organizations using diverse environments or deploying robots in various settings.

In addition to these changes, there are other updates, such as changes to the build system, but most of these improvements are aimed at enhancing communication and operating system compatibility.

Comparison of Pros and Cons: ROS1 vs ROS2

As with any software system, new versions like ROS2 are developed to address the limitations of their predecessors. However, a newer version isn’t always inherently better. Below are the pros and cons of both ROS1 and ROS2.

Pros and Cons of ROS1

The primary advantage of ROS1 lies in the size and maturity of its user community. Since it has been in use for a longer period, a substantial number of resources have already been developed based on ROS1, and many developers are well-acquainted with it. This large community support is crucial, as it means there are more available resources for troubleshooting. For instance, I still primarily use ROS1, and I find that most of the problem-solving resources are still focused on ROS1.

Another advantage of a well-established system is its stability. Over the years, many developers have contributed to ROS1, and it has undergone numerous updates that have resolved many of its early issues. As a result, developers are less likely to encounter unexpected fundamental problems, which provides peace of mind during development.

However, the disadvantages of ROS1 are essentially the reasons ROS2 was developed in the first place. Its limitations in real-time performance, lack of security features, and other core issues make it less suitable for more advanced or mission-critical applications.

Pros and Cons of ROS2

ROS2 was specifically developed to address the limitations of ROS1, so it introduces solutions to problems that were difficult or impossible to fix in the earlier version. The biggest advantage of ROS2 is that it enables features that were previously unachievable, such as improved real-time capabilities, making it more suitable for real-world robotics applications. The replacement of the communication framework allows ROS2 to better support distributed systems without relying on the Master-Slave model, and although still under development, it shows much better cross-platform compatibility compared to ROS1.

As a relatively new system, ROS2 does have some drawbacks. Its user base is still smaller than that of ROS1, meaning fewer community resources and less support are available. Developers may face unexpected issues due to the newer framework, and with fewer resources available, resolving these issues can take more effort.

Another disadvantage is that many resources developed for ROS1 are not directly compatible with ROS2. While ROS Bridge can provide some level of compatibility, using these resources still often requires extra work, making it less efficient than developing natively in ROS1.

Finally, ROS2 has not yet reached the same level of stability as ROS1. Bugs and other unexpected issues are still common as the system continues to be actively improved, meaning developers may not yet be able to build entirely stable systems in ROS2.

In conclusion, while ROS2 brings significant improvements, especially for more advanced and distributed robotic systems, ROS1’s stability and large resource pool may still make it the better choice for certain applications.

ROS1 vs ROS2: Which Version Should You Use?

While ROS1 is scheduled for official support termination in 2025, its advantages are still clear, and since it will remain usable even after support ends, it’s wise to carefully consider your goals before automatically opting for the newer version.

When to Use ROS1

  1. If You Are Using an Existing System: If your project relies on an existing ROS1 codebase or heavily depends on third-party packages that have not yet been ported to ROS2, continuing with ROS1 makes sense. Many industries and research projects have extensively integrated ROS1, making a rapid switch to ROS2 challenging.
  2. If You Need Broad Community Support: ROS1 has been in use for over a decade, resulting in a large, active community. There are abundant tutorials, forums, and pre-built packages available. If you’re working in academia or on a smaller project where security and real-time performance aren’t critical, the maturity of ROS1 is a significant benefit.
  3. When Real-Time Performance and Security Aren’t a Priority: If your application doesn’t require real-time performance or secure communication (e.g., educational robots, small research prototypes), the lack of these features in ROS1 may not be a significant drawback.

When to Use ROS2

  1. If You Need Real-Time Capabilities: For applications like industrial automation, autonomous vehicles, or drones that require strict timing constraints, ROS2 is the clear choice. ROS2 supports real-time operating systems (RTOS) and deterministic communication, making it suitable for time-sensitive applications.
  2. If Security is a Priority: In fields like healthcare, defense, or large-scale industrial robotics, where data integrity and security are crucial, ROS2’s built-in encryption, authentication, and access control features are indispensable. ROS1 does not offer these security features.
  3. If You Are Building a Scalable, Complex Multi-Robot System: ROS2’s modular architecture and scalable communication system make it better suited for large, distributed systems where multiple robots or subsystems need to work together. Its improved node lifecycle management and DDS support allow for smoother coordination and scalability in multi-robot environments.
  4. If Cross-Platform Support is Essential: If your project needs to run across Linux, Windows, and macOS, ROS2’s native cross-platform support will save development time and improve performance across different platforms.

Long-Term Considerations

  1. Future-Proofing: If you’re starting a new project and planning for long-term development, ROS2 will likely be the better choice. While ROS1 is still supported, it’s expected that over time, ROS2 will become the standard, making it a more future-proof option.
  2. Community and Package Ecosystem: While ROS1 currently has a larger community and more packages, the ROS2 ecosystem is growing rapidly. Many key ROS1 packages are being ported to ROS2, and over time, ROS2 is expected to catch up and eventually surpass ROS1 in terms of community support and available resources.

Transitioning from ROS1 to ROS2

If you’re already using ROS1 but considering a switch to ROS2, keep in mind that the two systems are not fully compatible. Porting existing ROS1 code to ROS2 requires some effort. However, tools like ros1_bridge can help by enabling communication between nodes developed in different versions, allowing for a hybrid approach. This can be useful for projects that want to gradually transition to ROS2 while still relying on existing ROS1 systems.

Conclusion

In this post, we’ve examined the key differences, pros, and cons of ROS1 and ROS2. ROS1, with its mature ecosystem, offers stable performance for a wide range of projects, particularly those where real-time performance and security aren’t critical. On the other hand, ROS2 is a next-generation robotic operating system designed with real-time capabilities, security, and scalability in mind, making it ideal for complex multi-robot systems or projects requiring multi-platform support.

Choosing between ROS1 and ROS2 depends on your project’s requirements and environment. However, planning for a long-term transition to ROS2 could be a good strategy as its ecosystem continues to grow and stabilize. Both versions continue to play important roles in robotics, and your choice should align with your immediate and future project needs.

Leave a Reply

Your email address will not be published. Required fields are marked *