|
|
|
@ -30,9 +30,9 @@ from tmtccmd.pus.s20_fsfw_param_defs import (
|
|
|
|
|
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_command
|
|
|
|
|
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
|
|
|
|
create_request_one_diag_command,
|
|
|
|
|
create_request_one_hk_command,
|
|
|
|
|
disable_periodic_hk_command,
|
|
|
|
|
enable_periodic_hk_command_with_interval,
|
|
|
|
|
generate_one_hk_command,
|
|
|
|
|
make_sid,
|
|
|
|
|
)
|
|
|
|
|
from tmtccmd.tmtc.queue import DefaultPusQueueHelper
|
|
|
|
@ -53,10 +53,17 @@ class SetId(enum.IntEnum):
|
|
|
|
|
GYR_RAW_SET = 4
|
|
|
|
|
GYR_PROC_SET = 5
|
|
|
|
|
GPS_PROC_SET = 6
|
|
|
|
|
MEKF_DATA = 7
|
|
|
|
|
ATTITUDE_ESTIMATION_DATA = 7
|
|
|
|
|
CTRL_VAL_DATA = 8
|
|
|
|
|
ACTUATOR_CMD_DATA = 9
|
|
|
|
|
FUSED_ROT_RATE_DATA = 10
|
|
|
|
|
FUSED_ROT_RATE_SOURCE_DATA = 11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DataSetRequest(enum.IntEnum):
|
|
|
|
|
ONESHOT = 0
|
|
|
|
|
ENABLE = 1
|
|
|
|
|
DISABLE = 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ActionId(enum.IntEnum):
|
|
|
|
@ -64,6 +71,7 @@ class ActionId(enum.IntEnum):
|
|
|
|
|
RESET_MEKF = 1
|
|
|
|
|
RESTORE_MEKF_NONFINITE_RECOVERY = 2
|
|
|
|
|
UPDATE_TLE = 3
|
|
|
|
|
READ_TLE = 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CTRL_STRAT_DICT = {
|
|
|
|
@ -84,67 +92,46 @@ CTRL_STRAT_DICT = {
|
|
|
|
|
19: "SAFE_ECLIPSE_IDELING",
|
|
|
|
|
20: "DETUMBLE_FULL",
|
|
|
|
|
21: "DETUMBLE_DETERIORATED",
|
|
|
|
|
30: "PTG_MEKF",
|
|
|
|
|
31: "PTG_RAW",
|
|
|
|
|
100: "PTG_MEKF",
|
|
|
|
|
101: "PTG_STR",
|
|
|
|
|
102: "PTG_QUEST",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GPS_COURCE_DICT = {
|
|
|
|
|
GPS_SOURCE_DICT = {
|
|
|
|
|
0: "NONE",
|
|
|
|
|
1: "GPS",
|
|
|
|
|
2: "GPS_EXTRAPOLATED",
|
|
|
|
|
3: "SGP4",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FUSED_ROT_RATE_SOURCE_DICT = {
|
|
|
|
|
0: "NONE",
|
|
|
|
|
1: "SUSMGM",
|
|
|
|
|
2: "QUEST",
|
|
|
|
|
3: "STR",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpCodes:
|
|
|
|
|
OFF = ["off"]
|
|
|
|
|
SAFE = ["safe"]
|
|
|
|
|
DTBL = ["safe_detumble"]
|
|
|
|
|
IDLE = ["ptg_idle"]
|
|
|
|
|
NADIR = ["ptg_nadir"]
|
|
|
|
|
TARGET = ["ptg_target"]
|
|
|
|
|
GS = ["ptg_target_gs"]
|
|
|
|
|
INERTIAL = ["ptg_inertial"]
|
|
|
|
|
SAFE_PTG = ["confirm_deployment"]
|
|
|
|
|
RESET_MEKF = ["reset_mekf"]
|
|
|
|
|
RESTORE_MEKF_NONFINITE_RECOVERY = ["restore_mekf_nonfinite_recovery"]
|
|
|
|
|
UPDATE_TLE = ["update_tle"]
|
|
|
|
|
SET_PARAMETER_SCALAR = ["set_scalar_param"]
|
|
|
|
|
SET_PARAMETER_VECTOR = ["set_vector_param"]
|
|
|
|
|
SET_PARAMETER_MATRIX = ["set_matrix_param"]
|
|
|
|
|
REQUEST_RAW_MGM_HK = ["mgm_raw_hk"]
|
|
|
|
|
ENABLE_RAW_MGM_HK = ["mgm_raw_enable_hk"]
|
|
|
|
|
DISABLE_RAW_MGM_HK = ["mgm_raw_disable_hk"]
|
|
|
|
|
REQUEST_PROC_MGM_HK = ["mgm_proc_hk"]
|
|
|
|
|
ENABLE_PROC_MGM_HK = ["mgm_proc_enable_hk"]
|
|
|
|
|
DISABLE_PROC_MGM_HK = ["mgm_proc_disable_hk"]
|
|
|
|
|
REQUEST_RAW_SUS_HK = ["sus_raw_hk"]
|
|
|
|
|
ENABLE_RAW_SUS_HK = ["sus_raw_enable_hk"]
|
|
|
|
|
DISABLE_RAW_SUS_HK = ["sus_raw_disable_hk"]
|
|
|
|
|
REQUEST_PROC_SUS_HK = ["sus_proc_hk"]
|
|
|
|
|
ENABLE_PROC_SUS_HK = ["sus_proc_enable_hk"]
|
|
|
|
|
DISABLE_PROC_SUS_HK = ["sus_proc_disable_hk"]
|
|
|
|
|
REQUEST_RAW_GYR_HK = ["gyr_raw_hk"]
|
|
|
|
|
ENABLE_RAW_GYR_HK = ["gyr_raw_enable_hk"]
|
|
|
|
|
DISABLE_RAW_GYR_HK = ["gyr_raw_disable_hk"]
|
|
|
|
|
REQUEST_PROC_GYR_HK = ["gyr_proc_hk"]
|
|
|
|
|
ENABLE_PROC_GYR_HK = ["gyr_proc_enable_hk"]
|
|
|
|
|
DISABLE_PROC_GYR_HK = ["gyr_proc_disable_hk"]
|
|
|
|
|
REQUEST_PROC_GPS_HK = ["gps_proc_hk"]
|
|
|
|
|
ENABLE_PROC_GPS_HK = ["gps_proc_enable_hk"]
|
|
|
|
|
DISABLE_PROC_GPS_HK = ["gps_proc_disable_hk"]
|
|
|
|
|
REQUEST_MEKF_HK = ["mekf_hk"]
|
|
|
|
|
ENABLE_MEKF_HK = ["mekf_enable_hk"]
|
|
|
|
|
DISABLE_MEKF_HK = ["mekf_disable_hk"]
|
|
|
|
|
REQUEST_CTRL_VAL_HK = ["ctrl_val_hk"]
|
|
|
|
|
ENABLE_CTRL_VAL_HK = ["ctrl_val_enable_hk"]
|
|
|
|
|
DISABLE_CTRL_VAL_HK = ["ctrl_val_disable_hk"]
|
|
|
|
|
REQUEST_ACT_CMD_HK = ["act_cmd_hk"]
|
|
|
|
|
ENABLE_ACT_CMD_HK = ["act_cmd_enable_hk"]
|
|
|
|
|
DISABLE_ACT_CMD_HK = ["act_cmd_disable_hk"]
|
|
|
|
|
REQUEST_FUSED_ROT_RATE_HK = ["f_rot_rate_hk"]
|
|
|
|
|
ENABLE_FUSED_ROT_RATE_HK = ["f_rot_rate_enable_hk"]
|
|
|
|
|
DISABLE_FUSED_ROT_RATE_HK = ["f_rot_rate_disable_hk"]
|
|
|
|
|
OFF = "off"
|
|
|
|
|
SAFE = "safe"
|
|
|
|
|
DTBL = "safe_detumble"
|
|
|
|
|
IDLE = "ptg_idle"
|
|
|
|
|
NADIR = "ptg_nadir"
|
|
|
|
|
TARGET = "ptg_target"
|
|
|
|
|
GS = "ptg_target_gs"
|
|
|
|
|
INERTIAL = "ptg_inertial"
|
|
|
|
|
SAFE_PTG = "confirm_deployment"
|
|
|
|
|
RESET_MEKF = "reset_mekf"
|
|
|
|
|
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
|
|
|
|
|
UPDATE_TLE = "update_tle"
|
|
|
|
|
READ_TLE = "read_tle"
|
|
|
|
|
SET_PARAMETER_SCALAR = "set_scalar_param"
|
|
|
|
|
SET_PARAMETER_VECTOR = "set_vector_param"
|
|
|
|
|
SET_PARAMETER_MATRIX = "set_matrix_param"
|
|
|
|
|
ONE_SHOOT_HK = "one_shot_hk"
|
|
|
|
|
ENABLE_HK = "enable_hk"
|
|
|
|
|
DISABLE_HK = "disable_hk"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Info:
|
|
|
|
@ -160,42 +147,13 @@ class Info:
|
|
|
|
|
RESET_MEKF = "Reset the MEKF"
|
|
|
|
|
RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery"
|
|
|
|
|
UPDATE_TLE = "Update TLE"
|
|
|
|
|
READ_TLE = "Read the currently stored TLE"
|
|
|
|
|
SET_PARAMETER_SCALAR = "Set Scalar Parameter"
|
|
|
|
|
SET_PARAMETER_VECTOR = "Set Vector Parameter"
|
|
|
|
|
SET_PARAMETER_MATRIX = "Set Matrix Parameter"
|
|
|
|
|
REQUEST_RAW_MGM_HK = "Request Raw MGM HK once"
|
|
|
|
|
ENABLE_RAW_MGM_HK = "Enable Raw MGM HK data generation"
|
|
|
|
|
DISABLE_RAW_MGM_HK = "Disable Raw MGM HK data generation"
|
|
|
|
|
REQUEST_PROC_MGM_HK = "Request Processed MGM HK"
|
|
|
|
|
ENABLE_PROC_MGM_HK = "Enable Processed MGM HK data generation"
|
|
|
|
|
DISABLE_PROC_MGM_HK = "Disable Processed MGM HK data generation"
|
|
|
|
|
REQUEST_RAW_SUS_HK = "Request Raw SUS HK"
|
|
|
|
|
ENABLE_RAW_SUS_HK = "Enable Raw SUS HK data generation"
|
|
|
|
|
DISABLE_RAW_SUS_HK = "Disable Raw SUS HK data generation"
|
|
|
|
|
REQUEST_PROC_SUS_HK = "Request Processed SUS HK"
|
|
|
|
|
ENABLE_PROC_SUS_HK = "Enable Processed SUS HK data generation"
|
|
|
|
|
DISABLE_PROC_SUS_HK = "Disable Processed MGM HK data generation"
|
|
|
|
|
REQUEST_RAW_GYR_HK = "Request Raw GYR HK"
|
|
|
|
|
ENABLE_RAW_GYR_HK = "Enable Raw GYR HK data generation"
|
|
|
|
|
DISABLE_RAW_GYR_HK = "Disable Raw GYR HK data generation"
|
|
|
|
|
REQUEST_PROC_GYR_HK = "Request Processed GYR HK"
|
|
|
|
|
ENABLE_PROC_GYR_HK = "Enable Processed GYR HK data generation"
|
|
|
|
|
DISABLE_PROC_GYR_HK = "Disable Processed GYR HK data generation"
|
|
|
|
|
REQUEST_PROC_GPS_HK = "Request Processed GPS HK"
|
|
|
|
|
ENABLE_PROC_GPS_HK = "Enable Processed GPS HK data generation"
|
|
|
|
|
DISABLE_PROC_GPS_HK = "Disable Processed GPS HK data generation"
|
|
|
|
|
REQUEST_MEKF_HK = "Request MEKF HK"
|
|
|
|
|
ENABLE_MEKF_HK = "Enable MEKF HK data generation"
|
|
|
|
|
DISABLE_MEKF_HK = "Disable MEKF HK data generation"
|
|
|
|
|
REQUEST_CTRL_VAL_HK = "Request Control Values HK"
|
|
|
|
|
ENABLE_CTRL_VAL_HK = "Enable Control Values HK data generation"
|
|
|
|
|
DISABLE_CTRL_VAL_HK = "Disable Control Values HK data generation"
|
|
|
|
|
REQUEST_ACT_CMD_HK = "Request Actuator Commands HK"
|
|
|
|
|
ENABLE_ACT_CMD_HK = "Enable Actuator Commands HK data generation"
|
|
|
|
|
DISABLE_ACT_CMD_HK = "Disable Actuator Commands HK data generation"
|
|
|
|
|
REQUEST_FUSED_ROT_RATE_HK = "Request Fused Rotational Rates HK"
|
|
|
|
|
ENABLE_FUSED_ROT_RATE_HK = "Enable Fused Rotational Rates HK data generation"
|
|
|
|
|
DISABLE_FUSED_ROT_RATE_HK = "Disable Fused Rotational Rates HK data generation"
|
|
|
|
|
ONE_SHOOT_HK = "One shoot HK Set"
|
|
|
|
|
ENABLE_HK = "Enable Periodic HK"
|
|
|
|
|
DISABLE_HK = "Disable Periodic HK"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PERFORM_MGM_CALIBRATION = False
|
|
|
|
@ -243,42 +201,13 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
|
|
|
|
|
info=Info.RESTORE_MEKF_NONFINITE_RECOVERY,
|
|
|
|
|
)
|
|
|
|
|
oce.add(keys=OpCodes.UPDATE_TLE, info=Info.UPDATE_TLE)
|
|
|
|
|
oce.add(keys=OpCodes.READ_TLE, info=Info.READ_TLE)
|
|
|
|
|
oce.add(keys=OpCodes.SET_PARAMETER_SCALAR, info=Info.SET_PARAMETER_SCALAR)
|
|
|
|
|
oce.add(keys=OpCodes.SET_PARAMETER_VECTOR, info=Info.SET_PARAMETER_VECTOR)
|
|
|
|
|
oce.add(keys=OpCodes.SET_PARAMETER_MATRIX, info=Info.SET_PARAMETER_MATRIX)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_RAW_MGM_HK, info=Info.REQUEST_RAW_MGM_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_RAW_MGM_HK, info=Info.ENABLE_RAW_MGM_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_RAW_MGM_HK, info=Info.DISABLE_RAW_MGM_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_PROC_MGM_HK, info=Info.REQUEST_PROC_MGM_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_PROC_MGM_HK, info=Info.ENABLE_PROC_MGM_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_PROC_MGM_HK, info=Info.DISABLE_PROC_MGM_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_RAW_SUS_HK, info=Info.REQUEST_RAW_SUS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_RAW_SUS_HK, info=Info.ENABLE_RAW_SUS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_RAW_SUS_HK, info=Info.DISABLE_RAW_SUS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_PROC_SUS_HK, info=Info.REQUEST_PROC_SUS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_PROC_SUS_HK, info=Info.ENABLE_PROC_SUS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_PROC_SUS_HK, info=Info.DISABLE_PROC_SUS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_RAW_GYR_HK, info=Info.REQUEST_RAW_GYR_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_RAW_GYR_HK, info=Info.ENABLE_RAW_GYR_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_RAW_GYR_HK, info=Info.DISABLE_RAW_GYR_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_PROC_GYR_HK, info=Info.REQUEST_PROC_GYR_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_PROC_GYR_HK, info=Info.ENABLE_PROC_GYR_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_PROC_GYR_HK, info=Info.DISABLE_PROC_GYR_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_PROC_GPS_HK, info=Info.REQUEST_PROC_GPS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_PROC_GPS_HK, info=Info.ENABLE_PROC_GPS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_PROC_GPS_HK, info=Info.DISABLE_PROC_GPS_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_MEKF_HK, info=Info.REQUEST_MEKF_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_MEKF_HK, info=Info.ENABLE_MEKF_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_MEKF_HK, info=Info.DISABLE_MEKF_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_CTRL_VAL_HK, info=Info.REQUEST_CTRL_VAL_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_CTRL_VAL_HK, info=Info.ENABLE_CTRL_VAL_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_CTRL_VAL_HK, info=Info.DISABLE_CTRL_VAL_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_ACT_CMD_HK, info=Info.REQUEST_ACT_CMD_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_ACT_CMD_HK, info=Info.ENABLE_ACT_CMD_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_ACT_CMD_HK, info=Info.DISABLE_ACT_CMD_HK)
|
|
|
|
|
oce.add(keys=OpCodes.REQUEST_FUSED_ROT_RATE_HK, info=Info.REQUEST_FUSED_ROT_RATE_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_FUSED_ROT_RATE_HK, info=Info.ENABLE_FUSED_ROT_RATE_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_FUSED_ROT_RATE_HK, info=Info.DISABLE_FUSED_ROT_RATE_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ONE_SHOOT_HK, info=Info.ONE_SHOOT_HK)
|
|
|
|
|
oce.add(keys=OpCodes.ENABLE_HK, info=Info.ENABLE_HK)
|
|
|
|
|
oce.add(keys=OpCodes.DISABLE_HK, info=Info.DISABLE_HK)
|
|
|
|
|
defs.add_service(
|
|
|
|
|
name=CustomServiceList.ACS_CTRL.value, info="ACS Controller", op_code_entry=oce
|
|
|
|
|
)
|
|
|
|
@ -353,230 +282,79 @@ def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
|
|
|
|
|
elif cmd_str in OpCodes.SET_PARAMETER_MATRIX:
|
|
|
|
|
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
|
|
|
|
|
set_acs_ctrl_param_matrix(q)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_RAW_MGM_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_RAW_MGM_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_RAW_MGM_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_RAW_MGM_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_RAW_MGM_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_RAW_MGM_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_PROC_MGM_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_PROC_MGM_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_PROC_MGM_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_PROC_MGM_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_PROC_MGM_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_PROC_MGM_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_RAW_SUS_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_RAW_SUS_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_RAW_SUS_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_RAW_SUS_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_RAW_SUS_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_RAW_SUS_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_PROC_SUS_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_PROC_SUS_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_PROC_SUS_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_PROC_SUS_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_PROC_SUS_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_PROC_SUS_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_RAW_GYR_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_RAW_GYR_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_RAW_GYR_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_RAW_GYR_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_RAW_GYR_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_RAW_GYR_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_PROC_GYR_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_PROC_GYR_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
create_request_one_diag_command(
|
|
|
|
|
make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_PROC_GYR_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_PROC_GYR_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
True, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_PROC_GYR_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_PROC_GYR_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
True, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_PROC_GPS_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_PROC_GPS_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_PROC_GPS_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_PROC_GPS_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_PROC_GPS_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_PROC_GPS_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_MEKF_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_MEKF_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.MEKF_DATA))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_MEKF_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_MEKF_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_MEKF_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_MEKF_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_CTRL_VAL_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_CTRL_VAL_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_CTRL_VAL_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_CTRL_VAL_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_CTRL_VAL_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_ACT_CMD_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_ACT_CMD_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_ACT_CMD_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_ACT_CMD_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_ACT_CMD_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_ACT_CMD_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.REQUEST_FUSED_ROT_RATE_HK:
|
|
|
|
|
q.add_log_cmd(Info.REQUEST_FUSED_ROT_RATE_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA))
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str in OpCodes.ENABLE_FUSED_ROT_RATE_HK:
|
|
|
|
|
interval = float(input("Please specify interval in floating point seconds: "))
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_FUSED_ROT_RATE_HK)
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
elif cmd_str in OpCodes.DISABLE_FUSED_ROT_RATE_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_FUSED_ROT_RATE_HK)
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
elif cmd_str == OpCodes.READ_TLE:
|
|
|
|
|
q.add_log_cmd(f"{Info.READ_TLE}")
|
|
|
|
|
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
|
|
|
|
|
elif cmd_str == OpCodes.SET_PARAMETER_SCALAR:
|
|
|
|
|
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
|
|
|
|
set_acs_ctrl_param_scalar(q)
|
|
|
|
|
elif cmd_str == OpCodes.SET_PARAMETER_VECTOR:
|
|
|
|
|
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
|
|
|
|
|
set_acs_ctrl_param_vector(q)
|
|
|
|
|
elif cmd_str == OpCodes.SET_PARAMETER_MATRIX:
|
|
|
|
|
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
|
|
|
|
|
set_acs_ctrl_param_matrix(q)
|
|
|
|
|
elif cmd_str == OpCodes.ONE_SHOOT_HK:
|
|
|
|
|
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
|
|
|
|
request_dataset(q, DataSetRequest.ONESHOT)
|
|
|
|
|
elif cmd_str == OpCodes.ENABLE_HK:
|
|
|
|
|
q.add_log_cmd(Info.ENABLE_HK)
|
|
|
|
|
request_dataset(q, DataSetRequest.ENABLE)
|
|
|
|
|
elif cmd_str == OpCodes.DISABLE_HK:
|
|
|
|
|
q.add_log_cmd(Info.DISABLE_HK)
|
|
|
|
|
request_dataset(q, DataSetRequest.DISABLE)
|
|
|
|
|
else:
|
|
|
|
|
logging.getLogger(__name__).info(f"Unknown op code {cmd_str}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
|
|
|
|
|
for val in SetId:
|
|
|
|
|
print("{:<2}: {:<20}".format(val, val.name))
|
|
|
|
|
set_id = int(input("Specify the dataset \n" ""))
|
|
|
|
|
if set_id in [
|
|
|
|
|
SetId.GYR_RAW_SET,
|
|
|
|
|
SetId.GPS_PROC_SET,
|
|
|
|
|
SetId.ATTITUDE_ESTIMATION_DATA,
|
|
|
|
|
]:
|
|
|
|
|
is_diag = True
|
|
|
|
|
else:
|
|
|
|
|
is_diag = False
|
|
|
|
|
match req_type:
|
|
|
|
|
case DataSetRequest.ONESHOT:
|
|
|
|
|
if is_diag:
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
create_request_one_diag_command(make_sid(ACS_CONTROLLER, set_id))
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
create_request_one_hk_command(make_sid(ACS_CONTROLLER, set_id))
|
|
|
|
|
)
|
|
|
|
|
case DataSetRequest.ENABLE:
|
|
|
|
|
interval = float(
|
|
|
|
|
input("Please specify interval in floating point seconds: ")
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if is_diag:
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
True, make_sid(ACS_CONTROLLER, set_id), interval
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
False, make_sid(ACS_CONTROLLER, set_id), interval
|
|
|
|
|
)
|
|
|
|
|
q.add_pus_tc(cmd_tuple[0])
|
|
|
|
|
q.add_pus_tc(cmd_tuple[1])
|
|
|
|
|
case DataSetRequest.DISABLE:
|
|
|
|
|
if is_diag:
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, set_id))
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
q.add_pus_tc(
|
|
|
|
|
disable_periodic_hk_command(False, make_sid(ACS_CONTROLLER, set_id))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_acs_ctrl_param_scalar(q: DefaultPusQueueHelper):
|
|
|
|
|
pt = int(
|
|
|
|
|
input(
|
|
|
|
@ -782,14 +560,16 @@ def handle_acs_ctrl_hk_data(
|
|
|
|
|
handle_gyr_data_processed(pw, hk_data)
|
|
|
|
|
case SetId.GPS_PROC_SET:
|
|
|
|
|
handle_gps_data_processed(pw, hk_data)
|
|
|
|
|
case SetId.MEKF_DATA:
|
|
|
|
|
handle_mekf_data(pw, hk_data)
|
|
|
|
|
case SetId.ATTITUDE_ESTIMATION_DATA:
|
|
|
|
|
handle_attitude_estimation_data(pw, hk_data)
|
|
|
|
|
case SetId.CTRL_VAL_DATA:
|
|
|
|
|
handle_ctrl_val_data(pw, hk_data)
|
|
|
|
|
case SetId.ACTUATOR_CMD_DATA:
|
|
|
|
|
handle_act_cmd_data(pw, hk_data)
|
|
|
|
|
case SetId.FUSED_ROT_RATE_DATA:
|
|
|
|
|
handle_fused_rot_rate_data(pw, hk_data)
|
|
|
|
|
case SetId.FUSED_ROT_RATE_SOURCE_DATA:
|
|
|
|
|
handle_fused_rot_rate_source_data(pw, hk_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_acs_ctrl_sus_raw_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -811,7 +591,7 @@ def handle_acs_ctrl_sus_raw_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
sus_list_formatted = vec_fmt.format(*sus_list)
|
|
|
|
|
current_idx += length
|
|
|
|
|
pw.dlog(f"SUS {idx} RAW: {sus_list_formatted}")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=12)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=12))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -847,7 +627,7 @@ def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
sun_ijk_model = vec_fmt.format(*sun_ijk_model)
|
|
|
|
|
current_idx += inc_len
|
|
|
|
|
pw.dlog(f"{'SUS ijk Model'.ljust(25)}: {sun_ijk_model}")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=15)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=15))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -903,7 +683,7 @@ def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
|
|
|
|
|
current_idx += 1
|
|
|
|
|
assert current_idx == 61
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -957,7 +737,7 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
current_idx += inc_len
|
|
|
|
|
if PERFORM_MGM_CALIBRATION:
|
|
|
|
|
perform_mgm_calibration(pw, mgm_3)
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -991,7 +771,7 @@ def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog(f"{'GYR 1 L3'.ljust(15)}: {float_str_fmt.format(*gyr_1_l3)}")
|
|
|
|
|
pw.dlog(f"{'GYR 2 ADIS'.ljust(15)}: {float_str_fmt.format(*gyr_2_adis)}")
|
|
|
|
|
pw.dlog(f"{'GYR 3 L3'.ljust(15)}: {float_str_fmt.format(*gyr_3_l3)}")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 4)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 4))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GYR_NAMES = ["GYR 0 ADIS", "GYR 1 L3", "GYR 2 ADIS", "GYR 3 L3"]
|
|
|
|
@ -1017,7 +797,7 @@ def handle_gyr_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
]
|
|
|
|
|
pw.dlog(f"GYR Vec Total: {gyr_vec_tot}")
|
|
|
|
|
current_idx += inc_len
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -1071,8 +851,8 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
|
|
|
|
)[0]
|
|
|
|
|
current_idx += inc_len_source
|
|
|
|
|
if GPS_COURCE_DICT.get(source) is not None:
|
|
|
|
|
pw.dlog(f"GPS Source: {GPS_COURCE_DICT[source]}")
|
|
|
|
|
if GPS_SOURCE_DICT.get(source) is not None:
|
|
|
|
|
pw.dlog(f"GPS Source: {GPS_SOURCE_DICT[source]}")
|
|
|
|
|
else:
|
|
|
|
|
pw.dlog(f"'GPS Source (key unknown)': {source}")
|
|
|
|
|
pw.dlog(f"GPS Latitude: {lat} [deg]")
|
|
|
|
@ -1080,10 +860,10 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog(f"GPS Altitude: {alt} [m]")
|
|
|
|
|
pw.dlog(f"GPS Position: {pos} [m]")
|
|
|
|
|
pw.dlog(f"GPS Velocity: {velo} [m/s]")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
def handle_attitude_estimation_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
mekf_status = {
|
|
|
|
|
0: "UNINITIALIZED",
|
|
|
|
|
1: "NO_GYR_DATA",
|
|
|
|
@ -1094,7 +874,7 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
10: "INITIALIZED",
|
|
|
|
|
11: "RUNNING",
|
|
|
|
|
}
|
|
|
|
|
pw.dlog("Received MEKF Set")
|
|
|
|
|
pw.dlog("Received Attitude Estimation Set")
|
|
|
|
|
fmt_quat = "!dddd"
|
|
|
|
|
fmt_str_4 = "[{:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}]"
|
|
|
|
|
fmt_str_3 = "[{:8.3f}, {:8.3f}, {:8.3f}]"
|
|
|
|
@ -1103,11 +883,16 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
inc_len_quat = struct.calcsize(fmt_quat)
|
|
|
|
|
inc_len_vec = struct.calcsize(fmt_vec)
|
|
|
|
|
inc_len_sts = struct.calcsize(fmt_sts)
|
|
|
|
|
if len(hk_data) < inc_len_quat + inc_len_vec + inc_len_sts:
|
|
|
|
|
pw.dlog("Received HK set too small")
|
|
|
|
|
old_size = inc_len_quat + inc_len_vec + inc_len_sts + 1
|
|
|
|
|
new_size = 2 * inc_len_quat + inc_len_vec + inc_len_sts + 1
|
|
|
|
|
size = len(hk_data)
|
|
|
|
|
if size not in [old_size, new_size]:
|
|
|
|
|
pw.dlog(f"Received Attitude Estimation HK Set of unexpected size: {size}")
|
|
|
|
|
return
|
|
|
|
|
current_idx = 0
|
|
|
|
|
quat = struct.unpack(fmt_quat, hk_data[current_idx : current_idx + inc_len_quat])
|
|
|
|
|
mekf_quat = struct.unpack(
|
|
|
|
|
fmt_quat, hk_data[current_idx : current_idx + inc_len_quat]
|
|
|
|
|
)
|
|
|
|
|
current_idx += inc_len_quat
|
|
|
|
|
rates = [
|
|
|
|
|
rate * 180 / math.pi
|
|
|
|
@ -1122,9 +907,17 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog(f"{'MEKF Status'.ljust(25)}: {mekf_status[status]}")
|
|
|
|
|
else:
|
|
|
|
|
pw.dlog(f"{'MEKF Raw Status (key unknown)'.ljust(25)}: {status}")
|
|
|
|
|
pw.dlog(f"{'MEKF Quaternion'.ljust(25)}: {fmt_str_4.format(*quat)}")
|
|
|
|
|
pw.dlog(f"{'MEKF Quaternion'.ljust(25)}: {fmt_str_4.format(*mekf_quat)}")
|
|
|
|
|
pw.dlog(f"{'MEKF Rotational Rate'.ljust(25)}: {fmt_str_3.format(*rates)}")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
|
|
|
|
if size == new_size:
|
|
|
|
|
quest_quat = struct.unpack(
|
|
|
|
|
fmt_quat, hk_data[current_idx : current_idx + inc_len_quat]
|
|
|
|
|
)
|
|
|
|
|
current_idx += inc_len_quat
|
|
|
|
|
pw.dlog(f"{'QUEST Quaternion'.ljust(25)}: {fmt_str_4.format(*quest_quat)}")
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
|
|
|
|
|
return
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -1174,14 +967,14 @@ def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
]
|
|
|
|
|
current_idx += inc_len_vec
|
|
|
|
|
if CTRL_STRAT_DICT.get(strat) is not None:
|
|
|
|
|
pw.dlog(f"{'Safe Ctrl Strategy'.ljust(25)}: {CTRL_STRAT_DICT[strat]}")
|
|
|
|
|
pw.dlog(f"{'Ctrl Strategy'.ljust(25)}: {CTRL_STRAT_DICT[strat]}")
|
|
|
|
|
else:
|
|
|
|
|
pw.dlog(f"{'Safe Ctrl Strategy (key unknown)'.ljust(25)}: {strat}")
|
|
|
|
|
pw.dlog(f"{'Ctrl Strategy (key unknown)'.ljust(25)}: {strat}")
|
|
|
|
|
pw.dlog(f"Control Values Target Quaternion: {tgt_quat}")
|
|
|
|
|
pw.dlog(f"Control Values Error Quaternion: {err_quat}")
|
|
|
|
|
pw.dlog(f"Control Values Error Angle: {err_ang} [deg]")
|
|
|
|
|
pw.dlog(f"Control Values Target Rotational Rate: {tgt_rot} [deg/s]")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
@ -1220,15 +1013,20 @@ def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog(f"Actuator Commands RW Target Torque: {rw_tgt_torque}")
|
|
|
|
|
pw.dlog(f"Actuator Commands RW Target Speed: {rw_tgt_speed}")
|
|
|
|
|
pw.dlog(f"Actuator Commands MTQ Target Dipole: {mtq_tgt_dipole}")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog("Received Fused Rotation Rates Data Set")
|
|
|
|
|
fmt_vec3_double = "!ddd"
|
|
|
|
|
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
|
|
|
|
if len(hk_data) < 3 * inc_len_vec3_double:
|
|
|
|
|
pw.dlog("Received HK set too small")
|
|
|
|
|
fmt_source = "!B"
|
|
|
|
|
inc_len_source = struct.calcsize(fmt_source)
|
|
|
|
|
old_size = 3 * inc_len_vec3_double + 1
|
|
|
|
|
new_size = 3 * inc_len_vec3_double + inc_len_source + 1
|
|
|
|
|
size = len(hk_data)
|
|
|
|
|
if size not in [old_size, new_size]:
|
|
|
|
|
pw.dlog(f"Received Fused Rot Rate HK set of unexpected size: {len(hk_data)}")
|
|
|
|
|
return
|
|
|
|
|
current_idx = 0
|
|
|
|
|
rot_rate_orthogonal = [
|
|
|
|
@ -1255,7 +1053,91 @@ def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog(f"Fused Rotational Rate Orthogonal: {rot_rate_orthogonal} [deg/s]")
|
|
|
|
|
pw.dlog(f"Fused Rotational Rate Parallel: {rot_rate_parallel} [deg/s]")
|
|
|
|
|
pw.dlog(f"Fused Rotational Rate Total: {rot_rate_total} [deg/s]")
|
|
|
|
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
|
|
|
|
if size == new_size:
|
|
|
|
|
rot_rate_source = struct.unpack(
|
|
|
|
|
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
|
|
|
|
)[0]
|
|
|
|
|
current_idx += inc_len_source
|
|
|
|
|
if FUSED_ROT_RATE_SOURCE_DICT.get(rot_rate_source) is not None:
|
|
|
|
|
pw.dlog(
|
|
|
|
|
f"Fused Rotational Rate Source: {FUSED_ROT_RATE_SOURCE_DICT[rot_rate_source]}"
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
pw.dlog(f"Ctrl Strategy (key unknown): {rot_rate_source}")
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
|
|
|
|
|
return
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_fused_rot_rate_source_data(pw: PrintWrapper, hk_data: bytes):
|
|
|
|
|
pw.dlog("Received Fused Rotation Rates Sources Data Set")
|
|
|
|
|
fmt_vec3_double = "!ddd"
|
|
|
|
|
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
|
|
|
|
if len(hk_data) < 5 * inc_len_vec3_double:
|
|
|
|
|
pw.dlog("Received HK set too small")
|
|
|
|
|
return
|
|
|
|
|
current_idx = 0
|
|
|
|
|
rot_rate_orthogonal_susmgm = [
|
|
|
|
|
f"{val*180/math.pi:8.3f}"
|
|
|
|
|
for val in struct.unpack(
|
|
|
|
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
current_idx += inc_len_vec3_double
|
|
|
|
|
rot_rate_parallel_susmgm = [
|
|
|
|
|
f"{val*180/math.pi:8.3f}"
|
|
|
|
|
for val in struct.unpack(
|
|
|
|
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
current_idx += inc_len_vec3_double
|
|
|
|
|
rot_rate_total_susmgm = [
|
|
|
|
|
f"{val*180/math.pi:8.3f}"
|
|
|
|
|
for val in struct.unpack(
|
|
|
|
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
current_idx += inc_len_vec3_double
|
|
|
|
|
rot_rate_total_quest = [
|
|
|
|
|
f"{val * 180 / math.pi:8.3f}"
|
|
|
|
|
for val in struct.unpack(
|
|
|
|
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
current_idx += inc_len_vec3_double
|
|
|
|
|
rot_rate_total_str = [
|
|
|
|
|
f"{val * 180 / math.pi:8.3f}"
|
|
|
|
|
for val in struct.unpack(
|
|
|
|
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
current_idx += inc_len_vec3_double
|
|
|
|
|
pw.dlog(
|
|
|
|
|
f"Fused Rotational Rate Orthogonal SUSMGM: {rot_rate_orthogonal_susmgm} [deg/s]"
|
|
|
|
|
)
|
|
|
|
|
pw.dlog(
|
|
|
|
|
f"Fused Rotational Rate Parallel SUSMGM: {rot_rate_parallel_susmgm} [deg/s]"
|
|
|
|
|
)
|
|
|
|
|
pw.dlog(f"Fused Rotational Rate Total SUSMGM: {rot_rate_total_susmgm} [deg/s]")
|
|
|
|
|
pw.dlog(f"Fused Rotational Rate Total QUEST: {rot_rate_total_quest} [deg/s]")
|
|
|
|
|
pw.dlog(f"Fused Rotational Rate Total STR: {rot_rate_total_str} [deg/s]")
|
|
|
|
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_acs_ctrl_action_replies(
|
|
|
|
|
action_id: int, pw: PrintWrapper, custom_data: bytes
|
|
|
|
|
):
|
|
|
|
|
if action_id == ActionId.READ_TLE:
|
|
|
|
|
handle_read_tle(pw, custom_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_read_tle(pw: PrintWrapper, custom_data: bytes):
|
|
|
|
|
pw.dlog("Received TLE")
|
|
|
|
|
data_length = 69 * 2
|
|
|
|
|
if len(custom_data) != data_length:
|
|
|
|
|
raise ValueError(f"Received data of unexpected length {len(custom_data)}")
|
|
|
|
|
tle = custom_data.decode()
|
|
|
|
|
pw.dlog(f"{tle[0:69]}\n{tle[69:69*2]}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def perform_mgm_calibration( # noqa C901: Complexity okay
|
|
|
|
|