Merge branch 'main' into acs-ctrl-updates-v2

This commit is contained in:
Marius Eggert 2023-03-10 17:43:45 +01:00
commit 948ad4ef7f
6 changed files with 70 additions and 62 deletions

View File

@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
# [unreleased]
## Changed
- ACS mode changes: The ACS CTRL submodes are now modes. DETUBMLE is now submode of SAFE mode.
# [v2.17.3] 2023-03-09
## Fixed

View File

@ -135,7 +135,7 @@
0x60000004;HEATER_4_CAMERA
0x60000005;HEATER_5_STR
0x60000006;HEATER_6_DRO
0x60000007;HEATER_7_HPA
0x60000007;HEATER_7_SYRLINKS
0x73000001;ACS_BOARD_ASS
0x73000002;SUS_BOARD_ASS
0x73000003;TCS_BOARD_ASS

1 0x00005060 P60DOCK_TEST_TASK
135 0x60000004 HEATER_4_CAMERA
136 0x60000005 HEATER_5_STR
137 0x60000006 HEATER_6_DRO
138 0x60000007 HEATER_7_HPA HEATER_7_SYRLINKS
139 0x73000001 ACS_BOARD_ASS
140 0x73000002 SUS_BOARD_ASS
141 0x73000003 TCS_BOARD_ASS

View File

