Booil Jung

ROS 2와 순수 DDS 애플리케이션 간의 상호운용성

사용자의 핵심 질문, “ROS 2 애플리케이션이 보낸 메시지를 비-ROS 2(순수 DDS) 애플리케이션이 수신할 수 있는가?”에 대한 명확한 답변은 “예, 가능합니다”이다. 이는 우연한 기능이 아니라, ROS 2가 설계 단계부터 의도한 핵심적인 특징 중 하나이다. 이 보고서는 이것이 어떻게 가능한지에 대한 기술적 원리와 구체적인 구현 방법을 심층적으로 분석한다.

ROS 1은 TCPROS라는 독자적인 통신 프로토콜을 사용하여 ROS 생태계 내에서는 효율적이었지만, 외부 시스템과의 연동에는 한계가 있었다.1 반면, ROS 2는 개발 초기부터 학술 연구를 넘어 상용 및 산업용 시장으로의 확장을 목표로 삼았다.2 이를 위해 ROS 2는 통신 미들웨어로 업계 표준인 DDS(Data Distribution Service)를 채택하는 전략적 결정을 내렸다.3

DDS는 OMG(Object Management Group)에 의해 표준화된 데이터 중심의 발행-구독(Publish-Subscribe) 통신 프레임워크로, 이미 국방, 항공우주, 의료, 산업 자동화 등 미션 크리티컬 시스템에서 그 성능과 신뢰성을 입증받았다.3 DDS는 실시간성, 확장성, 데이터 신뢰성, 보안 등 산업 현장에서 요구하는 엄격한 요구사항들을 충족시키도록 설계되었다.3 따라서 ROS 2가 DDS를 채택한 것은 단순히 성능 좋은 미들웨어를 사용하는 것을 넘어, DDS가 제공하는 표준 기반의 개방형 생태계에 적극적으로 편입하여 산업계의 요구에 부응하겠다는 명확한 의지를 보여준다.1

순수 DDS 애플리케이션과의 상호운용성은 ROS 2 시스템에 다음과 같은 중요한 가치를 제공한다.

이러한 배경을 바탕으로, 본 보고서는 ROS 2와 순수 DDS 간의 상호운용성을 가능하게 하는 핵심 아키텍처인 RMW를 분석하고, 통신을 위해 반드시 준수해야 할 기술적 요구사항들을 상세히 설명한다. 또한, 주요 DDS 벤더별 구현 방법과 실용적인 예제, 문제 해결을 위한 디버깅 전략을 포괄적으로 제시하여 개발자가 실제 시스템에 상호운용성을 성공적으로 적용할 수 있도록 돕는 것을 목표로 한다.

ROS 2와 순수 DDS 애플리케이션의 상호운용성을 이해하기 위해서는 먼저 ROS 2가 내부적으로 통신을 처리하는 방식, 특히 RMW(ROS Middleware Interface) 추상화 계층의 역할에 대한 이해가 필수적이다. RMW는 상호운용성의 ‘조력자’인 동시에, 그 규칙을 따라야만 통과할 수 있는 ‘관문’ 역할을 한다.

RMW는 ROS 2의 상위 애플리케이션 코드(ROS 클라이언트 라이브러리, RCL을 통해 작성된)와 하부의 특정 DDS 구현체 사이를 중개하는 C 언어 기반의 API 계층이다.10 ROS 2 애플리케이션 개발자는

rclcpp::create_publisher()와 같은 ROS 2 API를 호출하지만, 실제 네트워크 통신은 RMW를 통해 선택된 DDS 벤더(예: Fast DDS)의 API가 수행한다.2

