Merge branch 'main' into prep-v6.1.0
This commit is contained in:
commit
7f10e5c777
@ -13,6 +13,8 @@ list yields a list of all related PRs for each release.
|
|||||||
## Added
|
## Added
|
||||||
|
|
||||||
- Added commands to unlock and use STR secondary firmware slot.
|
- Added commands to unlock and use STR secondary firmware slot.
|
||||||
|
- STR BlobStats TM handling
|
||||||
|
- New ACS CTRL commands.
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ FORWARD_SENSOR_TEMPS = False
|
|||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class HkFilter:
|
class HkFilter:
|
||||||
object_ids: List[ObjectIdU32]
|
object_ids: List[bytes]
|
||||||
set_ids: List[int]
|
set_ids: List[int]
|
||||||
|
|
||||||
|
|
||||||
@ -72,8 +72,7 @@ def handle_hk_packet(
|
|||||||
named_obj_id = tm_packet.object_id
|
named_obj_id = tm_packet.object_id
|
||||||
if tm_packet.subservice == 25 or tm_packet.subservice == 26:
|
if tm_packet.subservice == 25 or tm_packet.subservice == 26:
|
||||||
hk_data = tm_packet.tm_data[8:]
|
hk_data = tm_packet.tm_data[8:]
|
||||||
|
if named_obj_id.as_bytes in hk_filter.object_ids:
|
||||||
if named_obj_id in hk_filter.object_ids:
|
|
||||||
# print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
|
# print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
|
||||||
handle_regular_hk_print(
|
handle_regular_hk_print(
|
||||||
printer=printer,
|
printer=printer,
|
||||||
|
@ -72,6 +72,7 @@ class ActionId(enum.IntEnum):
|
|||||||
RESTORE_MEKF_NONFINITE_RECOVERY = 2
|
RESTORE_MEKF_NONFINITE_RECOVERY = 2
|
||||||
UPDATE_TLE = 3
|
UPDATE_TLE = 3
|
||||||
READ_TLE = 4
|
READ_TLE = 4
|
||||||
|
UPDATE_MEKF_STANDARD_DEVIATIONS = 5
|
||||||
|
|
||||||
|
|
||||||
CTRL_STRAT_DICT = {
|
CTRL_STRAT_DICT = {
|
||||||
@ -126,6 +127,7 @@ class OpCodes:
|
|||||||
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
|
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
|
||||||
UPDATE_TLE = "update_tle"
|
UPDATE_TLE = "update_tle"
|
||||||
READ_TLE = "read_tle"
|
READ_TLE = "read_tle"
|
||||||
|
UPDATE_MEKF_STANDARD_DEVIATIONS = "update_mekf_standard_deviations"
|
||||||
SET_PARAMETER_SCALAR = "set_scalar_param"
|
SET_PARAMETER_SCALAR = "set_scalar_param"
|
||||||
SET_PARAMETER_VECTOR = "set_vector_param"
|
SET_PARAMETER_VECTOR = "set_vector_param"
|
||||||
SET_PARAMETER_MATRIX = "set_matrix_param"
|
SET_PARAMETER_MATRIX = "set_matrix_param"
|
||||||
@ -148,6 +150,10 @@ class Info:
|
|||||||
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"
|
READ_TLE = "Read the currently stored TLE"
|
||||||
|
UPDATE_MEKF_STANDARD_DEVIATIONS = (
|
||||||
|
"Update the Standard Deviations within the MEKF to the current ACS Parameter "
|
||||||
|
"Values"
|
||||||
|
)
|
||||||
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"
|
||||||
@ -183,36 +189,6 @@ def create_acs_ctrl_node() -> CmdTreeNode:
|
|||||||
return acs_ctrl
|
return acs_ctrl
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
|
||||||
def acs_cmd_defs(defs: TmtcDefinitionWrapper):
|
|
||||||
oce = OpCodeEntry()
|
|
||||||
oce.add(keys=OpCodes.OFF, info=Info.OFF)
|
|
||||||
oce.add(keys=OpCodes.SAFE, info=Info.SAFE)
|
|
||||||
oce.add(keys=OpCodes.DTBL, info=Info.DTBL)
|
|
||||||
oce.add(keys=OpCodes.IDLE, info=Info.IDLE)
|
|
||||||
oce.add(keys=OpCodes.NADIR, info=Info.NADIR)
|
|
||||||
oce.add(keys=OpCodes.TARGET, info=Info.TARGET)
|
|
||||||
oce.add(keys=OpCodes.GS, info=Info.GS)
|
|
||||||
oce.add(keys=OpCodes.INERTIAL, info=Info.INERTIAL)
|
|
||||||
oce.add(keys=OpCodes.SAFE_PTG, info=Info.SAFE_PTG)
|
|
||||||
oce.add(keys=OpCodes.RESET_MEKF, info=Info.RESET_MEKF)
|
|
||||||
oce.add(
|
|
||||||
keys=OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY,
|
|
||||||
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.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
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
|
def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
|
||||||
if cmd_str in OpCodes.OFF:
|
if cmd_str in OpCodes.OFF:
|
||||||
q.add_log_cmd(f"{Info.OFF}")
|
q.add_log_cmd(f"{Info.OFF}")
|
||||||
@ -273,18 +249,14 @@ def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
|
|||||||
print("The line does not have the required length of 69 characters")
|
print("The line does not have the required length of 69 characters")
|
||||||
tle = line1.encode() + line2.encode()
|
tle = line1.encode() + line2.encode()
|
||||||
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_TLE, tle))
|
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_TLE, tle))
|
||||||
elif cmd_str in OpCodes.SET_PARAMETER_SCALAR:
|
|
||||||
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
|
||||||
set_acs_ctrl_param_scalar(q)
|
|
||||||
elif cmd_str in OpCodes.SET_PARAMETER_VECTOR:
|
|
||||||
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
|
|
||||||
set_acs_ctrl_param_vector(q)
|
|
||||||
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 == OpCodes.READ_TLE:
|
elif cmd_str == OpCodes.READ_TLE:
|
||||||
q.add_log_cmd(f"{Info.READ_TLE}")
|
q.add_log_cmd(f"{Info.READ_TLE}")
|
||||||
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
|
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
|
||||||
|
elif cmd_str == OpCodes.UPDATE_MEKF_STANDARD_DEVIATIONS:
|
||||||
|
q.add_log_cmd(f"{Info.UPDATE_MEKF_STANDARD_DEVIATIONS}")
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_MEKF_STANDARD_DEVIATIONS)
|
||||||
|
)
|
||||||
elif cmd_str == OpCodes.SET_PARAMETER_SCALAR:
|
elif cmd_str == OpCodes.SET_PARAMETER_SCALAR:
|
||||||
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
||||||
set_acs_ctrl_param_scalar(q)
|
set_acs_ctrl_param_scalar(q)
|
||||||
|
@ -9,6 +9,7 @@ import datetime
|
|||||||
import enum
|
import enum
|
||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
from typing import List, Tuple
|
||||||
|
|
||||||
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 eive_tmtc.utility.input_helper import InputHelper
|
||||||
@ -183,6 +184,7 @@ class SetId(enum.IntEnum):
|
|||||||
BLOBS = 92
|
BLOBS = 92
|
||||||
CENTROID = 93
|
CENTROID = 93
|
||||||
CENTROIDS = 94
|
CENTROIDS = 94
|
||||||
|
BLOB_STATS = 102
|
||||||
|
|
||||||
|
|
||||||
class DataSetRequest(enum.IntEnum):
|
class DataSetRequest(enum.IntEnum):
|
||||||
@ -876,6 +878,8 @@ def handle_str_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
|||||||
handle_centroids_set(hk_data, pw)
|
handle_centroids_set(hk_data, pw)
|
||||||
elif set_id == SetId.CONTRAST:
|
elif set_id == SetId.CONTRAST:
|
||||||
handle_contrast_set(hk_data, pw)
|
handle_contrast_set(hk_data, pw)
|
||||||
|
elif set_id == SetId.BLOB_STATS:
|
||||||
|
handle_blob_stats_set(hk_data, pw)
|
||||||
else:
|
else:
|
||||||
_LOGGER.warning(f"HK parsing for Star Tracker set ID {set_id} unimplemented")
|
_LOGGER.warning(f"HK parsing for Star Tracker set ID {set_id} unimplemented")
|
||||||
|
|
||||||
@ -1178,6 +1182,35 @@ def handle_contrast_set(hk_data: bytes, pw: PrintWrapper):
|
|||||||
handle_histo_or_contrast_set("Contrast", hk_data, pw)
|
handle_histo_or_contrast_set("Contrast", hk_data, pw)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_blob_stats_set(hk_data: bytes, pw: PrintWrapper):
|
||||||
|
pw.dlog("Received Blob Stats Set")
|
||||||
|
if len(hk_data) < 65:
|
||||||
|
raise ValueError(
|
||||||
|
f"Matched BlobStats set with length {len(hk_data)} too short. Expected 65 bytes."
|
||||||
|
)
|
||||||
|
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||||
|
|
||||||
|
def fill_list(current_idx: int) -> Tuple[List[int], int]:
|
||||||
|
list_to_fill = []
|
||||||
|
for _ in range(16):
|
||||||
|
list_to_fill.append(hk_data[current_idx])
|
||||||
|
current_idx += 1
|
||||||
|
return list_to_fill, current_idx
|
||||||
|
|
||||||
|
noise_list, current_idx = fill_list(current_idx)
|
||||||
|
threshold_list, current_idx = fill_list(current_idx)
|
||||||
|
lvalid_list, current_idx = fill_list(current_idx)
|
||||||
|
oflow_list, current_idx = fill_list(current_idx)
|
||||||
|
pw.dlog("Index | Noise | Threshold | LValid | Oflow")
|
||||||
|
for i in range(16):
|
||||||
|
pw.dlog(
|
||||||
|
"{:<3} {:<3} {:<3} {:<3} {:<3}".format(
|
||||||
|
i, noise_list[i], threshold_list[i], lvalid_list[i], oflow_list[i]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
|
||||||
|
|
||||||
|
|
||||||
def handle_star_tracker_action_replies(
|
def handle_star_tracker_action_replies(
|
||||||
action_id: int, pw: PrintWrapper, custom_data: bytes
|
action_id: int, pw: PrintWrapper, custom_data: bytes
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user