-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert rcl_params_t to ParameterMap #485
Conversation
{ | ||
|
||
/// Indicate `rcl_params_t` is or invalid. | ||
class InvalidParametersException : public std::exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exception type should be moved to rclcpp/exceptions.hpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved plus inherit from runtime_error in b415df7
Adds rclcpp::parameter_map_from(const rcl_params_t * const) Adds rclcpp::parameter_value_from(const rcl_variant_t * const) Adds dependency on rcl_yaml_param_parser
85ecbe3
to
94807c6
Compare
} | ||
|
||
/// make sure there is a leading slash on the fully qualified node name | ||
std::string node_name("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this here for now 👍
It may be better (in the future) to enforce this at a lower level.
It could be done in the parser:
- reject node_namespace + node_name not starting with a leading slash
- add the leading slash to any provided node_namespace + node_name that doesnt have one
If the structure always assumes fully qualified name, I guess we could enforce this it in the structure itself by providing structure functions to assign element and reject or add leading slash to the provided node names. This would allow other users of the structure to not have to duplicate that logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger. I wasn't sure if I should make a bug on rcl_yaml_param_parser
about it returning names without a leading slash, or if there will one day be a use case for that (like pushing nodes up a namespace in ros2 launch?). Thanks for the reviews!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks @sloretz
PR complete, waiting for #481 to be merged first, then this needs to be targeted atReady to reviewmaster
.This allows the initial parameter values for a node to be passed in via it's constructor. These parameters are then immediately set on the node.
edit: invoked CI wrong, will wait to run until #481 is in.blocks #477
requires #481