Merge remote-tracking branch 'origin/main' into bump-tmtccmd
All checks were successful
EIVE/-/pipeline/pr-v6.0.0-dev This commit looks good

This commit is contained in:
Robin Müller 2024-01-24 17:49:39 +01:00
commit d53e9d61b0
Signed by: muellerr
GPG Key ID: A649FB78196E3849
10 changed files with 336 additions and 379 deletions

View File

@ -10,6 +10,20 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
# [v5.12.1] 2023-12-13
## Added
- A few new commands to test the TC scheduler.
# [v5.12.0] 2023-12-06
## Added
- New ACS controller commands.
# [v5.11.0] 2023-11-30
## Added ## Added
- Added new commands to disable channel order checks partially for the payload PCDU normal modes. - Added new commands to disable channel order checks partially for the payload PCDU normal modes.

View File

@ -93,9 +93,10 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h 11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h
11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h 11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h
11205;0x2bc5;MEKF_AUTOMATIC_RESET;INFO;MEKF performed an automatic reset after detection of nonfinite values.;mission/acs/defs.h 11205;0x2bc5;MEKF_AUTOMATIC_RESET;INFO;MEKF performed an automatic reset after detection of nonfinite values.;mission/acs/defs.h
11206;0x2bc6;MEKF_INVALID_MODE_VIOLATION;HIGH;MEKF was not able to compute a solution during any pointing ACS mode for a prolonged time.;mission/acs/defs.h 11206;0x2bc6;PTG_CTRL_NO_ATTITUDE_INFORMATION;HIGH;For a prolonged time, no attitude information was available for the Pointing Controller. Falling back to Safe Mode.;mission/acs/defs.h
11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h 11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h
11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h 11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h
11209;0x2bc9;TLE_FILE_READ_FAILED;LOW;The TLE could not be read from the filesystem.;mission/acs/defs.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/power/defs.h 11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/power/defs.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/power/defs.h 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/power/defs.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
93 11203 0x2bc3 MEKF_INVALID_INFO INFO MEKF was not able to compute a solution. P1: MEKF state on exit mission/acs/defs.h
94 11204 0x2bc4 MEKF_RECOVERY INFO MEKF is able to compute a solution again. mission/acs/defs.h
95 11205 0x2bc5 MEKF_AUTOMATIC_RESET INFO MEKF performed an automatic reset after detection of nonfinite values. mission/acs/defs.h
96 11206 0x2bc6 MEKF_INVALID_MODE_VIOLATION PTG_CTRL_NO_ATTITUDE_INFORMATION HIGH MEKF was not able to compute a solution during any pointing ACS mode for a prolonged time. For a prolonged time, no attitude information was available for the Pointing Controller. Falling back to Safe Mode. mission/acs/defs.h
97 11207 0x2bc7 SAFE_MODE_CONTROLLER_FAILURE HIGH The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate mission/acs/defs.h
98 11208 0x2bc8 TLE_TOO_OLD INFO The TLE for the SGP4 Propagator has become too old. mission/acs/defs.h
99 11209 0x2bc9 TLE_FILE_READ_FAILED LOW The TLE could not be read from the filesystem. mission/acs/defs.h
100 11300 0x2c24 SWITCH_CMD_SENT INFO Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index mission/power/defs.h
101 11301 0x2c25 SWITCH_HAS_CHANGED INFO Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/power/defs.h
102 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM No description mission/power/defs.h

View File

