Skip to content

Commit

Permalink
Add the condition to skip the non-configured controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Jun 28, 2023
1 parent 8ecd9fd commit 093a048
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ std::vector<std::string> get_following_controller_names(

return following_controllers;
}
// If the controller is not configured, return empty
if (!(is_controller_active(controller_it->c) || is_controller_inactive(controller_it->c)))
return following_controllers;
const auto cmd_itfs = controller_it->c->command_interface_configuration().names;
for (const auto & itf : cmd_itfs)
{
Expand Down Expand Up @@ -198,6 +201,9 @@ std::vector<std::string> get_preceding_controller_names(
}
for (const auto & ctrl : controllers)
{
// If the controller is not configured, return empty
if (!(is_controller_active(ctrl.c) || is_controller_inactive(ctrl.c)))
return preceding_controllers;
auto cmd_itfs = ctrl.c->command_interface_configuration().names;
for (const auto & itf : cmd_itfs)
{
Expand Down

0 comments on commit 093a048

Please sign in to comment.