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

Use default on_activate()/on_deactivate implemenetation of Node #552

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions lifecycle/src/lifecycle_talker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ class LifecycleTalker : public rclcpp_lifecycle::LifecycleNode
* TRANSITION_CALLBACK_ERROR or any uncaught exceptions to "errorprocessing"
*/
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
on_activate(const rclcpp_lifecycle::State &)
on_activate(const rclcpp_lifecycle::State & state)
{
// We explicitly activate the lifecycle publisher.
// Starting from this point, all messages are no longer
// ignored but sent into the network.
pub_->on_activate();
// The parent class method automatically transition on managed entities
// (currently, LifecyclePublisher).
// pub_->on_activate() could also be called manually here.
// Overriding this method is optional, a lot of times the default is enough.
LifecycleNode::on_activate(state);
ivanpauno marked this conversation as resolved.
Show resolved Hide resolved

RCUTILS_LOG_INFO_NAMED(get_name(), "on_activate() is called.");

Expand Down Expand Up @@ -179,12 +180,13 @@ class LifecycleTalker : public rclcpp_lifecycle::LifecycleNode
* TRANSITION_CALLBACK_ERROR or any uncaught exceptions to "errorprocessing"
*/
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
on_deactivate(const rclcpp_lifecycle::State &)
on_deactivate(const rclcpp_lifecycle::State & state)
{
// We explicitly deactivate the lifecycle publisher.
// Starting from this point, all messages are no longer
// sent into the network.
pub_->on_deactivate();
// The parent class method automatically transition on managed entities
// (currently, LifecyclePublisher).
// pub_->on_deactivate() could also be called manually here.
// Overriding this method is optional, a lot of times the default is enough.
LifecycleNode::on_deactivate(state);

RCUTILS_LOG_INFO_NAMED(get_name(), "on_deactivate() is called.");

Expand Down