rclpy_ok and rclpy_create_context to pybind11#691
Merged
Conversation
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>
34 tasks
Contributor
Author
cottsay
approved these changes
Mar 2, 2021
| throw std::bad_alloc(); | ||
| } | ||
| *context = rcl_get_zero_initialized_context(); | ||
| PyObject * capsule = rclpy_create_handle_capsule( |
Member
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts two
rcl_context_tfunctions 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
rclpya little closer to using pybind11 everywhere.