{"id":23168266,"url":"https://github.com/asorbini/rticonnextdds-ros2-demos","last_synced_at":"2025-10-05T22:05:45.548Z","repository":{"id":146825661,"uuid":"350900077","full_name":"asorbini/rticonnextdds-ros2-demos","owner":"asorbini","description":"Example ROS 2 applications using RTI Connext DDS","archived":false,"fork":false,"pushed_at":"2021-04-20T01:38:19.000Z","size":422,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T06:46:09.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asorbini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-24T00:42:41.000Z","updated_at":"2023-04-11T07:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"20b44543-d117-4338-9465-e322190e2787","html_url":"https://github.com/asorbini/rticonnextdds-ros2-demos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asorbini%2Frticonnextdds-ros2-demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asorbini%2Frticonnextdds-ros2-demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asorbini%2Frticonnextdds-ros2-demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asorbini%2Frticonnextdds-ros2-demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asorbini","download_url":"https://codeload.github.com/asorbini/rticonnextdds-ros2-demos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256780,"owners_count":20909357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-18T02:40:33.955Z","updated_at":"2025-10-05T22:05:40.468Z","avatar_url":"https://github.com/asorbini.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ROS 2 applications built with RTI Connext DDS\n\nThis repository contains a collection of  ROS 2 applications built using the\nRTI Connext DDS APIs.\n\n- [Build repository](#build-repository)\n- [Run examples](#run-examples)\n- [Included examples](#included-examples)\n  - [talker/listener](#talkerlistener)\n  - [camera](#camera)\n- [Other useful resources](#other-useful-resources)\n\n## Build repository\n\nThe included applications require RTI Connext DDS 6.x, and they can only be\nrun using [`rmw_connextdds`](https://github.com/ros2/rmw_connextdds) (with a\nfew exceptions).\n\nOnce RTI Connext DDS 6.x is installed, you can clone an build all required\npackages in a single workspace using one of the provided `.repos` files:\n\n```sh\n# Load your ROS installation, e.g. Foxy.\nsource /opt/ros/foxy/setup.bash\n\n# Load RTI Connext DDS 6.x\n# Replace \u003cNDDSHOME\u003e with your installation path, e.g. ${HOME}/rti_connext_dds-6.0.1\n# Replace \u003cARCH\u003e with the name of the installed target libraries, e.g. x64Linux4gcc7.3.0\nsource \u003cNDDSHOME\u003e/resource/scripts/rtisetenv_\u003cARCH\u003e.bash\n\n# Create a workspace and enter it\nmkdir -p ws-connext/src\n\ncd ws-connext\n\n# Clone all required repositories using the included repos file\nwget https://raw.githubusercontent.com/asorbini/rticonnextdds-ros2-demos/master/foxy.repos\nvcs import src \u003c foxy.repos\n\n# If you have multiple target libraries installed you might need to select the\n# desired one with `--cmake-args -DCONNEXTDDS_ARCH=\u003cARCH\u003e`.\ncolcon build --symlink-install\n```\n\nIf your installation contains a binary version of `rmw_connextdds` built with\nConnext 5.3.1, you should `unset` variables `CONNEXTDDS_DIR`, `CONNEXTDDS_ARCH`,\nand `NDDSHOME` before loading the Connext 6.x installation, to make sure that\nthe older version will not be picked up by `colcon build`, e.g. if using a \nbinary Rolling installation with `rmw_connextdds` already installed:\n\n```sh\nsource /opt/ros/rolling/setup.bash\n\nunset CONNEXTDDS_DIR \\\n      CONNEXTDDS_ARCH \\\n      NDDSHOME\n\nsource \u003cNDDSHOME\u003e/resource/scripts/rtisetenv_\u003cARCH\u003e.bash\n\n...\n```\n\n## Run examples\n\nSome examples are built as stand-alone executables, and they must be run directly,\nwhile other examples are provided as `rclcpp` components that can be run with\n`ros2 run`. All examples must be run with `rmw_connextdds` as the RMW implementation:\n\n```sh\nsource ws-connext/install/setup.bash\n\nexport RMW_IMPLEMENTATION=rmw_connextdds\n\n# Run a component-ized example\nros2 run connext_nodes_cpp listener\n\n# Run a stand-alone example\n./ws-connext/install/connext_nodes_cpp/bin/talker_main\n```\n\n## Included examples\n\nThis package contains several example ROS 2/Connext hybrid applications.\n\nMost examples are available both as a stand-alone executable and as an `rclcpp`\ncomponent. When built as a stand-alone executable, the generated binary will\nuse the `_main` suffix to differentiate it from the \"component-ized\" version.\n\n### talker/listener\n\n[Source code](connext_nodes_cpp/src/chatter)\n\nThese examples mimic the `talker` and `listener` applications included in package\n`demo_nodes_cpp`, but they use the RTI Connext DDS C++11 API to create DDS endpoint\nthat can interoperate over the ROS 2 topic `\"chatter\"`.\n\nThe endpoints are created reusing the type definition of `std_msgs::msg::String``\nautomatically converted from ROS IDL to OMG IDL by the ROS 2 build process.\n\n| Example | Description   |\n|---------|---------------|\n|[talker.cpp](connext_nodes_cpp/src/chatter/talker.cpp)| Connext-based version of [demo_nodes_cpp/src/topics/talker.cpp](https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/topics/talker.cpp)|\n|[listener.cpp](connext_nodes_cpp/src/chatter/listener.cpp)| Connext-based version of [demo_nodes_cpp/src/topics/listener.cpp](https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/topics/listener.cpp)|\n|[talker_main.cpp](connext_nodes_cpp/src/standalone/talker_main.cpp)| Stand-alone version of [talker.cpp](connext_nodes_cpp/src/chatter/talker.cpp)|\n|[listener_main.cpp](connext_nodes_cpp/src/standalone/listener_main.cpp)| Stand-alone version of [listener.cpp](connext_nodes_cpp/src/chatter/listener.cpp)|\n\n*Example usage:*\n\n```sh\n# Start a DDS talker on topic \"chatter\"\nros2 run connext_nodes_cpp talker\n\n# Consume data with a ROS 2 listener\nros2 run demo_nodes_cpp listener\n```\n\n### camera\n\n[Source code](connext_nodes_cpp/src/camera)\n\nThis example demonstrates the benefits of *Zero Copy Transfer over Shared Memory*\n(Zero-Copy), and *FlatData Language Binding* (Flat-Data) features provided by\nRTI Connext DDS.\n\nThe examples perform a simple latency test between a publisher and a subscriber\napplications using large data samples exchanged in a \"ping/pong\" fashion.\nThe computed roundtrip time is halved and a running average will be printed\nperiodically while the test is being performed.\n\nThe testers applications are provided in different variants, each one using a\ndifferent memory binding (plain, or Flat-Data), and a different transfer method\n(default, or Zero-Copy). Each version can communicate with all the others,\nregardless of enabled features, but the resulting performance will depend on\nruntime negotiation, and compatibility of available features.\n\nFor example, a Zero-Copy subscriber will be able to receive samples from a\nnon Zero-Copy writer, but communication will be carried out using the default\ntransfer method. Similarly, a Flat-Data/Zero-Copy endpoint may communicate with a\nZero-Copy endpoint, but the different memory representations will prevent\nsome optimizations from being enabled.\n\nThe applications are based on some helper classes from the `connext_node_helpers`\npackage. These classes are implemented as generics in order to allow them to be\nused with any DDS type:\n\n- [`rti::ros2::ping::PingPongPublisher`](https://github.com/asorbini/rticonnextdds-ros2-helpers/blob/master/connext_node_helpers/include/rti/ros2/ping/publisher.hpp)\n- [`rti::ros2::ping::PingPongSubscriber`](https://github.com/asorbini/rticonnextdds-ros2-helpers/blob/master/connext_node_helpers/include/rti/ros2/ping/subscriber.hpp)\n- [`rti::ros2::ping::PingPongTester`](https://github.com/asorbini/rticonnextdds-ros2-helpers/blob/master/connext_node_helpers/include/rti/ros2/ping/tester.hpp)  \n\nIn addition to the each concrete implementation of the `CameraImage` tester,\ntwo additional, generic, implementations are also included, which use C++\nmeta-programming to make the code independent of data binding and transfer\nmethods. See:\n  - [`rti::connext_nodes_cpp::camera::CameraImagePublisher`](connext_nodes_cpp/include/connext_nodes/camera/CameraImagePublisher.hpp)\n  - [`rti::connext_nodes_cpp::camera::CameraImageSubscriber`](connext_nodes_cpp/include/connext_nodes/camera/CameraImageSubscriber.hpp)\n  - [`rti/ros2/data/access.hpp`](https://github.com/asorbini/rticonnextdds-ros2-helpers/blob/master/connext_node_helpers/include/rti/ros2/data/access.hpp)\n  - [`rti/ros2/data/memory.hpp`](https://github.com/asorbini/rticonnextdds-ros2-helpers/blob/master/connext_node_helpers/include/rti/ros2/data/memory.hpp)\n\nThese examples are based on the\n[`flat_data_latency`](https://github.com/rticommunity/rticonnextdds-examples/tree/master/examples/connext_dds/flat_data_latency/)\nexample from the [rticommunity/rticonnextdds-examples](https://github.com/rticommunity/rticonnextdds-examples)\nrepository.\n\nContrary to example `flat_data_latency`, these application use topics `\"rt/ping\"`,\nand `\"rt/pong\"`, and register the topic type as `PingMessage`. Additionally, they\nhave been modified to use transient local durability.\n\nThe applications from `flat_data_latency`, modified to interoperate with these\nROS 2 equivalents are include under [`connext_nodes_cpp/src/camera/dds`](connext_nodes_cpp/src/camera/dds).\n\n| Example | Description |\n|---------|-------------|\n|[camera_pub_plain.cpp](connext_nodes_cpp/src/camera/camera_pub_plain.cpp) | Publisher using plain memory representation, and default transport |\n|[camera_pub_flat.cpp](connext_nodes_cpp/src/camera/camera_pub_flat.cpp) | Publisher using Flat-Data memory representation, and default transport |\n|[camera_pub_flat_zc.cpp](connext_nodes_cpp/src/camera/camera_pub_flat_zc.cpp) | Publisher using Flat-Data memory representation, and Zero-Copy transport |\n|[camera_pub_zc.cpp](connext_nodes_cpp/src/camera/camera_pub_zc.cpp) | Publisher using plain memory representation, and Zero-Copy transport |\n|[camera_sub_plain.cpp](connext_nodes_cpp/src/camera/camera_sub_plain.cpp) | Subscriber using plain memory representation, and default transport |\n|[camera_sub_flat.cpp](connext_nodes_cpp/src/camera/camera_sub_flat.cpp) | Subscriber using Flat-Data memory representation, and default transport |\n|[camera_sub_flat_zc.cpp](connext_nodes_cpp/src/camera/camera_sub_flat_zc.cpp) | Subscriber using Flat-Data memory representation, and Zero-Copy transport |\n|[camera_sub_zc.cpp](connext_nodes_cpp/src/camera/camera_sub_zc.cpp) | Subscriber using plain memory representation, and Zero-Copy transport |\n|[dds_camera_pub_main.cpp](connext_nodes_cpp/src/camera/dds/dds_camera_pub_main.cpp) | Ported version of the publisher application from the `flat_data_latency` example.|\n|[dds_camera_sub_main.cpp](connext_nodes_cpp/src/camera/dds/dds_camera_sub_main.cpp) | Ported version of the subscriber application from the `flat_data_latency` example.|\n\n*Example usage:*\n\n- Slow: [Plain, Default] to [Plain, Default]\n\n```sh\nros2 run connext_nodes_cpp camera_pub_plain\n\nros2 run connext_nodes_cpp camera_sub_plain\n```\n\n- Slow: [Flat-Data, Default] to [Flat-Data, Default]\n\n```sh\nros2 run connext_nodes_cpp camera_pub_flat\n\nros2 run connext_nodes_cpp camera_sub_flat\n```\n\n- Fast: [Plain, Zero-Copy] to [Plain, Zero-Copy]\n\n```sh\nros2 run connext_nodes_cpp camera_pub_zc\n\nros2 run connext_nodes_cpp camera_sub_zc\n```\n\n- Fast: [Flat-Data, Zero-Copy] to [Flat-Data, Zero-Copy]\n\n```sh\nros2 run connext_nodes_cpp camera_pub_flat_zc\n\nros2 run connext_nodes_cpp camera_sub_flat_zc\n```\n\n## Other useful resources\n\n- [`rticonnextdds-ros2-helpers`](https://github.com/asorbini/rticonnextdds-ros2-helpers)\n  - Collection of utilities to built ROS 2 applications with RTI Connext DDS.\n    Used extensively by the demos in this repository.\n- [`rticonnextdds-ros2-msgs`](https://github.com/asorbini/rticonnextdds-ros2-msgs)\n  - Helper library containing C++11 message type supports generated with\n   `rtiddsgen` for almost every type include in ROS","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasorbini%2Frticonnextdds-ros2-demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasorbini%2Frticonnextdds-ros2-demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasorbini%2Frticonnextdds-ros2-demos/lists"}