Skip to content

LifecycleNode::on_deactivate activate the publisher #1884

@vincentrou

Description

@vincentrou

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • rolling

Steps to reproduce issue

LNI::CallbackReturn PackageName::on_deactivate(const rclcpp_lifecycle::State& state)
{
  publisher_->on_deactivate();
  auto pub_activated_before = publisher_->is_activated();
  LifecycleNode::on_deactivate(state);
  auto pub_activated_after = publisher_->is_activated();
  return LNI::CallbackReturn::SUCCESS;
}

Expected behavior

In this snippet, pub_activated_before is false and pub_activated_after is true.

Actual behavior

In this snippet, pub_activated_before is false and pub_activated_after is false.

Additional information

It seems that on_activate and on_deactivate were inverted here

on_deactivate()
{
for (const auto & weak_entity : weak_managed_entities_) {
auto entity = weak_entity.lock();
if (entity) {
entity->on_activate();
}
}
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions