From 402bdd5da006e2f769243637600588d8991a60b1 Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Mon, 13 Feb 2023 15:56:06 -0600 Subject: [PATCH] Revert "Revert "adding API change for spin_until_complete (#3328)" (#3333)" This reverts commit e0ec7a7e3cd221efede978eb2a8655d6c2503800. --- source/Releases/Release-Iron-Irwini.rst | 7 +++++++ .../Contributing/Migration-Guide-Python.rst | 2 +- source/Tutorials/Advanced/FastDDS-Configuration.rst | 2 +- .../Beginner-Client-Libraries/Custom-ROS2-Interfaces.rst | 2 +- .../Writing-A-Simple-Cpp-Service-And-Client.rst | 2 +- .../Writing-A-Simple-Py-Service-And-Client.rst | 2 +- .../Writing-an-Action-Server-Client/scripts/client_0.py | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/Releases/Release-Iron-Irwini.rst b/source/Releases/Release-Iron-Irwini.rst index 52032323e7c..f7964a924cc 100644 --- a/source/Releases/Release-Iron-Irwini.rst +++ b/source/Releases/Release-Iron-Irwini.rst @@ -41,6 +41,13 @@ To come. New features in this ROS 2 release ---------------------------------- +Rename ``spin_until_future_complete`` to ``spin_until_complete`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +`PR 1874 `_ renames ``spin_until_future_complete`` to ``spin_until_complete`` to represent the semantics of being able to spin on values that are not exclusively futures. +The API can now spin until arbitrary conditions. +A deprecation warning will appear for migration. + ros2topic ^^^^^^^^^ diff --git a/source/The-ROS2-Project/Contributing/Migration-Guide-Python.rst b/source/The-ROS2-Project/Contributing/Migration-Guide-Python.rst index 058ddaae518..83fb23e4a07 100644 --- a/source/The-ROS2-Project/Contributing/Migration-Guide-Python.rst +++ b/source/The-ROS2-Project/Contributing/Migration-Guide-Python.rst @@ -121,4 +121,4 @@ In ROS 2: while not add_two_ints.wait_for_service(timeout_sec=1.0): node.get_logger().info('service not available, waiting again...') resp = add_two_ints.call_async(req) - rclpy.spin_until_future_complete(node, resp) + rclpy.spin_until_complete(node, resp) diff --git a/source/Tutorials/Advanced/FastDDS-Configuration.rst b/source/Tutorials/Advanced/FastDDS-Configuration.rst index 878bf9b9a8a..c5b742c04e0 100644 --- a/source/Tutorials/Advanced/FastDDS-Configuration.rst +++ b/source/Tutorials/Advanced/FastDDS-Configuration.rst @@ -679,7 +679,7 @@ Create the client in a file named ``src/ping_client.cpp`` with the following con auto result = client->async_send_request(request); // Wait for the result and log it to the console - if (rclcpp::spin_until_future_complete(node, result) == + if (rclcpp::spin_until_complete(node, result) == rclcpp::FutureReturnCode::SUCCESS) { RCLCPP_INFO(rclcpp::get_logger("ping_client"), "Response received"); diff --git a/source/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.rst b/source/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.rst index 26d17a9bed5..e93570ef884 100644 --- a/source/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.rst +++ b/source/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.rst @@ -647,7 +647,7 @@ Client: auto result = client->async_send_request(request); // Wait for the result. - if (rclcpp::spin_until_future_complete(node, result) == + if (rclcpp::spin_until_complete(node, result) == rclcpp::FutureReturnCode::SUCCESS) { RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "Sum: %ld", result.get()->sum); 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 fdef125f07f..c13d5b3a84d 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 @@ -228,7 +228,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) == + if (rclcpp::spin_until_complete(node, result) == rclcpp::FutureReturnCode::SUCCESS) { RCLCPP_INFO(rclcpp::get_logger("rclcpp"), "Sum: %ld", result.get()->sum); diff --git a/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Service-And-Client.rst b/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Service-And-Client.rst index 612881caae8..1aa0aa7bf67 100644 --- a/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Service-And-Client.rst +++ b/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Service-And-Client.rst @@ -197,7 +197,7 @@ Inside the ``ros2_ws/src/py_srvcli/py_srvcli`` directory, create a new file call self.req.a = a self.req.b = b self.future = self.cli.call_async(self.req) - rclpy.spin_until_future_complete(self, self.future) + rclpy.spin_until_complete(self, self.future) return self.future.result() diff --git a/source/Tutorials/Intermediate/Writing-an-Action-Server-Client/scripts/client_0.py b/source/Tutorials/Intermediate/Writing-an-Action-Server-Client/scripts/client_0.py index 7fb602d2e2a..f60779d9636 100644 --- a/source/Tutorials/Intermediate/Writing-an-Action-Server-Client/scripts/client_0.py +++ b/source/Tutorials/Intermediate/Writing-an-Action-Server-Client/scripts/client_0.py @@ -27,7 +27,7 @@ def main(args=None): future = action_client.send_goal(10) - rclpy.spin_until_future_complete(action_client, future) + rclpy.spin_until_complete(action_client, future) if __name__ == '__main__':