Skip to content
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

Merged
merged 1 commit into from
Dec 4, 2017

Conversation

dhood
Copy link
Member

@dhood dhood commented Dec 3, 2017

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.

@dhood dhood self-assigned this Dec 3, 2017
@dhood dhood added the in progress Actively being worked on (Kanban column) label Dec 3, 2017
@dhood
Copy link
Member Author

dhood commented Dec 3, 2017

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.

@dhood
Copy link
Member Author

dhood commented Dec 3, 2017

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,
Copy link
Member Author

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

Copy link
Member

@wjwwood wjwwood left a 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.

@dhood dhood added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Dec 3, 2017
@dhood
Copy link
Member Author

dhood commented Dec 3, 2017

yeah, but waffle doesn't propagate the label to connected tickets sometimes

@dhood dhood merged commit 8177771 into master Dec 4, 2017
@dhood dhood deleted the parameter_client_constructor branch December 4, 2017 01:12
@dhood dhood removed the in review Waiting for review (Kanban column) label Dec 4, 2017
dhood added a commit to ros2/system_tests that referenced this pull request Dec 4, 2017
dhood added a commit to ros2/system_tests that referenced this pull request Dec 4, 2017
* 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
nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants