Skip to content

Commit d200408

Browse files
authored
[ros2controlcli] fix list_controllers when no controllers are loaded (ros-controls#1721)
1 parent 6890308 commit d200408

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ros2controlcli/ros2controlcli/verb/list_controllers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def main(self, *, args):
9898
with NodeStrategy(args) as node:
9999
response = list_controllers(node, args.controller_manager)
100100

101+
if not response.controller:
102+
print("No controllers are currently loaded!")
103+
return 0
104+
101105
# Structure data as table for nicer output
102106
col_width_name = max(len(ctrl.name) for ctrl in response.controller)
103107
col_width_type = max(len(ctrl.type) for ctrl in response.controller)

0 commit comments

Comments
 (0)