From 38693a057bb195003f7867e253fab522ecd69531 Mon Sep 17 00:00:00 2001 From: Bey Hao Yun Date: Tue, 24 Jan 2023 10:10:35 +0800 Subject: [PATCH 1/3] :heavy_plus_sign: :blue_book: Added slightly-elaborated README.md under demo_nodes_cpp_native. Require further elaboration. Signed-off-by: Bey Hao Yun --- demo_nodes_cpp_native/README.md | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 demo_nodes_cpp_native/README.md diff --git a/demo_nodes_cpp_native/README.md b/demo_nodes_cpp_native/README.md new file mode 100644 index 000000000..09c1887b0 --- /dev/null +++ b/demo_nodes_cpp_native/README.md @@ -0,0 +1,38 @@ +## **What Is This?** + +This demo ... + +## **Build** + +```bash +colcon build --packages-up-to demo_nodes_cpp_native +``` + +## **Run** + +```bash +ros2 run demo_nodes_cpp_native talker +``` + +## **Verify** + +When executed correctly, the following strings should be printed to the terminal similar to what is shown below: + +```bash +[INFO] [1674525877.083735645] [talker_native]: eprosima::fastdds::dds::DomainParticipant * 94193367466752 +[INFO] [1674525877.084105822] [talker_native]: eprosima::fastdds::dds::DataWriter * 94193370040688 +[INFO] [1674525877.584006930] [talker_native]: Publishing: 'Hello World: 1' +[INFO] [1674525878.083967966] [talker_native]: Publishing: 'Hello World: 2' +[INFO] [1674525878.583917242] [talker_native]: Publishing: 'Hello World: 3' +[INFO] [1674525879.083963276] [talker_native]: Publishing: 'Hello World: 4' +[INFO] [1674525879.583918839] [talker_native]: Publishing: 'Hello World: 5' +#... +``` + +## **FAQ** + +WIP + +## **References** + +1. From 9b94358035ac2c82591f35efb24cd1f600f2abca Mon Sep 17 00:00:00 2001 From: Bey Hao Yun Date: Tue, 24 Jan 2023 10:28:23 +0800 Subject: [PATCH 2/3] :hammer: Fully elaborated README.md under demo_nodes_cpp_native ROS2 package. Ready for review. Signed-off-by: Bey Hao Yun --- demo_nodes_cpp_native/README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/demo_nodes_cpp_native/README.md b/demo_nodes_cpp_native/README.md index 09c1887b0..baaf076d9 100644 --- a/demo_nodes_cpp_native/README.md +++ b/demo_nodes_cpp_native/README.md @@ -1,6 +1,6 @@ ## **What Is This?** -This demo ... +This demo provides an example of creating and running a ROS 2 node using the native **rmw_fastrtps_cpp** API directly, rather than doing so through vanilla **rclcpp**. ## **Build** @@ -31,8 +31,16 @@ When executed correctly, the following strings should be printed to the terminal ## **FAQ** -WIP +`Q`: Why use native `rmw_fastrtps_cpp` API directly, instead of using `rclcpp`? + +`A`: Doing so would allow for better fault isolation and debugging. However, it would be with the obvious drawback of having to include `rmw_fastrtps_cpp` dependency manually. + +`Q`: Is it still called `Fast RTPS`? + +`A`: No. `Fast RTPS` has been renamed to `Fast DDS` since `ROS 2 Foxy`. ## **References** -1. +1. [Fast DDS](https://www.eprosima.com/index.php/products-all/eprosima-fast-dds) +2. [What Is RTPS?](https://www.eprosima.com/index.php/resources-all/whitepapers/rtps) +3. [Fast RTPS Becomes Fast DDS in Foxy](https://discourse.ros.org/t/fast-rtps-becomes-fast-dds-in-foxy/15020/2) From 73e495f4cc9e5517ea7497306d4fd3807d0bd0e5 Mon Sep 17 00:00:00 2001 From: Bey Hao Yun Date: Fri, 27 Jan 2023 14:13:12 +0800 Subject: [PATCH 3/3] :hammer: Updated draft README.md with better understanding of rmw_fastrtps_cpp sample and feedback. Signed-off-by: Bey Hao Yun --- demo_nodes_cpp_native/README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/demo_nodes_cpp_native/README.md b/demo_nodes_cpp_native/README.md index baaf076d9..c9cc2c0b1 100644 --- a/demo_nodes_cpp_native/README.md +++ b/demo_nodes_cpp_native/README.md @@ -1,6 +1,12 @@ ## **What Is This?** -This demo provides an example of creating and running a ROS 2 node using the native **rmw_fastrtps_cpp** API directly, rather than doing so through vanilla **rclcpp**. +This demo provides an example of further **Quality-Of-Service (QoS) configurability** as well as **Publication Modes** in a ROS 2 node via the use of `rmw_fastrtps_cpp` Application Programming Interface (API). + +The example utilitises `eprosima::fastdds::statistics::dds::DomainParticipant` as well as `eprosima::fastdds::dds::DataWriter`. + +A `DomainParticipant` defines a singular working unit which groups a set of **Publishers** and **Subscribers** together. See **References - DomainParticipant** for more details. + +A `DataWriter` is created by a **Publisher** and writes data to a topic with configurable behaviors. See **References - DataWriter** for more details. ## **Build** @@ -31,9 +37,19 @@ When executed correctly, the following strings should be printed to the terminal ## **FAQ** -`Q`: Why use native `rmw_fastrtps_cpp` API directly, instead of using `rclcpp`? +`Q`: Why use `rmw_fastrtps_cpp` API directly? + +`A`: ROS 2 only allows for the configuration of certain middleware QoS (see [ROS 2 QoS policies](https://docs.ros.org/en/foxy/Concepts/About-Quality-of-Service-Settings.html#qos-policies)). In addition to ROS 2 QoS policies, `rmw_fastrtps` sets two more **Fast DDS** configurable parameters: + +>**History memory policy**: `PREALLOCATED_WITH_REALLOC_MEMORY_MODE` + +>**Publication mode**: `ASYNCHRONOUS_PUBLISH_MODE` + +In addition, `rmw_fastrtps` offers the possibility to further configure **Fast DDS**: + +>[Change publication mode](https://github.com/ros2/rmw_fastrtps#change-publication-mode) -`A`: Doing so would allow for better fault isolation and debugging. However, it would be with the obvious drawback of having to include `rmw_fastrtps_cpp` dependency manually. +>[Full QoS configuration](https://github.com/ros2/rmw_fastrtps#full-qos-configuration) `Q`: Is it still called `Fast RTPS`? @@ -44,3 +60,6 @@ When executed correctly, the following strings should be printed to the terminal 1. [Fast DDS](https://www.eprosima.com/index.php/products-all/eprosima-fast-dds) 2. [What Is RTPS?](https://www.eprosima.com/index.php/resources-all/whitepapers/rtps) 3. [Fast RTPS Becomes Fast DDS in Foxy](https://discourse.ros.org/t/fast-rtps-becomes-fast-dds-in-foxy/15020/2) +4. [Advanced Usage](https://github.com/ros2/rmw_fastrtps#advance-usage) +5. [DomainParticipant](https://fast-dds.docs.eprosima.com/en/latest/fastdds/api_reference/dds_pim/domain/domainparticipant.html) +6. [DataWriter](https://fast-dds.docs.eprosima.com/en/latest/fastdds/api_reference/dds_pim/publisher/datawriter.html#datawriter)