Skip to content

Commit

Permalink
If the controller activation fails then release the claimed interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Apr 29, 2024
1 parent 17bb7a2 commit 77e932e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,10 +1508,13 @@ void ControllerManager::activate_controllers(
{
RCLCPP_ERROR(
get_logger(),
"After activation, controller '%s' is in state '%s' (%d), expected '%s' (%d).",
"After activation, controller '%s' is in state '%s' (%d), expected '%s' (%d). Releasing "
"interfaces!",
controller->get_node()->get_name(), new_state.label().c_str(), new_state.id(),
hardware_interface::lifecycle_state_names::ACTIVE,
lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE);
controller->release_interfaces();
return;
}

// if it is a chainable controller, make the reference interfaces available on activation
Expand Down

0 comments on commit 77e932e

Please sign in to comment.