@@ -223,8 +223,8 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
223
223
224
224
# Add MCU diagnostic category for all platforms except A200
225
225
if self .clearpath_config .get_platform_model () != Platform .A200 :
226
- self .param_file .update (
227
- { self .DIAGNOSTIC_AGGREGATOR_NODE : {
226
+ self .param_file .update ({
227
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
228
228
'platform' : {
229
229
'analyzers' : {
230
230
'mcu' : {
@@ -234,7 +234,44 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
234
234
'clearpath_diagnostic_updater: MCU Firmware Version' ,
235
235
'clearpath_diagnostic_updater: MCU Status'
236
236
],
237
- 'contains' : ['MCU' ]}}}}})
237
+ 'contains' : ['MCU' ]
238
+ }
239
+ }
240
+ }
241
+ }
242
+ })
243
+
244
+ # Add cooling for A300 only for now
245
+ if self .clearpath_config .get_platform_model () == Platform .A300 :
246
+ self .param_file .update ({
247
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
248
+ 'platform' : {
249
+ 'analyzers' : {
250
+ 'cooling' : {
251
+ 'type' : 'diagnostic_aggregator/GenericAnalyzer' ,
252
+ 'path' : 'Cooling' ,
253
+ 'contains' : ['Fan' , 'Thermal' ]
254
+ }
255
+ }
256
+ }
257
+ }
258
+ })
259
+
260
+ if self .clearpath_config .platform .enable_ekf :
261
+ self .param_file .update ({
262
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
263
+ 'platform' : {
264
+ 'analyzers' : {
265
+ 'odometry' : {
266
+ 'expected' : [
267
+ 'ekf_node: Filter diagnostic updater' ,
268
+ 'ekf_node: odometry/filtered topic status' ,
269
+ ]
270
+ }
271
+ }
272
+ }
273
+ }
274
+ })
238
275
239
276
sensor_analyzers = {}
240
277
@@ -278,12 +315,15 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
278
315
279
316
# Update aggregator sensor sections based on the robot.yaml
280
317
if sensor_analyzers :
281
- self .param_file .update (
282
- { self .DIAGNOSTIC_AGGREGATOR_NODE : {
318
+ self .param_file .update ({
319
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
283
320
'sensors' : {
284
321
'type' : 'diagnostic_aggregator/AnalyzerGroup' ,
285
322
'path' : 'Sensors' ,
286
- 'analyzers' : sensor_analyzers }}})
323
+ 'analyzers' : sensor_analyzers
324
+ }
325
+ }
326
+ })
287
327
288
328
class DiagnosticsUpdaterParam (BaseParam ):
289
329
"""Parameter file for Clearpath Diagnostics indicating which topics to monitor."""
@@ -304,9 +344,12 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
304
344
305
345
# Update parameters based on the robot.yaml
306
346
platform_model = self .clearpath_config .get_platform_model ()
307
- self .param_file .update ({self .DIAGNOSTIC_UPDATER_NODE : {
308
- 'serial_number' : self .clearpath_config .get_serial_number (),
309
- 'platform_model' : platform_model }})
347
+ self .param_file .update ({
348
+ self .DIAGNOSTIC_UPDATER_NODE : {
349
+ 'serial_number' : self .clearpath_config .get_serial_number (),
350
+ 'platform_model' : platform_model
351
+ }
352
+ })
310
353
311
354
if use_sim_time :
312
355
latest_apt_firmware_version = 'simulated'
@@ -328,10 +371,13 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
328
371
print (f'\033 [93mWarning: ros-{ ROS_DISTRO } -clearpath-firmware'
329
372
' package not found\033 [0m' )
330
373
331
- self .param_file .update ({self .DIAGNOSTIC_UPDATER_NODE : {
332
- 'ros_distro' : ROS_DISTRO ,
333
- 'latest_apt_firmware_version' : latest_apt_firmware_version ,
334
- 'installed_apt_firmware_version' : installed_apt_firmware_version }})
374
+ self .param_file .update ({
375
+ self .DIAGNOSTIC_UPDATER_NODE : {
376
+ 'ros_distro' : ROS_DISTRO ,
377
+ 'latest_apt_firmware_version' : latest_apt_firmware_version ,
378
+ 'installed_apt_firmware_version' : installed_apt_firmware_version
379
+ }
380
+ })
335
381
336
382
# List all topics to be monitored from each launched sensor
337
383
for sensor in self .clearpath_config .sensors .get_all_sensors ():
@@ -382,7 +428,8 @@ def add_topic(self, sensor: BaseSensor, topic_key: str) -> None:
382
428
"""
383
429
self .diag_dict [sensor .get_topic_name (topic_key , local = True )] = {
384
430
'type' : sensor .get_topic_type (topic_key ),
385
- 'rate' : float (sensor .get_topic_rate (topic_key ))}
431
+ 'rate' : float (sensor .get_topic_rate (topic_key ))
432
+ }
386
433
387
434
class LocalizationParam (BaseParam ):
388
435
EKF_NODE = 'ekf_node'
0 commit comments