@@ -75,16 +75,24 @@ def change_thruster_status(self, thruster, value):
75
75
parameter .name = 'SERVO' + thruster + '_FUNCTION'
76
76
parameter .value .type = ParameterType .PARAMETER_INTEGER
77
77
78
+ status_msg = DiagnosticStatus ()
79
+
78
80
print_status = ''
81
+ # Publishing two values for backward compability
79
82
diagnostic_value = ''
83
+ diagnostic_value_2 = ''
80
84
if value == 'failure' :
81
85
parameter .value .integer_value = 0
82
86
print_status = 'failed'
83
87
diagnostic_value = 'FALSE'
88
+ diagnostic_value_2 = 'ERROR'
89
+ status_msg .level = DiagnosticStatus .ERROR
84
90
elif value == 'recovery' :
85
91
parameter .value .integer_value = int (thruster ) + 32
86
92
print_status = 'recovered'
87
93
diagnostic_value = 'RECOVERED'
94
+ diagnostic_value_2 = 'OK'
95
+ status_msg .level = DiagnosticStatus .OK
88
96
else :
89
97
self .get_logger ().info (
90
98
'Wrong event value: {}. ' .format (value ) +
@@ -101,11 +109,15 @@ def change_thruster_status(self, thruster, value):
101
109
key_value .key = 'c_thruster_{}' .format (thruster )
102
110
key_value .value = diagnostic_value
103
111
104
- status_msg = DiagnosticStatus ()
105
- status_msg .level = DiagnosticStatus .OK
106
- status_msg .name = ''
112
+ key_value_2 = KeyValue ()
113
+ key_value_2 .key = 'c_thruster_{}' .format (thruster )
114
+ key_value_2 .value = diagnostic_value_2
115
+
116
+
117
+ status_msg .name = 'thruster_monitor: Thruster status'
107
118
status_msg .message = 'Component status'
108
119
status_msg .values .append (key_value )
120
+ status_msg .values .append (key_value_2 )
109
121
110
122
diag_msg = DiagnosticArray ()
111
123
diag_msg .header .stamp = self .get_clock ().now ().to_msg ()
0 commit comments