File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
ros2controlcli/ros2controlcli/verb Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515from controller_manager import list_controllers
16+ from controller_manager .spawner import bcolors
1617
1718from ros2cli .node .direct import add_arguments
1819from ros2cli .node .strategy import NodeStrategy
2223
2324
2425def print_controller_state (c , args ):
25- print (f"{ c .name :20s} [{ c .type :20s} ] { c .state :10s} " )
26+ state_color = ""
27+ if c .state == "active" :
28+ state_color = bcolors .OKGREEN
29+ elif c .state == "inactive" :
30+ state_color = bcolors .OKCYAN
31+ elif c .state == "unconfigured" :
32+ state_color = bcolors .WARNING
33+
34+ print (f"{ c .name :20s} [{ c .type :20s} ] { state_color } { c .state :10s} { bcolors .ENDC } " )
2635 if args .claimed_interfaces or args .verbose :
2736 print ("\t claimed interfaces:" )
2837 for claimed_interface in c .claimed_interfaces :
You can’t perform that action at this time.
0 commit comments