Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "adding API change for spin_until_complete"" #3334

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions source/Releases/Release-Iron-Irwini.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ To come.
New features in this ROS 2 release
----------------------------------

Rename ``spin_until_future_complete`` to ``spin_until_complete``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`PR 1874 <https://github.com/ros2/rclcpp/pull/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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SteveMacenski, should we mention ros2/rclcpp#1957 here instead?

Seeing that ros2/rclcpp#1874 was merged is what made me think this was ready to merge.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "revert revert" language in 1957 makes it less clear to a user. I'd think 1874 is a better link to understand the change, but I don't feel overly strong about it

The API can now spin until arbitrary conditions.
A deprecation warning will appear for migration.

ros2topic
^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion source/Tutorials/Advanced/FastDDS-Configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down