Skip to content

rclpy_ok and rclpy_create_context to pybind11#691

Merged
sloretz merged 1 commit intomasterfrom
pybind11_context_functions
Mar 2, 2021
Merged

rclpy_ok and rclpy_create_context to pybind11#691
sloretz merged 1 commit intomasterfrom
pybind11_context_functions

Conversation

@sloretz
Copy link
Copy Markdown
Contributor

@sloretz sloretz commented Mar 2, 2021

Converts two rcl_context_t functions to pybind11, keeping the C to Python API the same.
part of #665

Make a couple functions use pybind11. These ones didn't benefit too much in the short term, but it brings rclpy a little closer to using pybind11 everywhere.

Converts two context functions to pybind11, keeping the C API the same.

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
@sloretz sloretz requested a review from cottsay March 2, 2021 01:34
@sloretz sloretz self-assigned this Mar 2, 2021
@sloretz sloretz mentioned this pull request Mar 2, 2021
34 tasks
@sloretz
Copy link
Copy Markdown
Contributor Author

sloretz commented Mar 2, 2021

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

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

throw std::bad_alloc();
}
*context = rcl_get_zero_initialized_context();
PyObject * capsule = rclpy_create_handle_capsule(
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.

Totally out of scope for this PR, but would it make sense to make this function throw the exception once we're all moved over to Pybind11?

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.

As in, would it make sense to replace rclpy_create_handle_capsule() with something that throws an exception? If I understand the question correctly, once everything's converted to Pybind11 I think it would make sense to switch over to C++ classes since classes will replace the capsules altogether.

@sloretz sloretz merged commit 5b386e9 into master Mar 2, 2021
@sloretz sloretz deleted the pybind11_context_functions branch March 2, 2021 16:43
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.

2 participants