From 199ffe1a321c09ba9726c87413045f8b32f40e90 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 5 Feb 2022 15:44:50 +0100 Subject: [PATCH 1/9] egse specific commands --- config/hook_implementations.py | 2 ++ pus_tc/star_tracker.py | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/config/hook_implementations.py b/config/hook_implementations.py index c3c7663..38b09ec 100644 --- a/config/hook_implementations.py +++ b/config/hook_implementations.py @@ -539,6 +539,8 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT): "49": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}), "50": ("Star Tracker: Request blob parameters", {OpCodeDictKeys.TIMEOUT: 2.0}), "51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}), + "52": ("Star Tracker: (EGSE only) Load image processor ground config ", {OpCodeDictKeys.TIMEOUT: 2.0}), + "53": ("Star Tracker: (EGSE only) Load image processor flight config", {OpCodeDictKeys.TIMEOUT: 2.0}), } service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker) diff --git a/pus_tc/star_tracker.py b/pus_tc/star_tracker.py index 8112271..db146a0 100644 --- a/pus_tc/star_tracker.py +++ b/pus_tc/star_tracker.py @@ -76,7 +76,8 @@ class ImagePathDefs: downloadFpgaImagePath = "/mnt/sd0/startracker" downloadFpgaImageName = "testname" uploadFpgaImageName = "/mnt/sd0/startracker/fpga-image.bin" - + egseGroundConfig = "/home/pi/arcsec/ground-config.json" + egseFlightConfig = "/home/pi/arcsec/flight-config.json" class Region: # Definition according to datasheet (which turned out to be partially faulty) @@ -195,10 +196,13 @@ def pack_star_tracker_commands( tc_queue.appendleft(command.pack_command_tuple()) if op_code == "15": tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image")) + path = input("Specify storage location (default - /mnt/sd0/startracker): ") + if not path: + path = ImagePathDefs.downloadPath command = ( object_id + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_IMAGE) - + bytearray(ImagePathDefs.downloadPath, "utf-8") + + bytearray(path, "utf-8") ) command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) @@ -506,6 +510,18 @@ def pack_star_tracker_commands( bytearray(ImagePathDefs.jsonFile, 'utf-8') command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "52": + tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: EGSE load ground config camera parameters")) + command = object_id + struct.pack('!I', StarTrackerActionIds.CAMERA) + \ + bytearray(ImagePathDefs.egseGroundConfig, 'utf-8') + command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + if op_code == "53": + tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: EGSE load flight config camera parameters")) + command = object_id + struct.pack('!I', StarTrackerActionIds.CAMERA) + \ + bytearray(ImagePathDefs.egseFlightConfig, 'utf-8') + command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) def pack_write_command(object_id: bytearray) -> bytearray: From 6d3777ce2a7aaee9aad53ec3f856ae1aaa108d56 Mon Sep 17 00:00:00 2001 From: EIVE Cleanroom Date: Tue, 8 Feb 2022 12:00:39 +0100 Subject: [PATCH 2/9] image processor --- .idea/runConfigurations/Star_Tracker.xml | 2 +- pus_tc/star_tracker.py | 21 +++++++++++++++++++++ spacepackets | 2 +- tmtccmd | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.idea/runConfigurations/Star_Tracker.xml b/.idea/runConfigurations/Star_Tracker.xml index bb2cf5e..c9cd34d 100644 --- a/.idea/runConfigurations/Star_Tracker.xml +++ b/.idea/runConfigurations/Star_Tracker.xml @@ -6,7 +6,7 @@ -