Skip to content

Commit

Permalink
check if the activate and deactivate list is empty after all the checks
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed May 14, 2023
1 parent 8f22b4f commit f5c66ef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,14 @@ controller_interface::return_type ControllerManager::switch_controller(
}
}

// Check after the check if the activate and deactivate list is empty or not
if (activate_request_.empty() && deactivate_request_.empty())
{
RCLCPP_INFO(get_logger(), "Empty activate and deactivate list, not requesting switch");
clear_requests();
return controller_interface::return_type::OK;
}

for (const auto & controller : controllers)
{
auto to_chained_mode_list_it = std::find(
Expand Down

0 comments on commit f5c66ef

Please sign in to comment.