Skip to content

Commit

Permalink
Merge branch 'humble' into mergify/bp/humble/pr-1413
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagyar committed Mar 1, 2024
2 parents e16947f + e3391da commit 28e8f4f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ros2controlcli/ros2controlcli/verb/list_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from controller_manager import list_controllers
from controller_manager.spawner import bcolors

from ros2cli.node.direct import add_arguments
from ros2cli.node.strategy import NodeStrategy
Expand All @@ -22,7 +23,15 @@


def print_controller_state(c, args):
print(f"{c.name:20s}[{c.type:20s}] {c.state:10s}")
state_color = ""
if c.state == "active":
state_color = bcolors.OKGREEN
elif c.state == "inactive":
state_color = bcolors.OKCYAN
elif c.state == "unconfigured":
state_color = bcolors.WARNING

print(f"{c.name:20s}[{c.type:20s}] {state_color}{c.state:10s}{bcolors.ENDC}")
if args.claimed_interfaces or args.verbose:
print("\tclaimed interfaces:")
for claimed_interface in c.claimed_interfaces:
Expand Down

0 comments on commit 28e8f4f

Please sign in to comment.