Pybind11-ify rclpy_get_node_parameters#718
Merged
Conversation
34 tasks
ea81742 to
6115c35
Compare
Signed-off-by: Shane Loretz <sloretz@osrfoundation.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>
617ea3a to
a269aef
Compare
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Contributor
Author
hidmic
approved these changes
Mar 23, 2021
Contributor
hidmic
left a comment
There was a problem hiding this comment.
LGTM but for some minor comments !
rclpy/src/rclpy/node.cpp
Outdated
| 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]; |
rclpy/src/rclpy/node.cpp
Outdated
| 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) { |
rclpy/src/rclpy/node.hpp
Outdated
|
|
||
| /// Get a list of parameters for the current node | ||
| /** | ||
| * On failure, an exception is raised and NULL is returned if: |
rclpy/src/rclpy/node.cpp
Outdated
| { | ||
| rcl_params_t * params = nullptr; | ||
| if (RCL_RET_OK != rcl_arguments_get_param_overrides(args, ¶ms)) { | ||
| throw RCLError("failed to get parameter overrrides"); |
rclpy/src/rclpy/node.cpp
Outdated
| * \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). | ||
| */ |
rclpy/src/rclpy/node.hpp
Outdated
| * 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 <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
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