RMW의 가장 큰 존재 이유는 ‘미들웨어 종속성 제거’이다. RMW 덕분에 개발자는 ROS 2 코드를 전혀 수정하지 않고, 단지 RMW_IMPLEMENTATION이라는 환경 변수를 rmw_fastrtps_cpp에서 rmw_cyclonedds_cpprmw_connextdds로 변경하는 것만으로 기본 통신 미들웨어를 교체할 수 있다.13 이러한 유연성은 특정 벤더에 대한 종속을 피하고, 프로젝트의 요구사항(성능, 라이선스, 플랫폼 지원 등)에 가장 적합한 DDS 솔루션을 선택할 수 있게 해준다.10

순수 DDS 애플리케이션이 ROS 2와 통신하기 어려운 근본적인 이유는 RMW가 중간에서 ‘번역’ 작업을 수행하기 때문이다. 순수 DDS 애플리케이션은 이 번역 규칙을 알지 못하므로, ROS 2가 사용하는 언어(개념)를 이해하지 못한다. RMW는 ROS 2의 고유 개념들을 DDS의 표준 개념으로 다음과 같이 매핑한다.

이 변환 과정의 중심에는 rosidl이라는 ROS 2의 인터페이스 툴체인이 있다. rosidl_adapter 패키지가 .msg, .srv, .action 파일을 파싱하고, rosidl_generator_dds_idl 패키지가 이를 DDS 표준 .idl 파일로 변환한다.17 이후 각 RMW 구현체(예:

rmw_fastrtps_cpp)는 이 공통의 .idl 파일을 사용하여 각 DDS 벤더에 특화된 타입 지원(Type Support) 코드를 생성하고 컴파일한다.11

결론적으로, 순수 DDS 애플리케이션이 ROS 2 네트워크와 상호운용되기 위해서는 RMW라는 ‘번역기’가 내부적으로 수행하는 이 모든 변환 규칙(토픽 이름 변환, 데이터 타입 구조 및 이름 변환 등)을 수동으로 정확하게 복제해야만 한다.

RMW는 타입 지원 방식에 따라 크게 두 가지로 나뉜다.

ROS 2와 순수 DDS 애플리케이션 간의 성공적인 통신은 다음 네 가지 핵심 기술 요구사항을 정확하게 일치시키는 것에 달려있다. 이 중 하나라도 어긋나면 통신은 실패하며, 디버깅은 이 네 가지 요소를 체계적으로 점검하는 과정이다.

RMW는 ROS 2의 이름 공간을 DDS 토픽 이름으로 변환할 때, 혼동을 피하고 내부적으로 통신 유형을 구분하기 위해 특정 규칙(Name Mangling)에 따라 접두사와 접미사를 추가한다. 순수 DDS 애플리케이션은 반드시 이 변환된 최종 이름을 사용하여 DDS 토픽을 생성하고 구독해야 한다.

