diff --git a/controller_interface/src/controller_interface_base.cpp b/controller_interface/src/controller_interface_base.cpp index 63a8c061f5..4031e2a497 100644 --- a/controller_interface/src/controller_interface_base.cpp +++ b/controller_interface/src/controller_interface_base.cpp @@ -58,15 +58,8 @@ return_type ControllerInterfaceBase::init( node_->register_on_cleanup( std::bind(&ControllerInterfaceBase::on_cleanup, this, std::placeholders::_1)); - auto activate_callback = [this](const rclcpp_lifecycle::State & state) - { - if (is_async() && async_handler_) - { - async_handler_->start_async_update_thread(); - } - return on_activate(state); - }; - node_->register_on_activate(activate_callback); + node_->register_on_activate( + std::bind(&ControllerInterfaceBase::on_activate, this, std::placeholders::_1)); node_->register_on_deactivate( std::bind(&ControllerInterfaceBase::on_deactivate, this, std::placeholders::_1)); @@ -102,6 +95,7 @@ const rclcpp_lifecycle::State & ControllerInterfaceBase::configure() std::bind(&ControllerInterfaceBase::get_state, this), std::bind( &ControllerInterfaceBase::update, this, std::placeholders::_1, std::placeholders::_2)); + async_handler_->start_async_update_thread(); } return get_node()->configure();