Skip to content

Commit

Permalink
[ros2controlcli] fix list_controllers when no controllers are loaded (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 30, 2024
1 parent caa242f commit 4659d58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ros2controlcli/ros2controlcli/verb/list_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4659d58

Please sign in to comment.