이러한 변환 규칙의 기반이 되는 ROS 2의 공식 이름 지정 규칙(예: 이름은 /로 시작해야 하고, 연속된 //__를 포함할 수 없음) 또한 준수되어야 한다.24

단순히 토픽 이름만 맞추는 것으로는 부족하다. 해당 토픽을 통해 교환되는 데이터의 ‘형태’와 ‘이름’ 또한 정확히 일치해야 한다.

DDS의 강력한 기능 중 하나는 데이터 통신의 특성을 세밀하게 제어할 수 있는 풍부한 QoS(Quality of Service) 정책이다. DDS는 신뢰성, 내구성, 이력 관리 등 22가지 이상의 QoS 정책을 제공하며, ROS 2는 이 중 일부를 조합하여 사용한다.1

DDS는 도메인 ID(Domain ID)라는 0 이상의 정수 값을 사용하여 독립적인 가상 네트워크를 구성한다. 오직 동일한 도메인 ID를 가진 DDS 참여자(Participant)들만이 서로를 발견하고 통신할 수 있다.5 ROS 2에서는

ROS_DOMAIN_ID 환경 변수를 통해 이 값을 설정하며, 기본값은 0이다. 따라서 순수 DDS 애플리케이션과 통신하려는 ROS 2 시스템은 반드시 동일한 도메인 ID를 사용하도록 설정되어야 한다.

상호운용성을 달성하는 구체적인 방법은 사용하는 DDS 벤더와 그에 해당하는 RMW 구현체에 따라 미묘한 차이가 있다. 벤더 선택은 단순히 성능이나 라이선스 문제를 넘어, 상호운용성 구현의 난이도와 가용한 지원 수준에 직접적인 영향을 미치는 중요한 아키텍처 결정이다.

eProsima Fast DDS는 ROS 2의 대부분 LTS(Long-Term Support) 릴리즈에서 기본 미들웨어로 채택되어 있어, 가장 일반적인 상호운용 시나리오에 해당한다.13

Cyclone DDS는 뛰어난 성능과 안정성으로 널리 알려져 있으며, ROS 2 Galactic 배포판의 기본 RMW로 채택된 바 있다.29 Autoware, Nav2 등 주요 자율주행 및 내비게이션 프로젝트에서 선호되는 구현체이다.29

RTI Connext DDS는 상용 등급의 DDS 구현체로, 최고의 성능과 신뢰성이 요구되는 미션 크리티컬 시스템에 널리 사용된다. RTI는 ROS 2와의 상호운용성을 매우 중요하게 여기며, 이를 위한 체계적인 지원을 제공한다.3

설정 항목 eProsima Fast DDS Eclipse Cyclone DDS RTI Connext DDS
대표 RMW 패키지 rmw_fastrtps_cpp rmw_cyclonedds_cpp rmw_connextdds
핵심 도구 Fast-DDS-Gen cyclonedds IDL 컴파일러 RTI Admin Console, rtiddsgen
토픽 이름 규칙 rt/, rq/, rr/ 접두사 rt/, rq/, rr/ 접두사 rt/, rq/, rr/ 접두사
타입 이름 규칙 <pkg>::msg::dds_::<type>_ <pkg>::msg::dds_::<type>_ <pkg>::msg::dds_::<type>_
주요 IDL/QoS 고려사항 ROS 2 QoS 프로파일과 정확히 일치 IDL struct에 @final 어노테이션 사용 USER_QOS_PROFILES.xml 사용, 사전 변환 IDL 활용
대표 예제 저장소 osrf/ros2_raw_dds_example 커뮤니티 포럼/이슈 기반 rticommunity/ros2-interop-demos

이론적 지식을 바탕으로, 실제 상호운용성을 구현하고 문제를 해결하는 구체적인 방법을 알아본다.

가장 기본적인 std_msgs/msg/String 메시지를 사용하여 ROS 2 talker 노드와 순수 Fast DDS subscriber 애플리케이션을 연동하는 과정을 단계별로 시연한다.

상호운용성 문제 발생 시, 무작위로 시도하기보다 다음의 체계적인 흐름에 따라 문제를 진단하는 것이 효율적이다.

본 보고서를 통해 도출된 핵심 결론은 다음과 같다.

  1. 상호운용성은 가능하다: ROS 2와 순수 DDS 애플리케이션 간의 직접적인 데이터 교환은 가능하며, 이는 ROS 2가 산업 표준인 DDS를 채택한 덕분에 의도된 기능이다.
  2. 성공의 열쇠는 ‘정확한 복제’이다: 성공적인 연동은 ROS 2의 RMW 계층이 내부적으로 수행하는 변환 규칙을 순수 DDS 애플리케이션에서 얼마나 정확하게 복제하느냐에 달려있다.
  3. 네 가지 핵심 요소: 개발자는 (1) DDS 도메인 ID, (2) 변환된 토픽 이름, (3) 변환된 데이터 타입(이름 및 구조), (4) 호환되는 QoS 정책이라는 네 가지 핵심 요소를 반드시 일치시켜야 한다.
  4. 벤더별 차이 존재: 구체적인 구현 방법과 사용 도구는 eProsima Fast DDS, Eclipse Cyclone DDS, RTI Connext DDS 등 사용하는 DDS 벤더에 따라 다르므로, 각 벤더의 특성과 문서를 숙지해야 한다.

순수 DDS 연동은 강력한 기능이지만, 모든 상황에 적합한 만능 해결책은 아니다. 프로젝트의 아키텍처를 결정할 때 다음 사항들을 전략적으로 고려해야 한다.

  1. ROS2와 DDS란? - 개발하는 핑구 - 티스토리, accessed July 2, 2025, https://ai-sinq.tistory.com/entry/ROS2%EC%99%80-DDS%EB%9E%80
  2. Robot Operating System 2 (ROS 2) Architecture by Huseyin Kutluca - Medium, accessed July 2, 2025, https://medium.com/software-architecture-foundations/robot-operating-system-2-ros-2-architecture-731ef1867776
  3. ROS 2: What is DDS Data Distribution Service (DDS) Community RTI Connext Users, accessed July 2, 2025, https://community.rti.com/page/ros-2-what-dds
  4. DDS implementations - ROS 2 Documentation: Foxy documentation, accessed July 2, 2025, https://docs.ros.org/en/foxy/Installation/DDS-Implementations.html
  5. robotics - What’s the difference between ROS2 and DDS? - Stack Overflow, accessed July 2, 2025, https://stackoverflow.com/questions/51187676/whats-the-difference-between-ros2-and-dds
  6. ROS 2 Architecture Overview - Automatic Addison, accessed July 2, 2025, https://automaticaddison.com/ros-2-architecture-overview/
  7. [ROS2] ROS 2의 DDS와 QoS - velog, accessed July 2, 2025, https://velog.io/@katinon/ROS2-ROS-2%EC%9D%98-DDS%EC%99%80-QoS
  8. ROS 2 and DDS: Interoperability Drives Next-Generation Robotics, accessed July 2, 2025, https://www.rti.com/blog/ros-2-and-dds-interoperability-drives-next-generation-robotics
  9. Fast DDS - eProsima, accessed July 2, 2025, https://fast-dds.docs.eprosima.com/
  10. Internal ROS 2 interfaces - ROS 2 Documentation: Rolling …, accessed July 2, 2025, https://docs.ros.org/en/rolling/Concepts/Advanced/About-Internal-Interfaces.html
  11. ROS 2 middleware interface - ROS2 Design, accessed July 2, 2025, https://design.ros2.org/articles/ros_middleware_interface.html
  12. rmw: ROS Middleware Abstraction Interface, accessed July 2, 2025, https://docs.ros2.org/foxy/api/rmw/
  13. DDS implementations - ROS 2 Documentation: Iron documentation, accessed July 2, 2025, https://docs.ros.org/en/iron/Installation/DDS-Implementations.html
  14. Switching Between ROS Middleware Implementations - MATLAB & Simulink - MathWorks, accessed July 2, 2025, https://www.mathworks.com/help/ros/ug/switching-between-ros-middleware-implementations.html
  15. ROS 2 Middleware (RMW) Configuration - GitHub Pages, accessed July 2, 2025, https://iroboteducation.github.io/create3_docs/setup/xml-config/
  16. ROS2 part 4 - ROS2 IPC, DDS, Topics, Services, Actions and Interfaces - RoboticsUnveiled, accessed July 2, 2025, https://www.roboticsunveiled.com/ros2-ipc-dds-topics-services-actions-interfaces/
  17. About ROS 2 middleware implementations, accessed July 2, 2025, https://docs.ros.org/en/foxy/Concepts/About-Middleware-Implementations.html
  18. README.md - ros2/rosidl - GitHub, accessed July 2, 2025, https://github.com/ros2/rosidl/blob/rolling/README.md
    1. ROS 2 using Fast DDS middleware - 3.2.2, accessed July 2, 2025, https://fast-dds.docs.eprosima.com/en/stable/fastdds/ros2/ros2.html
  19. ROS2 interoperability with native DDS - ROS Answers archive, accessed July 2, 2025, https://answers.ros.org/question/404995/
  20. osrf/ros2_raw_dds_example: A project showing how to connect a raw DDS program to a ROS 2 graph - GitHub, accessed July 2, 2025, https://github.com/osrf/ros2_raw_dds_example
  21. ROS2 interoperability with native DDS - ROS Answers archive, accessed July 2, 2025, https://answers.ros.org/question/404995/ros2-interoperability-with-native-dds/
  22. ros2/rmw_connextdds: ROS 2 RMW layer for RTI Connext DDS Professional and RTI Connext DDS Micro. - GitHub, accessed July 2, 2025, https://github.com/ros2/rmw_connextdds
  23. Topic and Service name mapping to DDS - ROS2 Design, accessed July 2, 2025, https://design.ros2.org/articles/topic_and_service_names.html
  24. Communication between Cyclone and ROS2 / Issue #1412 - GitHub, accessed July 2, 2025, https://github.com/eclipse-cyclonedds/cyclonedds/issues/1412
  25. [ROS2]OMG Data-Distribution Service: Architectural Overview and OMG Data-Distribution Service: Architectural Update - velog, accessed July 2, 2025, https://velog.io/@protocol5/ROS2OMG-Data-Distribution-Service-Architectural-Overview-and-OMG-Data-Distribution-Service-Architectural-Update
  26. eProsima/Fast-DDS: The most complete DDS - Proven: Plenty of success cases. Looking for commercial support? Contact info@eprosima.com - GitHub, accessed July 2, 2025, https://github.com/eProsima/Fast-DDS
  27. Identify a FastDDS example topic on ROS2 [13775] / eProsima Fast-DDS / Discussion #2467 - GitHub, accessed July 2, 2025, https://github.com/eProsima/Fast-DDS/discussions/2467
  28. 2021 Eclipse Cyclone DDS ROS Middleware Evaluation Report with iceoryx and Zenoh, accessed July 2, 2025, https://osrf.github.io/TSC-RMW-Reports/humble/eclipse-cyclonedds-report.html
  29. Eclipse Cyclone DDS - ROS 2 Documentation: Galactic documentation, accessed July 2, 2025, https://docs.ros.org/en/galactic/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html
  30. RTI Connext DDS - ROS 2 Documentation: Humble documentation, accessed July 2, 2025, https://docs.ros.org/en/humble/Installation/RMW-Implementations/DDS-Implementations/Working-with-RTI-Connext-DDS.html
  31. neil-rti/ros2-interop-demos: Demonstration apps to show ROS2 interoperability with native DDS apps - GitHub, accessed July 2, 2025, https://github.com/neil-rti/ros2-interop-demos
  32. rticommunity/rticonnextdds-robot-helpers: Collection of code and cmake utilities to use RTI Connext DDS with ROS 2 - GitHub, accessed July 2, 2025, https://github.com/rticommunity/rticonnextdds-robot-helpers
  33. Setting up the RTI DDS configuration file in ROS2 - Stack Overflow, accessed July 2, 2025, https://stackoverflow.com/questions/52151179/setting-up-the-rti-dds-configuration-file-in-ros2
  34. ROS 2 + DDS Interoperation - YouTube, accessed July 2, 2025, https://www.youtube.com/watch?v=GGqcrccWfeE
  35. Cybersecurity in the ROS 2 communication middleware, the Data Distribution Service (DDS), accessed July 2, 2025, https://news.aliasrobotics.com/cybersecurity-in-the-ros-2-communication-middleware-targeting-the-top-6-dds-implementations/
  36. ROS2 client library based on RustDDS - GitHub, accessed July 2, 2025, https://github.com/Atostek/ros2-client/
  37. ROS 2 DDS-Security integration - ROS2 Design, accessed July 2, 2025, https://design.ros2.org/articles/ros2_dds_security.html