acs-ctrl-updates-v2 #164
@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [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
|
# [v2.17.3] 2023-03-09
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
0x60000004;HEATER_4_CAMERA
|
0x60000004;HEATER_4_CAMERA
|
||||||
0x60000005;HEATER_5_STR
|
0x60000005;HEATER_5_STR
|
||||||
0x60000006;HEATER_6_DRO
|
0x60000006;HEATER_6_DRO
|
||||||
0x60000007;HEATER_7_HPA
|
0x60000007;HEATER_7_SYRLINKS
|
||||||
0x73000001;ACS_BOARD_ASS
|
0x73000001;ACS_BOARD_ASS
|
||||||
0x73000002;SUS_BOARD_ASS
|
0x73000002;SUS_BOARD_ASS
|
||||||
0x73000003;TCS_BOARD_ASS
|
0x73000003;TCS_BOARD_ASS
|
||||||
|
|
@ -9,6 +9,7 @@ from typing import Tuple
|
|||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from eive_tmtc.config.object_ids import ACS_CONTROLLER
|
from eive_tmtc.config.object_ids import ACS_CONTROLLER
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
from eive_tmtc.tmtc.acs.defs import AcsMode, SafeSubmode
|
||||||
from tmtccmd.config.tmtc import (
|
from tmtccmd.config.tmtc import (
|
||||||
tmtc_definitions_provider,
|
tmtc_definitions_provider,
|
||||||
TmtcDefinitionWrapper,
|
TmtcDefinitionWrapper,
|
||||||
@ -56,17 +57,6 @@ class SetId(enum.IntEnum):
|
|||||||
ACTUATOR_CMD_DATA = 9
|
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):
|
class ActionId(enum.IntEnum):
|
||||||
SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL = 0
|
SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL = 0
|
||||||
RESET_MEKF = 1
|
RESET_MEKF = 1
|
||||||
@ -74,13 +64,13 @@ class ActionId(enum.IntEnum):
|
|||||||
|
|
||||||
class OpCodes:
|
class OpCodes:
|
||||||
OFF = ["off"]
|
OFF = ["off"]
|
||||||
SAFE = ["normal_safe"]
|
SAFE = ["safe"]
|
||||||
DTBL = ["normal_detumble"]
|
DTBL = ["safe_detumble"]
|
||||||
IDLE = ["normal_idle"]
|
IDLE = ["ptg_idle"]
|
||||||
NADIR = ["normal_nadir"]
|
NADIR = ["ptg_nadir"]
|
||||||
TARGET = ["normal_target"]
|
TARGET = ["ptg_target"]
|
||||||
GS = ["normal_gs"]
|
GS = ["ptg_target_gs"]
|
||||||
INERTIAL = ["normal_inertial"]
|
INERTIAL = ["ptg_inertial"]
|
||||||
SAFE_PTG = ["confirm_deployment"]
|
SAFE_PTG = ["confirm_deployment"]
|
||||||
RESET_MEKF = ["reset_mekf"]
|
RESET_MEKF = ["reset_mekf"]
|
||||||
SET_PARAMETER_SCALAR = ["set_scalar_param"]
|
SET_PARAMETER_SCALAR = ["set_scalar_param"]
|
||||||
@ -120,9 +110,9 @@ class OpCodes:
|
|||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
OFF = "Switch ACS CTRL off"
|
OFF = "Switch ACS CTRL off"
|
||||||
SAFE = "Switch ACS CTRL normal - safe"
|
SAFE = "Switch ACS CTRL - safe"
|
||||||
DTBL = "Switch ACS CTRL normal - detumble"
|
DTBL = "Switch ACS CTRL - safe with detumble submode"
|
||||||
IDLE = "Switch ACS CTRL normal - idle"
|
IDLE = "Switch ACS CTRL - pointing idle"
|
||||||
NADIR = "Switch ACS CTRL normal - pointing nadir"
|
NADIR = "Switch ACS CTRL normal - pointing nadir"
|
||||||
TARGET = "Switch ACS CTRL normal - pointing target"
|
TARGET = "Switch ACS CTRL normal - pointing target"
|
||||||
GS = "Switch ACS CTRL normal - pointing target groundstation"
|
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))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.OFF, 0))
|
||||||
elif op_code in OpCodes.SAFE:
|
elif op_code in OpCodes.SAFE:
|
||||||
q.add_log_cmd(f"{Info.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:
|
elif op_code in OpCodes.DTBL:
|
||||||
q.add_log_cmd(f"{Info.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:
|
elif op_code in OpCodes.IDLE:
|
||||||
q.add_log_cmd(f"{Info.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:
|
elif op_code in OpCodes.NADIR:
|
||||||
q.add_log_cmd(f"{Info.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:
|
elif op_code in OpCodes.TARGET:
|
||||||
q.add_log_cmd(f"{Info.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:
|
elif op_code in OpCodes.GS:
|
||||||
q.add_log_cmd(f"{Info.GS}")
|
q.add_log_cmd(f"{Info.GS}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET_GS, 0))
|
||||||
pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.PTG_TARGET_GS)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.INERTIAL:
|
elif op_code in OpCodes.INERTIAL:
|
||||||
q.add_log_cmd(f"{Info.INERTIAL}")
|
q.add_log_cmd(f"{Info.INERTIAL}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_INERTIAL, 0))
|
||||||
pack_mode_command(ACS_CONTROLLER, Mode.NORMAL, Submode.PTG_INERTIAL)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.SAFE_PTG:
|
elif op_code in OpCodes.SAFE_PTG:
|
||||||
q.add_log_cmd(f"{Info.SAFE_PTG}")
|
q.add_log_cmd(f"{Info.SAFE_PTG}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
|
16
eive_tmtc/tmtc/acs/defs.py
Normal file
16
eive_tmtc/tmtc/acs/defs.py
Normal 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
|
@ -12,14 +12,13 @@ import struct
|
|||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
from eive_tmtc.utility.input_helper import InputHelper
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
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 import DefaultPusQueueHelper
|
||||||
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from eive_tmtc.utility.input_helper import InputHelper
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -734,13 +733,22 @@ def handle_solution_set(hk_data: bytes, pw: PrintWrapper):
|
|||||||
# Result of LISA: Lost in space algorithm
|
# Result of LISA: Lost in space algorithm
|
||||||
lisa_fmt = "!fffffB"
|
lisa_fmt = "!fffffB"
|
||||||
fmt_len = struct.calcsize(track_fmt)
|
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 QW: {lisa_q_w}")
|
||||||
pw.dlog(f"LISA QX: {lisa_q_x}")
|
pw.dlog(f"LISA QX: {lisa_q_x}")
|
||||||
pw.dlog(f"LISA QY: {lisa_q_y}")
|
pw.dlog(f"LISA QY: {lisa_q_y}")
|
||||||
pw.dlog(f"LISA QZ: {lisa_q_z}")
|
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
|
current_idx += fmt_len
|
||||||
is_trusworthy = hk_data[current_idx]
|
is_trusworthy = hk_data[current_idx]
|
||||||
pw.dlog(f"Trustworthy solution: {is_trusworthy}")
|
pw.dlog(f"Trustworthy solution: {is_trusworthy}")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import enum
|
import enum
|
||||||
from typing import Tuple, Dict
|
from typing import Tuple, Dict
|
||||||
|
|
||||||
|
from eive_tmtc.tmtc.acs.defs import AcsMode, SafeSubmode
|
||||||
from spacepackets.ecss import PusTelecommand
|
from spacepackets.ecss import PusTelecommand
|
||||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||||
from eive_tmtc.config.object_ids import ACS_SUBSYSTEM_ID
|
from eive_tmtc.config.object_ids import ACS_SUBSYSTEM_ID
|
||||||
@ -27,17 +28,6 @@ class OpCode(str, enum.Enum):
|
|||||||
REPORT_ALL_MODES = "all_modes"
|
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):
|
class Info(str, enum.Enum):
|
||||||
OFF = "Off Command"
|
OFF = "Off Command"
|
||||||
SAFE = "Safe Mode Command"
|
SAFE = "Safe Mode Command"
|
||||||
@ -50,15 +40,15 @@ class Info(str, enum.Enum):
|
|||||||
REPORT_ALL_MODES = "Report All Modes Recursively"
|
REPORT_ALL_MODES = "Report All Modes Recursively"
|
||||||
|
|
||||||
|
|
||||||
HANDLER_LIST: Dict[str, Tuple[int, str]] = {
|
HANDLER_LIST: Dict[str, Tuple[int, int, str]] = {
|
||||||
OpCode.OFF: (AcsMode.OFF, Info.OFF),
|
OpCode.OFF: (AcsMode.OFF, 0, Info.OFF),
|
||||||
OpCode.SAFE: (AcsMode.SAFE, Info.SAFE),
|
OpCode.SAFE: (AcsMode.SAFE, SafeSubmode.DEFAULT, Info.SAFE),
|
||||||
OpCode.DETUMBLE: (AcsMode.DETUMBLE, Info.DETUMBLE),
|
OpCode.DETUMBLE: (AcsMode.SAFE, SafeSubmode.DETUMBLE, Info.DETUMBLE),
|
||||||
OpCode.IDLE: (AcsMode.IDLE, Info.IDLE),
|
OpCode.IDLE: (AcsMode.IDLE, 0, Info.IDLE),
|
||||||
OpCode.PTG_TARGET: (AcsMode.PTG_TARGET, Info.PTG_TARGET),
|
OpCode.PTG_TARGET: (AcsMode.PTG_TARGET, 0, Info.PTG_TARGET),
|
||||||
OpCode.PTG_TARGET_GS: (AcsMode.PTG_TARGET_GS, Info.PTG_TARGET_GS),
|
OpCode.PTG_TARGET_GS: (AcsMode.PTG_TARGET_GS, 0, Info.PTG_TARGET_GS),
|
||||||
OpCode.PTG_TARGET_NADIR: (AcsMode.PTG_TARGET_NADIR, Info.PTG_TARGET_NADIR),
|
OpCode.PTG_TARGET_NADIR: (AcsMode.PTG_NADIR, 0, Info.PTG_TARGET_NADIR),
|
||||||
OpCode.PTG_TARGET_INERTIAL: (AcsMode.PTG_TARGET_INERTIAL, Info.PTG_TARGET_INERTIAL),
|
OpCode.PTG_TARGET_INERTIAL: (AcsMode.PTG_INERTIAL, 0, Info.PTG_TARGET_INERTIAL),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -81,9 +71,9 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
|
|||||||
return
|
return
|
||||||
pack_mode_cmd_with_info(
|
pack_mode_cmd_with_info(
|
||||||
object_id=ACS_SUBSYSTEM_ID,
|
object_id=ACS_SUBSYSTEM_ID,
|
||||||
info=f"{info_prefix}: {mode_info_tup[1]}",
|
info=f"{info_prefix}: {mode_info_tup[2]}",
|
||||||
submode=0,
|
|
||||||
mode=mode_info_tup[0],
|
mode=mode_info_tup[0],
|
||||||
|
submode=mode_info_tup[1],
|
||||||
q=q,
|
q=q,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -91,7 +81,7 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
|
|||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
def add_acs_subsystem_cmds(defs: TmtcDefinitionWrapper):
|
def add_acs_subsystem_cmds(defs: TmtcDefinitionWrapper):
|
||||||
oce = OpCodeEntry()
|
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(op_code, info)
|
||||||
oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
|
oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
|
||||||
defs.add_service(CustomServiceList.ACS_SS, "ACS Subsystem", oce)
|
defs.add_service(CustomServiceList.ACS_SS, "ACS Subsystem", oce)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user