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 13
13
# limitations under the License.
14
14
15
15
from controller_manager import list_controllers
16
+ from controller_manager .spawner import bcolors
16
17
17
18
from ros2cli .node .direct import add_arguments
18
19
from ros2cli .node .strategy import NodeStrategy
22
23
23
24
24
25
def 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 } " )
26
35
if args .claimed_interfaces or args .verbose :
27
36
print ("\t claimed interfaces:" )
28
37
for claimed_interface in c .claimed_interfaces :
You can’t perform that action at this time.
0 commit comments