Skip to content

Convert wait_set functions to pybind11#706

Merged
sloretz merged 5 commits intomasterfrom
pybind11_waitset
Mar 11, 2021
Merged

Convert wait_set functions to pybind11#706
sloretz merged 5 commits intomasterfrom
pybind11_waitset

Conversation

@sloretz
Copy link
Copy Markdown
Contributor

@sloretz sloretz commented Mar 10, 2021

Part of #665

This also replaces rclpy_destroy_wait_set and rclpy.executors._WaitSet with a pycapsule destructor.

@sloretz sloretz self-assigned this Mar 10, 2021
@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 10, 2021

CI (build: --packages-up-to rclpy test: --packages-select rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Comment on lines -524 to +514
with _WaitSet() as wait_set, ExitStack() as context_stack:
wait_set = _rclpy.rclpy_get_zero_initialized_wait_set()
with ExitStack() as context_stack:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now that the GC can destroy the wait set when it pleases, are there any dependencies between the wait set and the entities that we need to handle?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

None that needs to be handled by the wait set. context_stack makes sure the entities in the wait set stay alive until rcl_wait() finishes. After that it's totally fine to fini the wait set even if entities no longer exist because it doesn't do anything with those pointers.

sloretz added 3 commits March 10, 2021 09:24
Replaces rclpy_destroy_wait_set with pycapsule destructor for the rcl_wait_set_t type.

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 10, 2021

CI (build: --packages-up-to rclpy test: --packages-select rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz sloretz mentioned this pull request Mar 10, 2021
34 tasks
sloretz added 2 commits March 10, 2021 14:27
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 10, 2021

CI (build: --packages-up-to rclpy test: --packages-select rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz sloretz requested review from azeey and cottsay March 11, 2021 16:07
@sloretz sloretz merged commit 49f2b1f into master Mar 11, 2021
@delete-merged-branch delete-merged-branch bot deleted the pybind11_waitset branch March 11, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants