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
saikishor committed Aug 27, 2024
1 parent 6890308 commit d200408
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 @@ -98,6 +98,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 d200408

Please sign in to comment.