@@ -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,29 +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
+ })
238
243
239
244
# Add cooling for A300 only for now
240
245
if self .clearpath_config .get_platform_model () == Platform .A300 :
241
- self .param_file .update (
242
- { self .DIAGNOSTIC_AGGREGATOR_NODE : {
246
+ self .param_file .update ({
247
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
243
248
'platform' : {
244
249
'analyzers' : {
245
250
'cooling' : {
246
251
'type' : 'diagnostic_aggregator/GenericAnalyzer' ,
247
252
'path' : 'Cooling' ,
248
- 'contains' : ['Fan' , 'Thermal' ]}}}}})
253
+ 'contains' : ['Fan' , 'Thermal' ]
254
+ }
255
+ }
256
+ }
257
+ }
258
+ })
249
259
250
260
if self .clearpath_config .platform .enable_ekf :
251
- self .param_file .update (
252
- { self .DIAGNOSTIC_AGGREGATOR_NODE : {
261
+ self .param_file .update ({
262
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
253
263
'platform' : {
254
264
'analyzers' : {
255
265
'odometry' : {
256
266
'expected' : [
257
267
'ekf_node: Filter diagnostic updater' ,
258
268
'ekf_node: odometry/filtered topic status' ,
259
- ]}}}}})
269
+ ]
270
+ }
271
+ }
272
+ }
273
+ }
274
+ })
260
275
261
276
sensor_analyzers = {}
262
277
@@ -300,12 +315,15 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
300
315
301
316
# Update aggregator sensor sections based on the robot.yaml
302
317
if sensor_analyzers :
303
- self .param_file .update (
304
- { self .DIAGNOSTIC_AGGREGATOR_NODE : {
318
+ self .param_file .update ({
319
+ self .DIAGNOSTIC_AGGREGATOR_NODE : {
305
320
'sensors' : {
306
321
'type' : 'diagnostic_aggregator/AnalyzerGroup' ,
307
322
'path' : 'Sensors' ,
308
- 'analyzers' : sensor_analyzers }}})
323
+ 'analyzers' : sensor_analyzers
324
+ }
325
+ }
326
+ })
309
327
310
328
class DiagnosticsUpdaterParam (BaseParam ):
311
329
"""Parameter file for Clearpath Diagnostics indicating which topics to monitor."""
@@ -326,9 +344,12 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
326
344
327
345
# Update parameters based on the robot.yaml
328
346
platform_model = self .clearpath_config .get_platform_model ()
329
- self .param_file .update ({self .DIAGNOSTIC_UPDATER_NODE : {
330
- 'serial_number' : self .clearpath_config .get_serial_number (),
331
- '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
+ })
332
353
333
354
if use_sim_time :
334
355
latest_apt_firmware_version = 'simulated'
@@ -350,10 +371,13 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
350
371
print (f'\033 [93mWarning: ros-{ ROS_DISTRO } -clearpath-firmware'
351
372
' package not found\033 [0m' )
352
373
353
- self .param_file .update ({self .DIAGNOSTIC_UPDATER_NODE : {
354
- 'ros_distro' : ROS_DISTRO ,
355
- 'latest_apt_firmware_version' : latest_apt_firmware_version ,
356
- '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
+ })
357
381
358
382
# List all topics to be monitored from each launched sensor
359
383
for sensor in self .clearpath_config .sensors .get_all_sensors ():
@@ -404,7 +428,8 @@ def add_topic(self, sensor: BaseSensor, topic_key: str) -> None:
404
428
"""
405
429
self .diag_dict [sensor .get_topic_name (topic_key , local = True )] = {
406
430
'type' : sensor .get_topic_type (topic_key ),
407
- 'rate' : float (sensor .get_topic_rate (topic_key ))}
431
+ 'rate' : float (sensor .get_topic_rate (topic_key ))
432
+ }
408
433
409
434
class LocalizationParam (BaseParam ):
410
435
EKF_NODE = 'ekf_node'
0 commit comments