Skip to content

Commit 77e932e

Browse files
committed
If the controller activation fails then release the claimed interfaces
1 parent 17bb7a2 commit 77e932e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

controller_manager/src/controller_manager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,10 +1508,13 @@ void ControllerManager::activate_controllers(
15081508
{
15091509
RCLCPP_ERROR(
15101510
get_logger(),
1511-
"After activation, controller '%s' is in state '%s' (%d), expected '%s' (%d).",
1511+
"After activation, controller '%s' is in state '%s' (%d), expected '%s' (%d). Releasing "
1512+
"interfaces!",
15121513
controller->get_node()->get_name(), new_state.label().c_str(), new_state.id(),
15131514
hardware_interface::lifecycle_state_names::ACTIVE,
15141515
lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE);
1516+
controller->release_interfaces();
1517+
return;
15151518
}
15161519

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

0 commit comments

Comments
 (0)