@ -9,6 +9,7 @@ from typing import Tuple
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import ACS_CONTROLLER
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.tmtc.acs.defs import AcsMode, SafeSubmode
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
TmtcDefinitionWrapper,
@ -56,17 +57,6 @@ class SetId(enum.IntEnum):
ACTUATOR_CMD_DATA = 9
class Submode(enum.IntEnum):
OFF = 0
SAFE = 10
DETUMBLE = 11
IDLE = 12
PTG_NADIR = 13
PTG_TARGET = 14
PTG_TARGET_GS = 15
PTG_INERTIAL = 16
class ActionId(enum.IntEnum):
SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL = 0
RESET_MEKF = 1
@ -74,13 +64,13 @@ class ActionId(enum.IntEnum):
class OpCodes:
OFF = ["off"]
SAFE = ["normal_safe"]
DTBL = ["normal_detumble"]
IDLE = ["normal_idle"]
NADIR = ["normal_nadir"]
TARGET = ["normal_target"]
GS = ["normal_gs"]
INERTIAL = ["normal_inertial"]
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"]
SET_PARAMETER_SCALAR = ["set_scalar_param"]
@ -120,9 +110,9 @@ class OpCodes:
class Info:
OFF = "Switch ACS CTRL off"
SAFE = "Switch ACS CTRL normal - safe"
DTBL = "Switch ACS CTRL normal - detumble"
IDLE = "Switch ACS CTRL normal - idle"
SAFE = "Switch ACS CTRL - safe"
DTBL = "Switch ACS CTRL - safe with detumble submode"
IDLE = "Switch ACS CTRL - pointing idle"
NADIR = "Switch ACS CTRL normal - pointing nadir"
TARGET = "Switch ACS CTRL normal - pointing target"
GS = "Switch ACS CTRL normal - pointing target groundstation"
@ -236,29 +226,29 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.OFF, 0))
elif op_code in OpCodes.SAFE:
q.add_log_cmd(f"{Info.SAFE}")
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.SAFE))
q.add_pus_tc(
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DEFAULT)
)
elif op_code in OpCodes.DTBL:
q.add_log_cmd(f"{Info.DTBL}")
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.DETUMBLE))
q.add_pus_tc(
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DETUMBLE)
)
elif op_code in OpCodes.IDLE:
q.add_log_cmd(f"{Info.IDLE}")
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.IDLE))
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.IDLE, 0))
elif op_code in OpCodes.NADIR:
q.add_log_cmd(f"{Info.NADIR}")
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.PTG_NADIR))
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_NADIR, 0))
elif op_code in OpCodes.TARGET:
q.add_log_cmd(f"{Info.TARGET}")
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.PTG_TARGET))
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET, 0))
elif op_code in OpCodes.GS:
q.add_log_cmd(f"{Info.GS}")
q.add_pus_tc(
pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.PTG_TARGET_GS)
)
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET_GS, 0))
elif op_code in OpCodes.INERTIAL:
q.add_log_cmd(f"{Info.INERTIAL}")
q.add_pus_tc(
pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.PTG_INERTIAL)
)
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_INERTIAL, 0))
elif op_code in OpCodes.SAFE_PTG:
q.add_log_cmd(f"{Info.SAFE_PTG}")
q.add_pus_tc(

View File

@ -0,0 +1,16 @@
import enum
class AcsMode(enum.IntEnum):
OFF = 0
SAFE = 10
IDLE = 11
PTG_NADIR = 12
PTG_TARGET = 13
PTG_TARGET_GS = 14
PTG_INERTIAL = 15
class SafeSubmode(enum.IntEnum):
DEFAULT = 0
DETUMBLE = 1

View File

@ -12,14 +12,13 @@ import struct
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.utility.input_helper import InputHelper
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.util import ObjectIdU32
from eive_tmtc.utility.input_helper import InputHelper
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
_LOGGER = logging.getLogger(__name__)
@ -734,13 +733,22 @@ def handle_solution_set(hk_data: bytes, pw: PrintWrapper):
# Result of LISA: Lost in space algorithm
lisa_fmt = "!fffffB"
fmt_len = struct.calcsize(track_fmt)
(lisa_q_w, lisa_q_x, lisa_q_y, lisa_q_z) = struct.unpack(
lisa_fmt, hk_data[current_idx : current_idx + fmt_len]
)
(
lisa_q_w,
lisa_q_x,
lisa_q_y,
lisa_q_z,
lisa_percentage_close_stars,
lisa_number_close_stars,
) = struct.unpack(lisa_fmt, hk_data[current_idx : current_idx + fmt_len])
pw.dlog(f"LISA QW: {lisa_q_w}")
pw.dlog(f"LISA QX: {lisa_q_x}")
pw.dlog(f"LISA QY: {lisa_q_y}")
pw.dlog(f"LISA QZ: {lisa_q_z}")
pw.dlog(
f"Percentage of close stars in LISA solution: {lisa_percentage_close_stars}"
)
pw.dlog(f"Number of close stars in LISA solution: {lisa_number_close_stars}")
current_idx += fmt_len
is_trusworthy = hk_data[current_idx]
pw.dlog(f"Trustworthy solution: {is_trusworthy}")

View File

@ -1,6 +1,7 @@
import enum
from typing import Tuple, Dict
from eive_tmtc.tmtc.acs.defs import AcsMode, SafeSubmode
from spacepackets.ecss import PusTelecommand
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
from eive_tmtc.config.object_ids import ACS_SUBSYSTEM_ID
@ -27,17 +28,6 @@ class OpCode(str, enum.Enum):
REPORT_ALL_MODES = "all_modes"
class AcsMode(enum.IntEnum):
OFF = 0
SAFE = 10
DETUMBLE = 11
IDLE = 12
PTG_TARGET_NADIR = 13
PTG_TARGET = 14
PTG_TARGET_GS = 15
PTG_TARGET_INERTIAL = 16
class Info(str, enum.Enum):
OFF = "Off Command"
SAFE = "Safe Mode Command"
@ -50,15 +40,15 @@ class Info(str, enum.Enum):
REPORT_ALL_MODES = "Report All Modes Recursively"
HANDLER_LIST: Dict[str, Tuple[int, str]] = {
OpCode.OFF: (AcsMode.OFF, Info.OFF),
OpCode.SAFE: (AcsMode.SAFE, Info.SAFE),
OpCode.DETUMBLE: (AcsMode.DETUMBLE, Info.DETUMBLE),
OpCode.IDLE: (AcsMode.IDLE, Info.IDLE),
OpCode.PTG_TARGET: (AcsMode.PTG_TARGET, Info.PTG_TARGET),
OpCode.PTG_TARGET_GS: (AcsMode.PTG_TARGET_GS, Info.PTG_TARGET_GS),
OpCode.PTG_TARGET_NADIR: (AcsMode.PTG_TARGET_NADIR, Info.PTG_TARGET_NADIR),
OpCode.PTG_TARGET_INERTIAL: (AcsMode.PTG_TARGET_INERTIAL, Info.PTG_TARGET_INERTIAL),
HANDLER_LIST: Dict[str, Tuple[int, int, str]] = {
OpCode.OFF: (AcsMode.OFF, 0, Info.OFF),
OpCode.SAFE: (AcsMode.SAFE, SafeSubmode.DEFAULT, Info.SAFE),
OpCode.DETUMBLE: (AcsMode.SAFE, SafeSubmode.DETUMBLE, Info.DETUMBLE),
OpCode.IDLE: (AcsMode.IDLE, 0, Info.IDLE),
OpCode.PTG_TARGET: (AcsMode.PTG_TARGET, 0, Info.PTG_TARGET),
OpCode.PTG_TARGET_GS: (AcsMode.PTG_TARGET_GS, 0, Info.PTG_TARGET_GS),
OpCode.PTG_TARGET_NADIR: (AcsMode.PTG_NADIR, 0, Info.PTG_TARGET_NADIR),
OpCode.PTG_TARGET_INERTIAL: (AcsMode.PTG_INERTIAL, 0, Info.PTG_TARGET_INERTIAL),
}
@ -81,9 +71,9 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
return
pack_mode_cmd_with_info(
object_id=ACS_SUBSYSTEM_ID,
info=f"{info_prefix}: {mode_info_tup[1]}",
submode=0,
info=f"{info_prefix}: {mode_info_tup[2]}",
mode=mode_info_tup[0],
submode=mode_info_tup[1],
q=q,
)
@ -91,7 +81,7 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
@tmtc_definitions_provider
def add_acs_subsystem_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
for op_code, (_, info) in HANDLER_LIST.items():
for op_code, (_, _, info) in HANDLER_LIST.items():
oce.add(op_code, info)
oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
defs.add_service(CustomServiceList.ACS_SS, "ACS Subsystem", oce)