@ -387,6 +387,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
0x4307;PUS11_MapIsFull;No description;7;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h 0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h 0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h 0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
@ -593,6 +594,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h 0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h 0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h
0x6a01;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;1;ACS_CTRL;mission/controller/AcsController.h
0x6a02;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;2;ACS_CTRL;mission/controller/AcsController.h
0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h 0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
387 0x4304 PUS11_InvalidRelativeTime No description 4 PUS_SERVICE_11 fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
388 0x4305 PUS11_ContainedTcTooSmall No description 5 PUS_SERVICE_11 fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
389 0x4306 PUS11_ContainedTcCrcMissmatch No description 6 PUS_SERVICE_11 fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
390 0x4307 PUS11_MapIsFull No description 7 PUS_SERVICE_11 fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
391 0x4400 FILS_GenericFileError No description 0 FILE_SYSTEM fsfw/src/fsfw/filesystem/HasFileSystemIF.h
392 0x4401 FILS_GenericDirError No description 1 FILE_SYSTEM fsfw/src/fsfw/filesystem/HasFileSystemIF.h
393 0x4402 FILS_FilesystemInactive No description 2 FILE_SYSTEM fsfw/src/fsfw/filesystem/HasFileSystemIF.h
594 0x69c0 SPVRTVIF_BufTooSmall No description 192 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
595 0x69c1 SPVRTVIF_NoReplyTimeout No description 193 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
596 0x6a00 ACSCTRL_FileDeletionFailed File deletion failed and at least one file is still existent. 0 ACS_CTRL mission/controller/AcsController.h
597 0x6a01 ACSCTRL_WriteFileFailed Writing the TLE to the file has failed. 1 ACS_CTRL mission/controller/AcsController.h
598 0x6a02 ACSCTRL_ReadFileFailed Reading the TLE to the file has failed. 2 ACS_CTRL mission/controller/AcsController.h
599 0x6b02 ACSMEKF_MekfUninitialized No description 2 ACS_MEKF mission/controller/acs/MultiplicativeKalmanFilter.h
600 0x6b03 ACSMEKF_MekfNoGyrData No description 3 ACS_MEKF mission/controller/acs/MultiplicativeKalmanFilter.h
601 0x6b04 ACSMEKF_MekfNoModelVectors No description 4 ACS_MEKF mission/controller/acs/MultiplicativeKalmanFilter.h

View File

