Skip to content

Commit

Permalink
Fix a typo in Writing-A-Simple-Cpp-Service-And-Client.rst (#4934)
Browse files Browse the repository at this point in the history
Signed-off-by: Jihye Sofia Seo <9078892+jihyeseo@users.noreply.github.com>
(cherry picked from commit 3959d21)

# Conflicts:
#	source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.rst
  • Loading branch information
jihyeseo authored and mergify[bot] committed Jan 14, 2025
1 parent 857dcd4 commit 332e4f0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<rclcpp::Node> node = rclcpp::Node::make_shared("add_two_ints_client");
rclcpp::Client<example_interfaces::srv::AddTwoInts>::SharedPtr client =
Expand All @@ -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<AddTwoInts::Request>();
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);
Expand Down

0 comments on commit 332e4f0

Please sign in to comment.