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
…1721)

(cherry picked from commit d200408)
  • Loading branch information
saikishor authored and mergify[bot] committed Aug 27, 2024
1 parent 9eb64ad commit 4558197
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 4558197

Please sign in to comment.