-
Notifications
You must be signed in to change notification settings - Fork 427
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
Parameters in LifecycleNodes #855
Comments
Hello, Any news on this issue? I am still unable to declare the parameter server in Lifecycle nodes and that is becoming problematic as this is an important feature. One workaround would be to declare a service for each parameters but it is bit tedious. Thanks in advance. |
i guess that is related to #898, the problem is that we have separated classes rclcpp::Node and rclcpp_lifecycle::LifercycleNode. but i believe that rclcpp_lifecycle::LifercycleNode is built on top of rclcpp::Node. so rclcpp_lifecycle::LifecycleNode Class inherits based on rclcpp::Node and featured with lifecycle interfaces. |
I noticed this problem and began to deal with it these days. As @buschbapti metioned, we can extend the constructor SyncParametersClient(...) to accept not only rclcpp::Node. Just like the way this file handled. It is easy to implement. If you want the rclcpp_lifecycle::LifecycleNode as parameter of constructor SyncParametersClient(...), just to be consistent with the original constructor that rclcpp::Node takes as an argument. Need to do more work. Here are some thoughts.
Any thoughts on this ? |
Hi all,
I am trying to add parameters to a node following the demo at https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/parameters/set_and_get_parameters.cpp
Problem is, the node is based on the Lyfecycle interface and I suspect rclcpp::SyncParametersClient does not accept them yet. I have seen that this problem appears in multiple other places as the NodeInterface is not yet fully integrated (see
ros-perception/image_common#108 for example)
For reference, the code I use is:
where
this
extends fromrclcpp_lifecycle::LifecycleNode
. I have also tried withstd::make_shared<rclcpp::SyncParametersClient>(this->shared_from_this());
in vain. The error is listed as follow:which makes me suggest it is the same problem as ros-perception/image_common#108
Thanks in advance for your support.
EDIT
After looking closely at the constructors for
rclcpp::SyncParametersClient
it seems that therclcpp::node_interfaces::NodeBaseInterface::SharedPtr
is partially integrated, i.e. only when passing arclcpp::executor::Executor::SharedPtr
along with it. This means we should be able to initialize the parameters_client outside of the node class.Could it be possible to extend the Constructor
to accept a
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr
and not only arclcpp::Node::SharedPtr
?The text was updated successfully, but these errors were encountered: