From 1b9a033376fb145183c22534703e2e9f008d366a Mon Sep 17 00:00:00 2001 From: tas Date: Wed, 17 Jul 2024 13:16:27 +0200 Subject: [PATCH] velodyne_configuration: handle exception for missing operational ranges. Correct typo --- velodyne_configuration/nodes/configuration_node.py | 8 +++++++- velodyne_configuration/nodes/example_node.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/velodyne_configuration/nodes/configuration_node.py b/velodyne_configuration/nodes/configuration_node.py index 20b107a4..ef9e18be 100644 --- a/velodyne_configuration/nodes/configuration_node.py +++ b/velodyne_configuration/nodes/configuration_node.py @@ -72,8 +72,14 @@ def send_command(self, request): response.all_in_range = True outside_range = [] for b in diag: + print(b) for n in diag[b]: - in_range = self.configurator.check_diagnostics_parameter(b, n, diag[b][n]) + print(n) + try: + in_range = self.configurator.check_diagnostics_parameter(b, n, diag[b][n]) + except NameError as e: + print("No ranges for parameter", b, n) + in_range = True if not in_range: print("parameter %s %s is outside operational ranges [%f]", b, n, diag[b][n]) response.all_in_range = False diff --git a/velodyne_configuration/nodes/example_node.py b/velodyne_configuration/nodes/example_node.py index 83ab5c7b..74da8d4e 100644 --- a/velodyne_configuration/nodes/example_node.py +++ b/velodyne_configuration/nodes/example_node.py @@ -94,7 +94,7 @@ def __init__(self): spc_cmd_response = self._special_config_srv_proxy(spc_cmd_config_request) - if spc_cmd_response.succes: + if spc_cmd_response.success: print("all parameters within the operational range") else: print("parameter outside its operational range!")