-
Notifications
You must be signed in to change notification settings - Fork 418
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
Allow creating parameter client from constructor of Node subclass #413
Conversation
Example usage in https://github.com/ros2/demos/pull/203/files#diff-653dd97d51d2e5cbd57891eb644a8654R26 (note that the parameter server is still created after the node has been instantiated. We could make it possible from the constructor, but I was avoiding adding API we'd likely remove later on. |
I'm putting this into review because I've successfully tested ros2/demos#203 that makes use of this (see ros2/demos#203 (comment)) |
@@ -63,6 +63,12 @@ class AsyncParametersClient | |||
const std::string & remote_node_name = "", | |||
const rmw_qos_profile_t & qos_profile = rmw_qos_profile_parameters); | |||
|
|||
RCLCPP_PUBLIC | |||
AsyncParametersClient( | |||
rclcpp::node::Node * node, |
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.
note that this is not const
because things like node->get_node_base_interface()
are not
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.
lgtm, but is this in review? It appears to have the in progress label still.
yeah, but waffle doesn't propagate the label to connected tickets sometimes |
* Add regression test for set_parameters with callback * Make it like the parameter_events_async node to excercise the bad reference * Create paramters_client_ in constructor of node subclass Possible since ros2/rclcpp#413
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Closes #409
I only did this for parameter clients: parameter services still need to be created outside of the constructor, but this is not something that we expect users to have to do manually in the long term.