Repository navigation
Pybind11-ify rclpy_get_node_parameters - #718
Merged
Merged
Conversation
32 of 34 tasks
sloretz
force-pushed
the
pybind11_get_node_parameters
branch
2 times, most recently
from
March 22, 2021 18:36
ea81742 to
6115c35
Compare
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
sloretz
force-pushed
the
pybind11_get_node_parameters
branch
from
March 22, 2021 23:38
617ea3a to
a269aef
Compare
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
sloretz
marked this pull request as ready for review
March 23, 2021 16:47
Contributor
Author
hidmic
approved these changes
Mar 23, 2021
hidmic
left a comment
Contributor
There was a problem hiding this comment.
LGTM but for some minor comments !
| if (!pynode_params.contains(pynode_name)) { | ||
| pynode_params[pynode_name] = py::dict(); | ||
| } | ||
| auto parameter_dict = pynode_params[pynode_name].cast<py::dict>(); |
Contributor
There was a problem hiding this comment.
@sloretz nit^N: Python object wrappers can be cast implicitly:
Suggested change
| auto parameter_dict = pynode_params[pynode_name].cast<py::dict>(); | |
| py::dict parameter_dict = pynode_params[pynode_name]; |
| auto parameter_dict = pynode_params[pynode_name].cast<py::dict>(); | ||
|
|
||
| rcl_node_params_t node_params = params->params[i]; | ||
| for (size_t ii = 0; ii < node_params.num_params; ++ii) { |
|
|
||
| /// Get a list of parameters for the current node | ||
| /** | ||
| * On failure, an exception is raised and NULL is returned if: |
| { | ||
| rcl_params_t * params = nullptr; | ||
| if (RCL_RET_OK != rcl_arguments_get_param_overrides(args, ¶ms)) { | ||
| throw RCLError("failed to get parameter overrrides"); |
| * \param[in] pyparameter_cls The rclpy.parameter.Parameter class object. | ||
| * \param[in] node_capsule Capsule pointing to the node handle | ||
| * \return A dict mapping parameter names to rclpy.parameter.Parameter (may be empty). | ||
| */ |
| * On failure, an exception is raised and NULL is returned if: | ||
| * | ||
| * Raises ValueError if the argument is not a node handle. | ||
| * Raises RCLError if the parameters file fails to parse |
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Contributor
Author
Contributor
Author
|
CI LGTM, @hidmic may I ask you to double check that the changes address your feedback? |
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.
Part of #665