Compare commits
4 Commits
add-reset-
...
fused-rot-
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e4c46092b | |||
| 50f504992b | |||
| 2d6e9f826c | |||
|
e23b39e652
|
@@ -10,8 +10,14 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Added support for new fused rotation rate dataset.
|
||||||
|
|
||||||
# [v7.0.0] 2024-05-06
|
# [v7.0.0] 2024-05-06
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
- Reworked PLOC MPSoC commanding to be inline with OBSW update.
|
- Reworked PLOC MPSoC commanding to be inline with OBSW update.
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ TM_DB_PATH = "tm.db"
|
|||||||
|
|
||||||
# TODO: The cleanest way would be to load those from the config file..
|
# TODO: The cleanest way would be to load those from the config file..
|
||||||
PRINT_RAW_HK_B64_STR = False
|
PRINT_RAW_HK_B64_STR = False
|
||||||
|
PRINT_RAW_ACTION_DATA_REPLY_B64_STR = True
|
||||||
PRINT_RAW_EVENTS_B64_STR = False
|
PRINT_RAW_EVENTS_B64_STR = False
|
||||||
|
|
||||||
PUS_APID = 0x65
|
PUS_APID = 0x65
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ from eive_tmtc.tmtc.wdt import create_wdt_node
|
|||||||
|
|
||||||
class EiveHookObject(HookBase):
|
class EiveHookObject(HookBase):
|
||||||
def __init__(self, json_cfg_path: str):
|
def __init__(self, json_cfg_path: str):
|
||||||
super().__init__(json_cfg_path=json_cfg_path)
|
super().__init__(json_cfg_path)
|
||||||
|
|
||||||
def get_command_definitions(self) -> CmdTreeNode:
|
def get_command_definitions(self) -> CmdTreeNode:
|
||||||
root_node = CmdTreeNode.root_node()
|
root_node = CmdTreeNode.root_node()
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
import base64
|
||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from spacepackets.ecss import PusTm
|
from spacepackets.ecss import PusTm
|
||||||
from tmtccmd.pus.s8_fsfw_action_defs import CustomSubservice
|
from tmtccmd.pus.s8_fsfw_action_defs import CustomSubservice
|
||||||
|
from eive_tmtc.config.definitions import PRINT_RAW_ACTION_DATA_REPLY_B64_STR
|
||||||
from eive_tmtc.config.object_ids import (
|
from eive_tmtc.config.object_ids import (
|
||||||
ACU_HANDLER_ID,
|
ACU_HANDLER_ID,
|
||||||
PDU_1_HANDLER_ID,
|
PDU_1_HANDLER_ID,
|
||||||
@@ -51,6 +53,8 @@ def handle_action_service_tm(
|
|||||||
if object_id is None:
|
if object_id is None:
|
||||||
object_id = ObjectIdU32(object_id_raw, "Unknown ID")
|
object_id = ObjectIdU32(object_id_raw, "Unknown ID")
|
||||||
if tm_packet.subservice == CustomSubservice.TM_DATA_REPLY:
|
if tm_packet.subservice == CustomSubservice.TM_DATA_REPLY:
|
||||||
|
if PRINT_RAW_ACTION_DATA_REPLY_B64_STR:
|
||||||
|
print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
|
||||||
if object_id.as_bytes == IMTQ_HANDLER_ID:
|
if object_id.as_bytes == IMTQ_HANDLER_ID:
|
||||||
return handle_imtq_replies(action_id, pw, custom_data)
|
return handle_imtq_replies(action_id, pw, custom_data)
|
||||||
elif object_id.as_bytes == PLOC_MPSOC_ID:
|
elif object_id.as_bytes == PLOC_MPSOC_ID:
|
||||||
|
|||||||
@@ -988,27 +988,43 @@ def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
||||||
fmt_source = "!B"
|
fmt_source = "!B"
|
||||||
inc_len_source = struct.calcsize(fmt_source)
|
inc_len_source = struct.calcsize(fmt_source)
|
||||||
old_size = 3 * inc_len_vec3_double + 1
|
v0_size = 3 * inc_len_vec3_double + 1
|
||||||
new_size = 3 * inc_len_vec3_double + inc_len_source + 1
|
v1_size = 3 * inc_len_vec3_double + inc_len_source + 1
|
||||||
|
v2_size = 2 * inc_len_vec3_double + inc_len_source + 1
|
||||||
size = len(hk_data)
|
size = len(hk_data)
|
||||||
if size not in [old_size, new_size]:
|
if size not in [v0_size, v1_size, v2_size]:
|
||||||
pw.dlog(f"Received Fused Rot Rate HK set of unexpected size: {len(hk_data)}")
|
pw.dlog(f"Received Fused Rot Rate HK set of unexpected size: {len(hk_data)}")
|
||||||
return
|
return
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
|
if size in [v0_size, v1_size]:
|
||||||
rot_rate_orthogonal = [
|
rot_rate_orthogonal = [
|
||||||
f"{val*180/math.pi:8.3f}"
|
f"{val*180/math.pi:8.3f}"
|
||||||
for val in struct.unpack(
|
for val in struct.unpack(
|
||||||
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
fmt_vec3_double,
|
||||||
|
hk_data[current_idx : current_idx + inc_len_vec3_double],
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
current_idx += inc_len_vec3_double
|
current_idx += inc_len_vec3_double
|
||||||
|
pw.dlog(f"Fused Rotational Rate Orthogonal: {rot_rate_orthogonal} [deg/s]")
|
||||||
rot_rate_parallel = [
|
rot_rate_parallel = [
|
||||||
f"{val*180/math.pi:8.3f}"
|
f"{val*180/math.pi:8.3f}"
|
||||||
for val in struct.unpack(
|
for val in struct.unpack(
|
||||||
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
fmt_vec3_double,
|
||||||
|
hk_data[current_idx : current_idx + inc_len_vec3_double],
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
current_idx += inc_len_vec3_double
|
current_idx += inc_len_vec3_double
|
||||||
|
pw.dlog(f"Fused Rotational Rate Parallel: {rot_rate_parallel} [deg/s]")
|
||||||
|
else:
|
||||||
|
rot_rate_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
|
||||||
|
pw.dlog(f"Fused Rotational Rate SUSMGM: {rot_rate_susmgm} [deg/s]")
|
||||||
rot_rate_total = [
|
rot_rate_total = [
|
||||||
f"{val*180/math.pi:8.3f}"
|
f"{val*180/math.pi:8.3f}"
|
||||||
for val in struct.unpack(
|
for val in struct.unpack(
|
||||||
@@ -1016,10 +1032,8 @@ def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
current_idx += inc_len_vec3_double
|
current_idx += inc_len_vec3_double
|
||||||
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]")
|
pw.dlog(f"Fused Rotational Rate Total: {rot_rate_total} [deg/s]")
|
||||||
if size == new_size:
|
if size in [v1_size, v2_size]:
|
||||||
rot_rate_source = struct.unpack(
|
rot_rate_source = struct.unpack(
|
||||||
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
||||||
)[0]
|
)[0]
|
||||||
@@ -1030,9 +1044,10 @@ def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
pw.dlog(f"Ctrl Strategy (key unknown): {rot_rate_source}")
|
pw.dlog(f"Ctrl Strategy (key unknown): {rot_rate_source}")
|
||||||
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=4))
|
if size in [v0_size, v2_size]:
|
||||||
return
|
|
||||||
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
|
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
|
||||||
|
else:
|
||||||
|
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=4))
|
||||||
|
|
||||||
|
|
||||||
def handle_fused_rot_rate_source_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_fused_rot_rate_source_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
|
|||||||
from tmtccmd.pus.s11_tc_sched import (
|
from tmtccmd.pus.s11_tc_sched import (
|
||||||
create_enable_tc_sched_cmd,
|
create_enable_tc_sched_cmd,
|
||||||
create_disable_tc_sched_cmd,
|
create_disable_tc_sched_cmd,
|
||||||
create_reset_tc_sched_cmd,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
||||||
@@ -71,7 +70,6 @@ class ActionId(enum.IntEnum):
|
|||||||
MKDIR_HELPER = 55
|
MKDIR_HELPER = 55
|
||||||
ENABLE_SCHEDULER = 56
|
ENABLE_SCHEDULER = 56
|
||||||
UPDATE_LEAP_SECONRS = 60
|
UPDATE_LEAP_SECONRS = 60
|
||||||
RESET_SCHEDULER = 61
|
|
||||||
|
|
||||||
|
|
||||||
class ParamId(enum.IntEnum):
|
class ParamId(enum.IntEnum):
|
||||||
@@ -124,7 +122,6 @@ class OpCode:
|
|||||||
ENABLE_SCHEDULER = "enable_scheduler"
|
ENABLE_SCHEDULER = "enable_scheduler"
|
||||||
DISABLE_SCHEDULER = "disable_scheduler"
|
DISABLE_SCHEDULER = "disable_scheduler"
|
||||||
UPDATE_LEAP_SECONDS = "leap_seconds_update"
|
UPDATE_LEAP_SECONDS = "leap_seconds_update"
|
||||||
RESET_SCHEDULER = "reset_scheduler"
|
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@@ -169,7 +166,6 @@ class Info:
|
|||||||
ENABLE_SCHEDULER = "Enable scheduler"
|
ENABLE_SCHEDULER = "Enable scheduler"
|
||||||
DISABLE_SCHEDULER = "Disable scheduler"
|
DISABLE_SCHEDULER = "Disable scheduler"
|
||||||
UPDATE_LEAP_SECONDS = "Updates the Leap Seconds"
|
UPDATE_LEAP_SECONDS = "Updates the Leap Seconds"
|
||||||
RESET_SCHEDULER = "Reset scheduler"
|
|
||||||
|
|
||||||
|
|
||||||
class Chip(enum.IntEnum):
|
class Chip(enum.IntEnum):
|
||||||
@@ -479,9 +475,6 @@ def pack_core_commands( # noqa C901
|
|||||||
elif cmd_str == OpCode.DISABLE_SCHEDULER:
|
elif cmd_str == OpCode.DISABLE_SCHEDULER:
|
||||||
q.add_log_cmd(Info.DISABLE_SCHEDULER)
|
q.add_log_cmd(Info.DISABLE_SCHEDULER)
|
||||||
q.add_pus_tc(create_disable_tc_sched_cmd())
|
q.add_pus_tc(create_disable_tc_sched_cmd())
|
||||||
elif cmd_str == OpCode.RESET_SCHEDULER:
|
|
||||||
q.add_log_cmd(Info.RESET_SCHEDULER)
|
|
||||||
q.add_pus_tc(create_reset_tc_sched_cmd())
|
|
||||||
elif cmd_str == OpCode.UPDATE_LEAP_SECONDS:
|
elif cmd_str == OpCode.UPDATE_LEAP_SECONDS:
|
||||||
q.add_log_cmd(Info.UPDATE_LEAP_SECONDS)
|
q.add_log_cmd(Info.UPDATE_LEAP_SECONDS)
|
||||||
leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes(
|
leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes(
|
||||||
|
|||||||
Reference in New Issue
Block a user