Skip to content

Commit bc84cf6

Browse files
committed
Return error is chained controller does not export any interfaces
1 parent 4a925ed commit bc84cf6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

controller_manager/src/controller_manager.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,17 @@ controller_interface::return_type ControllerManager::configure_controller(
454454
"Controller '%s' is chainable. Interfaces are being exported to resource manager.",
455455
controller_name.c_str());
456456
auto interfaces = controller->export_reference_interfaces();
457+
if (interfaces.empty())
458+
{
459+
// TODO(destogl): Add test for this!
460+
RCLCPP_ERROR(
461+
get_logger(), "Controller '%s' is chainable, but does not export any reference interfaces.",
462+
controller_name.c_str());
463+
return controller_interface::return_type::ERROR;
464+
}
457465
resource_manager_->import_controller_reference_interfaces(controller_name, interfaces);
458466

459-
// check and resort controllers in the vector
467+
// TODO(destogl): check and resort controllers in the vector
460468
}
461469

462470
return controller_interface::return_type::OK;
@@ -856,7 +864,7 @@ controller_interface::return_type ControllerManager::switch_controller(
856864
RCLCPP_WARN(
857865
get_logger(),
858866
"Could not deactivate controller with name '%s' because "
859-
"preceding controller with name '%s' is inactive and will not be deactivated.",
867+
"preceding controller with name '%s' is active and will not be deactivated.",
860868
controller_it->info.name.c_str(), preceding_ctrl_it->info.name.c_str());
861869
return controller_interface::return_type::ERROR;
862870
}

0 commit comments

Comments
 (0)