From 008750742f25dd0e73ecca1b0f267558227a9810 Mon Sep 17 00:00:00 2001 From: Jihye Sofia Seo <9078892+jihyeseo@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:05:33 +0100 Subject: [PATCH 1/2] Fix a typo in Writing-A-Simple-Cpp-Service-And-Client.rst (#4934) Signed-off-by: Jihye Sofia Seo <9078892+jihyeseo@users.noreply.github.com> (cherry picked from commit 3959d21c85453d4133089dcf793f903987339006) # Conflicts: # source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst --- .../Writing-A-Simple-Cpp-Service-And-Client.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst b/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst index 75cb8021cae..0d84fe75dfe 100644 --- a/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst +++ b/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst @@ -208,6 +208,7 @@ Inside the ``ros2_ws/src/cpp_srvcli/src`` directory, create a new file called `` RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "usage: add_two_ints_client X Y"); return 1; } +<<<<<<< HEAD std::shared_ptr node = rclcpp::Node::make_shared("add_two_ints_client"); rclcpp::Client::SharedPtr client = @@ -228,6 +229,13 @@ Inside the ``ros2_ws/src/cpp_srvcli/src`` directory, create a new file called `` auto result = client->async_send_request(request); // Wait for the result. if (rclcpp::spin_until_future_complete(node, result) == +======= + auto request = std::make_shared(); + request->a = 41; + request->b = 1; + auto result_future = client->async_send_request(request); + if (rclcpp::spin_until_future_complete(node, result_future) != +>>>>>>> 3959d21 (Fix a typo in Writing-A-Simple-Cpp-Service-And-Client.rst (#4934)) rclcpp::FutureReturnCode::SUCCESS) { RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "Sum: %ld", result.get()->sum); From 301a0bc9da605836774b40de667293d1ae42db2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Tue, 14 Jan 2025 10:25:02 +0100 Subject: [PATCH 2/2] Fix merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- .../Writing-A-Simple-Cpp-Service-And-Client.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst b/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst index 0d84fe75dfe..e2cf7f4a79b 100644 --- a/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst +++ b/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst @@ -208,7 +208,6 @@ Inside the ``ros2_ws/src/cpp_srvcli/src`` directory, create a new file called `` RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "usage: add_two_ints_client X Y"); return 1; } -<<<<<<< HEAD std::shared_ptr node = rclcpp::Node::make_shared("add_two_ints_client"); rclcpp::Client::SharedPtr client = @@ -228,14 +227,7 @@ Inside the ``ros2_ws/src/cpp_srvcli/src`` directory, create a new file called `` auto result = client->async_send_request(request); // Wait for the result. - if (rclcpp::spin_until_future_complete(node, result) == -======= - auto request = std::make_shared(); - request->a = 41; - request->b = 1; - auto result_future = client->async_send_request(request); - if (rclcpp::spin_until_future_complete(node, result_future) != ->>>>>>> 3959d21 (Fix a typo in Writing-A-Simple-Cpp-Service-And-Client.rst (#4934)) + if (rclcpp::spin_until_future_complete(node, result) != rclcpp::FutureReturnCode::SUCCESS) { RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "Sum: %ld", result.get()->sum);