@ -10,6 +10,7 @@ from eive_tmtc.config.object_ids import (
CORE_CONTROLLER_ID, CORE_CONTROLLER_ID,
STAR_TRACKER_ID, STAR_TRACKER_ID,
P60_DOCK_HANDLER, P60_DOCK_HANDLER,
ACS_CONTROLLER,
) )
from eive_tmtc.tmtc.acs.imtq import ImtqActionId from eive_tmtc.tmtc.acs.imtq import ImtqActionId
from eive_tmtc.pus_tm.defs import PrintWrapper from eive_tmtc.pus_tm.defs import PrintWrapper
@ -17,6 +18,7 @@ from eive_tmtc.tmtc.core import handle_core_ctrl_action_replies
from eive_tmtc.tmtc.payload.ploc_mpsoc import handle_mpsoc_data_reply from eive_tmtc.tmtc.payload.ploc_mpsoc import handle_mpsoc_data_reply
from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
from eive_tmtc.tmtc.acs.star_tracker import handle_star_tracker_action_replies from eive_tmtc.tmtc.acs.star_tracker import handle_star_tracker_action_replies
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_action_replies
from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply
from tmtccmd.pus.s8_fsfw_action import Service8FsfwTm from tmtccmd.pus.s8_fsfw_action import Service8FsfwTm
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
@ -53,6 +55,8 @@ def handle_action_reply(
return handle_core_ctrl_action_replies(action_id, pw, custom_data) return handle_core_ctrl_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes == STAR_TRACKER_ID: elif object_id.as_bytes == STAR_TRACKER_ID:
return handle_star_tracker_action_replies(action_id, pw, custom_data) return handle_star_tracker_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes == ACS_CONTROLLER:
return handle_acs_ctrl_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes in [ elif object_id.as_bytes in [
ACU_HANDLER_ID, ACU_HANDLER_ID,
PDU_1_HANDLER_ID, PDU_1_HANDLER_ID,

View File

@ -16,6 +16,7 @@ from eive_tmtc.tmtc.payload.rad_sensor import handle_rad_sensor_data
from eive_tmtc.tmtc.acs.sus import handle_sus_hk from eive_tmtc.tmtc.acs.sus import handle_sus_hk
from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
from eive_tmtc.tmtc.power.pwr_ctrl import handle_pwr_ctrl_hk_data
from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data
@ -229,6 +230,10 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
return handle_acs_ctrl_hk_data( return handle_acs_ctrl_hk_data(
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
) )
elif objb == obj_ids.PWR_CONTROLLER:
return handle_pwr_ctrl_hk_data(
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
)
else: else:
_LOGGER.info( _LOGGER.info(
f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} " f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} "

View File

@ -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.s200_fsfw_mode import Mode, pack_mode_command
from tmtccmd.pus.tc.s3_fsfw_hk import ( from tmtccmd.pus.tc.s3_fsfw_hk import (
create_request_one_diag_command, create_request_one_diag_command,
create_request_one_hk_command,
disable_periodic_hk_command, disable_periodic_hk_command,
enable_periodic_hk_command_with_interval, enable_periodic_hk_command_with_interval,
generate_one_hk_command,
make_sid, make_sid,
) )
from tmtccmd.tmtc.queue import DefaultPusQueueHelper from tmtccmd.tmtc.queue import DefaultPusQueueHelper
@ -53,10 +53,17 @@ class SetId(enum.IntEnum):
GYR_RAW_SET = 4 GYR_RAW_SET = 4
GYR_PROC_SET = 5 GYR_PROC_SET = 5
GPS_PROC_SET = 6 GPS_PROC_SET = 6
MEKF_DATA = 7 ATTITUDE_ESTIMATION_DATA = 7
CTRL_VAL_DATA = 8 CTRL_VAL_DATA = 8
ACTUATOR_CMD_DATA = 9 ACTUATOR_CMD_DATA = 9
FUSED_ROT_RATE_DATA = 10 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): class ActionId(enum.IntEnum):
@ -64,6 +71,7 @@ class ActionId(enum.IntEnum):
RESET_MEKF = 1 RESET_MEKF = 1
RESTORE_MEKF_NONFINITE_RECOVERY = 2 RESTORE_MEKF_NONFINITE_RECOVERY = 2
UPDATE_TLE = 3 UPDATE_TLE = 3
READ_TLE = 4
CTRL_STRAT_DICT = { CTRL_STRAT_DICT = {
@ -84,67 +92,46 @@ CTRL_STRAT_DICT = {
19: "SAFE_ECLIPSE_IDELING", 19: "SAFE_ECLIPSE_IDELING",
20: "DETUMBLE_FULL", 20: "DETUMBLE_FULL",
21: "DETUMBLE_DETERIORATED", 21: "DETUMBLE_DETERIORATED",
30: "PTG_MEKF", 100: "PTG_MEKF",
31: "PTG_RAW", 101: "PTG_STR",
102: "PTG_QUEST",
} }
GPS_COURCE_DICT = { GPS_SOURCE_DICT = {
0: "NONE", 0: "NONE",
1: "GPS", 1: "GPS",
2: "GPS_EXTRAPOLATED", 2: "GPS_EXTRAPOLATED",
3: "SGP4", 3: "SGP4",
} }
FUSED_ROT_RATE_SOURCE_DICT = {
0: "NONE",
1: "SUSMGM",
2: "QUEST",
3: "STR",
}
class OpCodes: class OpCodes:
OFF = ["off"] OFF = "off"
SAFE = ["safe"] SAFE = "safe"
DTBL = ["safe_detumble"] DTBL = "safe_detumble"
IDLE = ["ptg_idle"] IDLE = "ptg_idle"
NADIR = ["ptg_nadir"] NADIR = "ptg_nadir"
TARGET = ["ptg_target"] TARGET = "ptg_target"
GS = ["ptg_target_gs"] GS = "ptg_target_gs"
INERTIAL = ["ptg_inertial"] INERTIAL = "ptg_inertial"
SAFE_PTG = ["confirm_deployment"] SAFE_PTG = "confirm_deployment"
RESET_MEKF = ["reset_mekf"] RESET_MEKF = "reset_mekf"
RESTORE_MEKF_NONFINITE_RECOVERY = ["restore_mekf_nonfinite_recovery"] RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
UPDATE_TLE = ["update_tle"] UPDATE_TLE = "update_tle"
SET_PARAMETER_SCALAR = ["set_scalar_param"] READ_TLE = "read_tle"
SET_PARAMETER_VECTOR = ["set_vector_param"] SET_PARAMETER_SCALAR = "set_scalar_param"
SET_PARAMETER_MATRIX = ["set_matrix_param"] SET_PARAMETER_VECTOR = "set_vector_param"
REQUEST_RAW_MGM_HK = ["mgm_raw_hk"] SET_PARAMETER_MATRIX = "set_matrix_param"
ENABLE_RAW_MGM_HK = ["mgm_raw_enable_hk"] ONE_SHOOT_HK = "one_shot_hk"
DISABLE_RAW_MGM_HK = ["mgm_raw_disable_hk"] ENABLE_HK = "enable_hk"
REQUEST_PROC_MGM_HK = ["mgm_proc_hk"] DISABLE_HK = "disable_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"]
class Info: class Info:
@ -160,42 +147,13 @@ class Info:
RESET_MEKF = "Reset the MEKF" RESET_MEKF = "Reset the MEKF"
RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery" RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery"
UPDATE_TLE = "Update TLE" UPDATE_TLE = "Update TLE"
READ_TLE = "Read the currently stored TLE"
SET_PARAMETER_SCALAR = "Set Scalar Parameter" SET_PARAMETER_SCALAR = "Set Scalar Parameter"
SET_PARAMETER_VECTOR = "Set Vector Parameter" SET_PARAMETER_VECTOR = "Set Vector Parameter"
SET_PARAMETER_MATRIX = "Set Matrix Parameter" SET_PARAMETER_MATRIX = "Set Matrix Parameter"
REQUEST_RAW_MGM_HK = "Request Raw MGM HK once" ONE_SHOOT_HK = "One shoot HK Set"
ENABLE_RAW_MGM_HK = "Enable Raw MGM HK data generation" ENABLE_HK = "Enable Periodic HK"
DISABLE_RAW_MGM_HK = "Disable Raw MGM HK data generation" DISABLE_HK = "Disable Periodic HK"
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"
PERFORM_MGM_CALIBRATION = False PERFORM_MGM_CALIBRATION = False
@ -243,42 +201,13 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
info=Info.RESTORE_MEKF_NONFINITE_RECOVERY, info=Info.RESTORE_MEKF_NONFINITE_RECOVERY,
) )
oce.add(keys=OpCodes.UPDATE_TLE, info=Info.UPDATE_TLE) 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_SCALAR, info=Info.SET_PARAMETER_SCALAR)
oce.add(keys=OpCodes.SET_PARAMETER_VECTOR, info=Info.SET_PARAMETER_VECTOR) 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.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.ONE_SHOOT_HK, info=Info.ONE_SHOOT_HK)
oce.add(keys=OpCodes.ENABLE_RAW_MGM_HK, info=Info.ENABLE_RAW_MGM_HK) oce.add(keys=OpCodes.ENABLE_HK, info=Info.ENABLE_HK)
oce.add(keys=OpCodes.DISABLE_RAW_MGM_HK, info=Info.DISABLE_RAW_MGM_HK) oce.add(keys=OpCodes.DISABLE_HK, info=Info.DISABLE_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)
defs.add_service( defs.add_service(
name=CustomServiceList.ACS_CTRL.value, info="ACS Controller", op_code_entry=oce 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: elif cmd_str in OpCodes.SET_PARAMETER_MATRIX:
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}") q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
set_acs_ctrl_param_matrix(q) set_acs_ctrl_param_matrix(q)
elif cmd_str in OpCodes.REQUEST_RAW_MGM_HK: elif cmd_str == OpCodes.READ_TLE:
q.add_log_cmd(Info.REQUEST_RAW_MGM_HK) q.add_log_cmd(f"{Info.READ_TLE}")
q.add_pus_tc( q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET)) elif cmd_str == OpCodes.SET_PARAMETER_SCALAR:
) q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
elif cmd_str in OpCodes.ENABLE_RAW_MGM_HK: set_acs_ctrl_param_scalar(q)
interval = float(input("Please specify interval in floating point seconds: ")) elif cmd_str == OpCodes.SET_PARAMETER_VECTOR:
q.add_log_cmd(Info.ENABLE_RAW_MGM_HK) q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
cmd_tuple = enable_periodic_hk_command_with_interval( set_acs_ctrl_param_vector(q)
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET), interval elif cmd_str == OpCodes.SET_PARAMETER_MATRIX:
) q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
q.add_pus_tc(cmd_tuple[0]) set_acs_ctrl_param_matrix(q)
q.add_pus_tc(cmd_tuple[1]) elif cmd_str == OpCodes.ONE_SHOOT_HK:
elif cmd_str in OpCodes.DISABLE_RAW_MGM_HK: q.add_log_cmd(Info.ONE_SHOOT_HK)
q.add_log_cmd(Info.DISABLE_RAW_MGM_HK) request_dataset(q, DataSetRequest.ONESHOT)
q.add_pus_tc( elif cmd_str == OpCodes.ENABLE_HK:
disable_periodic_hk_command( q.add_log_cmd(Info.ENABLE_HK)
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET) request_dataset(q, DataSetRequest.ENABLE)
) elif cmd_str == OpCodes.DISABLE_HK:
) q.add_log_cmd(Info.DISABLE_HK)
elif cmd_str in OpCodes.REQUEST_PROC_MGM_HK: request_dataset(q, DataSetRequest.DISABLE)
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)
)
)
else: else:
logging.getLogger(__name__).info(f"Unknown op code {cmd_str}") 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): def set_acs_ctrl_param_scalar(q: DefaultPusQueueHelper):
pt = int( pt = int(
input( input(
@ -782,14 +560,16 @@ def handle_acs_ctrl_hk_data(
handle_gyr_data_processed(pw, hk_data) handle_gyr_data_processed(pw, hk_data)
case SetId.GPS_PROC_SET: case SetId.GPS_PROC_SET:
handle_gps_data_processed(pw, hk_data) handle_gps_data_processed(pw, hk_data)
case SetId.MEKF_DATA: case SetId.ATTITUDE_ESTIMATION_DATA:
handle_mekf_data(pw, hk_data) handle_attitude_estimation_data(pw, hk_data)
case SetId.CTRL_VAL_DATA: case SetId.CTRL_VAL_DATA:
handle_ctrl_val_data(pw, hk_data) handle_ctrl_val_data(pw, hk_data)
case SetId.ACTUATOR_CMD_DATA: case SetId.ACTUATOR_CMD_DATA:
handle_act_cmd_data(pw, hk_data) handle_act_cmd_data(pw, hk_data)
case SetId.FUSED_ROT_RATE_DATA: case SetId.FUSED_ROT_RATE_DATA:
handle_fused_rot_rate_data(pw, hk_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): 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) sus_list_formatted = vec_fmt.format(*sus_list)
current_idx += length current_idx += length
pw.dlog(f"SUS {idx} RAW: {sus_list_formatted}") 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): 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) sun_ijk_model = vec_fmt.format(*sun_ijk_model)
current_idx += inc_len current_idx += inc_len
pw.dlog(f"{'SUS ijk Model'.ljust(25)}: {sun_ijk_model}") 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): 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]}") pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
current_idx += 1 current_idx += 1
assert current_idx == 61 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): 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 current_idx += inc_len
if PERFORM_MGM_CALIBRATION: if PERFORM_MGM_CALIBRATION:
perform_mgm_calibration(pw, mgm_3) 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): 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 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 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)}") 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"] 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}") pw.dlog(f"GYR Vec Total: {gyr_vec_tot}")
current_idx += inc_len 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): 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] fmt_source, hk_data[current_idx : current_idx + inc_len_source]
)[0] )[0]
current_idx += inc_len_source current_idx += inc_len_source
if GPS_COURCE_DICT.get(source) is not None: if GPS_SOURCE_DICT.get(source) is not None:
pw.dlog(f"GPS Source: {GPS_COURCE_DICT[source]}") pw.dlog(f"GPS Source: {GPS_SOURCE_DICT[source]}")
else: else:
pw.dlog(f"'GPS Source (key unknown)': {source}") pw.dlog(f"'GPS Source (key unknown)': {source}")
pw.dlog(f"GPS Latitude: {lat} [deg]") 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 Altitude: {alt} [m]")
pw.dlog(f"GPS Position: {pos} [m]") pw.dlog(f"GPS Position: {pos} [m]")
pw.dlog(f"GPS Velocity: {velo} [m/s]") 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 = { mekf_status = {
0: "UNINITIALIZED", 0: "UNINITIALIZED",
1: "NO_GYR_DATA", 1: "NO_GYR_DATA",
@ -1094,7 +874,7 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
10: "INITIALIZED", 10: "INITIALIZED",
11: "RUNNING", 11: "RUNNING",
} }
pw.dlog("Received MEKF Set") pw.dlog("Received Attitude Estimation Set")
fmt_quat = "!dddd" fmt_quat = "!dddd"
fmt_str_4 = "[{:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}]" fmt_str_4 = "[{:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}]"
fmt_str_3 = "[{: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_quat = struct.calcsize(fmt_quat)
inc_len_vec = struct.calcsize(fmt_vec) inc_len_vec = struct.calcsize(fmt_vec)
inc_len_sts = struct.calcsize(fmt_sts) inc_len_sts = struct.calcsize(fmt_sts)
if len(hk_data) < inc_len_quat + inc_len_vec + inc_len_sts: old_size = inc_len_quat + inc_len_vec + inc_len_sts + 1
pw.dlog("Received HK set too small") 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 return
current_idx = 0 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 current_idx += inc_len_quat
rates = [ rates = [
rate * 180 / math.pi 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]}") pw.dlog(f"{'MEKF Status'.ljust(25)}: {mekf_status[status]}")
else: else:
pw.dlog(f"{'MEKF Raw Status (key unknown)'.ljust(25)}: {status}") 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)}") 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): 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 current_idx += inc_len_vec
if CTRL_STRAT_DICT.get(strat) is not None: 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: 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 Target Quaternion: {tgt_quat}")
pw.dlog(f"Control Values Error Quaternion: {err_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 Error Angle: {err_ang} [deg]")
pw.dlog(f"Control Values Target Rotational Rate: {tgt_rot} [deg/s]") 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): 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 Torque: {rw_tgt_torque}")
pw.dlog(f"Actuator Commands RW Target Speed: {rw_tgt_speed}") pw.dlog(f"Actuator Commands RW Target Speed: {rw_tgt_speed}")
pw.dlog(f"Actuator Commands MTQ Target Dipole: {mtq_tgt_dipole}") 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): def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog("Received Fused Rotation Rates Data Set") pw.dlog("Received Fused Rotation Rates Data Set")
fmt_vec3_double = "!ddd" fmt_vec3_double = "!ddd"
inc_len_vec3_double = struct.calcsize(fmt_vec3_double) inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
if len(hk_data) < 3 * inc_len_vec3_double: fmt_source = "!B"
pw.dlog("Received HK set too small") 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 return
current_idx = 0 current_idx = 0
rot_rate_orthogonal = [ 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 Orthogonal: {rot_rate_orthogonal} [deg/s]")
pw.dlog(f"Fused Rotational Rate Parallel: {rot_rate_parallel} [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]") 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 def perform_mgm_calibration( # noqa C901: Complexity okay

View File

@ -5,9 +5,6 @@ import struct
from pathlib import Path from pathlib import Path
from typing import Tuple from typing import Tuple
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.config.definitions import CustomServiceList
from spacepackets.ecss import PusTelecommand from spacepackets.ecss import PusTelecommand
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper
@ -19,8 +16,22 @@ from tmtccmd.pus.s20_fsfw_param import (
create_load_param_cmd, create_load_param_cmd,
) )
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
from tmtccmd.pus.s11_tc_sched import (
create_enable_tc_sched_cmd,
create_disable_tc_sched_cmd,
)
from tmtccmd.pus.s20_fsfw_param import (
create_load_param_cmd,
create_scalar_u8_parameter,
)
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.tmtc import DefaultPusQueueHelper
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
from eive_tmtc.pus_tm.defs import PrintWrapper
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -66,6 +77,7 @@ class ActionId(enum.IntEnum):
MV_HELPER = 53 MV_HELPER = 53
RM_HELPER = 54 RM_HELPER = 54
MKDIR_HELPER = 55 MKDIR_HELPER = 55
ENABLE_SCHEDULER = 56
class ParamId(enum.IntEnum): class ParamId(enum.IntEnum):
@ -115,6 +127,8 @@ class OpCode:
RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt" RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt"
AUTO_SWITCH_ENABLE = "auto_switch_enable" AUTO_SWITCH_ENABLE = "auto_switch_enable"
AUTO_SWITCH_DISABLE = "auto_switch_disable" AUTO_SWITCH_DISABLE = "auto_switch_disable"
ENABLE_SCHEDULER = "enable_scheduler"
DISABLE_SCHEDULER = "disable_scheduler"
class Info: class Info:
@ -155,7 +169,8 @@ class Info:
RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt" RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt"
AUTO_SWITCH_ENABLE = "Enable Auto-Switch Feature with a specific target image" AUTO_SWITCH_ENABLE = "Enable Auto-Switch Feature with a specific target image"
AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature" AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature"
GET_HK = "get_hk" ENABLE_SCHEDULER = "Enable scheduler"
DISABLE_SCHEDULER = "Disable scheduler"
class Chip(enum.IntEnum): class Chip(enum.IntEnum):
@ -267,6 +282,8 @@ def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER) oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER)
oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER) oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER)
oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER) oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER)
oce.add(keys=OpCode.ENABLE_SCHEDULER, info=Info.ENABLE_SCHEDULER)
oce.add(keys=OpCode.DISABLE_SCHEDULER, info=Info.DISABLE_SCHEDULER)
defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce) defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce)
@ -540,6 +557,12 @@ def pack_core_commands( # noqa C901
q.add_pus_tc( q.add_pus_tc(
create_action_cmd(CORE_CONTROLLER_ID, ActionId.MKDIR_HELPER, user_data) create_action_cmd(CORE_CONTROLLER_ID, ActionId.MKDIR_HELPER, user_data)
) )
elif cmd_str == OpCode.ENABLE_SCHEDULER:
q.add_log_cmd(Info.ENABLE_SCHEDULER)
q.add_pus_tc(create_enable_tc_sched_cmd())
elif cmd_str == OpCode.DISABLE_SCHEDULER:
q.add_log_cmd(Info.DISABLE_SCHEDULER)
q.add_pus_tc(create_disable_tc_sched_cmd())
else: else:
_LOGGER.warning( _LOGGER.warning(
f"Unknown operation code {cmd_str} for core controller commands" f"Unknown operation code {cmd_str} for core controller commands"

View File

@ -4,6 +4,7 @@ from eive_tmtc.config.object_ids import (
GPS_0_HEALTH_DEV, GPS_0_HEALTH_DEV,
GYRO_0_ADIS_HANDLER_ID, GYRO_0_ADIS_HANDLER_ID,
GYRO_1_L3G_HANDLER_ID, GYRO_1_L3G_HANDLER_ID,
GYRO_2_ADIS_HANDLER_ID,
ACS_BOARD_ASS_ID, ACS_BOARD_ASS_ID,
RW_ASSEMBLY, RW_ASSEMBLY,
SUS_BOARD_ASS_ID, SUS_BOARD_ASS_ID,
@ -38,14 +39,15 @@ ACS_OBJ_DICT = {
5: ("iMTQ MGT", IMTQ_HANDLER_ID), 5: ("iMTQ MGT", IMTQ_HANDLER_ID),
6: ("GYR 0 ADIS", GYRO_0_ADIS_HANDLER_ID), 6: ("GYR 0 ADIS", GYRO_0_ADIS_HANDLER_ID),
7: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID), 7: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID),
8: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID), 8: ("GYR 2 ADIS", GYRO_2_ADIS_HANDLER_ID),
9: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID), 9: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID),
10: ("GPS 0 Health Device", GPS_0_HEALTH_DEV), 10: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID),
11: ("SUS 0", SUS_0_N_LOC_XFYFZM_PT_XF), 11: ("GPS 0 Health Device", GPS_0_HEALTH_DEV),
12: ("SUS 6", SUS_6_R_LOC_XFYBZM_PT_XF), 12: ("SUS 0", SUS_0_N_LOC_XFYFZM_PT_XF),
13: ("RW 1", RW1_ID), 13: ("SUS 6", SUS_6_R_LOC_XFYBZM_PT_XF),
14: ("RW 2", RW2_ID), 14: ("RW 1", RW1_ID),
15: ("STR", STAR_TRACKER_ID), 15: ("RW 2", RW2_ID),
16: ("STR", STAR_TRACKER_ID),
} }
TCS_OBJ_DICT = { TCS_OBJ_DICT = {

View File

@ -1,5 +1,10 @@
import datetime
import math
import struct
from spacepackets.ecss import PusService, PusTelecommand from spacepackets.ecss import PusService, PusTelecommand
from tmtccmd.config import CmdTreeNode from tmtccmd.config import CmdTreeNode
from tmtccmd.pus.s11_tc_sched import create_time_tagged_cmd
from tmtccmd.pus.s17_test import create_service_17_ping_command from tmtccmd.pus.s17_test import create_service_17_ping_command
from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.tmtc import DefaultPusQueueHelper
@ -8,12 +13,14 @@ class OpCode:
PING = "ping" PING = "ping"
TRIGGER_EVENT = "trig_event" TRIGGER_EVENT = "trig_event"
PING_WITH_DATA = "ping_with_data" PING_WITH_DATA = "ping_with_data"
SCHEDULE_PING = "sched_ping"
class Info: class Info:
PING = "Simple Ping and Connection Test" PING = "Simple Ping and Connection Test"
TRIGGER_EVENT = "Trigger an event" TRIGGER_EVENT = "Trigger an event"
PING_WITH_DATA = "Ping with data. Size of sent data is sent back" PING_WITH_DATA = "Ping with data. Size of sent data is sent back"
SCHEDULE_PING = "Schedule a ping"
def create_test_node() -> CmdTreeNode: def create_test_node() -> CmdTreeNode:
@ -21,6 +28,7 @@ def create_test_node() -> CmdTreeNode:
node.add_child(CmdTreeNode(OpCode.PING, Info.PING)) node.add_child(CmdTreeNode(OpCode.PING, Info.PING))
node.add_child(CmdTreeNode(OpCode.TRIGGER_EVENT, Info.TRIGGER_EVENT)) node.add_child(CmdTreeNode(OpCode.TRIGGER_EVENT, Info.TRIGGER_EVENT))
node.add_child(CmdTreeNode(OpCode.PING_WITH_DATA, Info.PING_WITH_DATA)) node.add_child(CmdTreeNode(OpCode.PING_WITH_DATA, Info.PING_WITH_DATA))
node.add_child(CmdTreeNode(OpCode.SCHEDULE_PING, Info.SCHEDULE_PING))
return node return node
@ -31,6 +39,21 @@ def build_test_commands(q: DefaultPusQueueHelper, cmd_path: str):
if cmd_path == OpCode.TRIGGER_EVENT: if cmd_path == OpCode.TRIGGER_EVENT:
q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]") q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]")
q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128)) q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128))
if cmd_path == OpCode.SCHEDULE_PING:
q.add_log_cmd("Sending scheduled PUS ping")
# Generate a UNIX timestamp 30 seconds in the future using the datetime API with a UTC timezone
now = datetime.datetime.now(tz=datetime.timezone.utc)
second_offset_to_now = input("Please specify offset to now in seconds: ")
now += datetime.timedelta(seconds=int(second_offset_to_now))
unix_stamp = struct.pack("!I", math.floor(now.timestamp()))
print(f"Sending ping scheuled at {now}")
ping = PusTelecommand(service=PusService.S17_TEST, subservice=128)
q.add_pus_tc(
create_time_tagged_cmd(
release_time=unix_stamp,
tc_to_insert=ping,
)
)
if cmd_path == OpCode.PING_WITH_DATA: if cmd_path == OpCode.PING_WITH_DATA:
q.add_log_cmd("Sending Ping With Data, Size Reported Back [17, 129]") q.add_log_cmd("Sending Ping With Data, Size Reported Back [17, 129]")
while True: while True:

View File

@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "eive-tmtc" name = "eive-tmtc"
description = "TMTC Commander EIVE" description = "TMTC Commander EIVE"
readme = "README.md" readme = "README.md"
version = "5.10.1" version = "5.12.1"
requires-python = ">=3.10" requires-python = ">=3.10"
license = {text = "Apache-2.0"} license = {text = "Apache-2.0"}
authors = [ authors = [