diff --git a/ros2controlcli/ros2controlcli/verb/list_controllers.py b/ros2controlcli/ros2controlcli/verb/list_controllers.py index a26a1168a1..8367900cd5 100644 --- a/ros2controlcli/ros2controlcli/verb/list_controllers.py +++ b/ros2controlcli/ros2controlcli/verb/list_controllers.py @@ -99,6 +99,10 @@ def main(self, *, args): with NodeStrategy(args) as node: response = list_controllers(node, args.controller_manager) + if not response.controller: + print("No controllers are currently loaded!") + return 0 + # Structure data as table for nicer output col_width_name = max(len(ctrl.name) for ctrl in response.controller) col_width_type = max(len(ctrl.type) for ctrl in response.controller)