From d57714b0270d8e0b1dd0c2743ff522e192e09d00 Mon Sep 17 00:00:00 2001 From: Thomas Ung Date: Fri, 15 Nov 2024 04:19:23 +0100 Subject: [PATCH] fix Crash node if easy_fleet creation fails (#159) * fix Crash node if easy_fleet creation fails Upon creation of the EasyFullControl object the node may keep running even tho the returned pointer is null Signed-off-by: thomasung lint Signed-off-by: thomasung * rephrase comments Signed-off-by: thomasung follow pycodestyle Signed-off-by: Thomas Ung --------- Signed-off-by: thomasung Signed-off-by: Thomas Ung --- free_fleet_adapter/free_fleet_adapter/fleet_adapter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/free_fleet_adapter/free_fleet_adapter/fleet_adapter.py b/free_fleet_adapter/free_fleet_adapter/fleet_adapter.py index 3ba602f..370a79a 100644 --- a/free_fleet_adapter/free_fleet_adapter/fleet_adapter.py +++ b/free_fleet_adapter/free_fleet_adapter/fleet_adapter.py @@ -134,6 +134,9 @@ def main(argv=sys.argv): fleet_config.add_robot_coordinates_transformation(level, tf) fleet_handle = adapter.add_easy_fleet(fleet_config) + assert fleet_handle is not None, \ + "Failed to create EasyFullControl fleet, \ + please verify that the fleet config is valid." # Initialize zenoh zenoh_config = zenoh.Config.from_file(args.zenoh_config) \