star tracker image upload

This commit is contained in:
Jakob Meier 2021-12-06 15:44:34 +01:00
parent d6f5d38f21
commit 7b01165ff9
6 changed files with 104 additions and 10 deletions

View File

@ -6,7 +6,7 @@
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\EIVE_Reinraumrechner\AppData\Local\Programs\Python\Python39\python.exe" />
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Star Tracker" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
<option name="PARAMETERS" value="-s star_tracker -l -t 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ccsds handler" type="PythonConfigurationType" factoryName="Python" folderName="CCSDS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
<option name="PARAMETERS" value="-s ccsds_handler -l -t 8 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="pdec handler" type="PythonConfigurationType" factoryName="Python" folderName="CCSDS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
<option name="PARAMETERS" value="-s pdec_handler -l -t 8 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -154,12 +154,12 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.ACS_A_SIDE_OFF.value:
("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
GomspaceOpCodes.PRINT_SWITCH_V_I.value:
("PDU1: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.SYRLINKS_ON.value:
("PDU1: Turn Syrlinks on", {OpCodeDictKeys.TIMEOUT: 2.0}),
Pdu1OpCodes.SYRLINKS_OFF.value:
("PDU1: Turn Syrlinks off", {OpCodeDictKeys.TIMEOUT: 2.0}),
GomspaceOpCodes.PRINT_SWITCH_V_I.value:
("PDU1: Print Switches, Voltages, Currents", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
@ -291,7 +291,10 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"6": ("Star Tracker: Subscribe to telemetry", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("Star Tracker: Boot image (requires bootloader mode)", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0})
"9": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("Star Tracker: Limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
@ -320,11 +323,6 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
}
service_syrlinks_handler_tuple = ("Syrlinks Handler", op_code_dict_srv_syrlinks_handler)
op_code_dict_srv_str_img_helper = {
"0": ("Star Tracker Image Helper: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_str_img_helper_tuple = ("PDEC Handler", op_code_dict_srv_str_img_helper)
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
@ -341,5 +339,4 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
service_op_code_dict[CustomServiceList.PLOC_MEMORY_DUMPER.value] = service_ploc_memory_dumper_tuple
service_op_code_dict[CustomServiceList.CCSDS_HANDLER.value] = service_ccsds_handler_tuple
service_op_code_dict[CustomServiceList.PDEC_HANDLER.value] = service_pdec_handler_tuple
service_op_code_dict[CustomServiceList.STR_IMG_HELPER.value] = service_str_img_helper_tuple
service_op_code_dict[CustomServiceList.SYRLINKS.value] = service_syrlinks_handler_tuple

View File

@ -21,9 +21,17 @@ class StarTrackerActionIds:
REQ_TIME = 4
REQ_POWER = 11
REBOOT = 7
DOWNLOAD_IMAGE = 9
UPLOAD_IMAGE = 10
SUBSCRIBE_TO_TM = 18
REQ_SOLUTION = 24
REQ_TEMPERATURE = 25
LIMITS = 40
class ImagePathDefs:
uploadFile = "/mnt/sd0/startracker/gemma.bin"
jsonFile = "/mnt/sd0/startracker/full.json"
def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
@ -83,3 +91,20 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_SOLUTION)
command = PusTelecommand(service=8, subservice=128, ssc=39, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "10":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload image"))
command = object_id + struct.pack('!I', StarTrackerActionIds.UPLOAD_IMAGE) + \
bytearray(ImagePathDefs.uploadFile, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "11":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image"))
command = object_id + struct.pack('!I', StarTrackerActionIds.DOWNLOAD_IMAGE)
command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "12":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
command = object_id + struct.pack('!I', StarTrackerActionIds.LIMITS) + \
bytearray(ImagePathDefs.jsonFile, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())