Merge branch 'kranz/master' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into kranz/master

This commit is contained in:
Markus Kranz 2022-05-25 12:07:12 +02:00
commit b0ab9cd79a

View File

@ -136,8 +136,7 @@ def pack_single_rw_test_into(
speed = int(input("Specify speed [0.1 RPM]: "))
ramp_time = int(input("Specify ramp time [ms]: "))
tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.SPEED}"))
command = pack_set_speed_command(object_id, speed, ramp_time)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
command = pack_set_speed_command(object_id, speed, ramp_time, 40)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in OpCodesDevs.ON:
@ -197,19 +196,20 @@ def pack_rw_ass_cmds(tc_queue: TcQueueT, object_id: bytes, op_code: str):
def pack_set_speed_command(
object_id: bytes, speed: int, ramp_time: int
object_id: bytes, speed: int, ramp_time: int, ssc: int
) -> PusTelecommand:
"""With this function a command is packed to set the speed of a reaction wheel
:param object_id: The object id of the reaction wheel handler.
:param speed: Valid speeds are [-65000, -1000] and [1000, 65000]. Values are
specified in 0.1 * RPM
:param ramp_time: The time after which the reaction wheel will reached the commanded speed.
:param ramp_time: The time after which the reaction wheel will reach the commanded speed.
Valid times are 10 - 10000 ms
:param ssc: Source sequence count
"""
command_id = RwCommandIds.SET_SPEED
command = bytearray()
command += object_id + command_id
command = command + struct.pack("!i", speed)
command = command + ramp_time.to_bytes(length=2, byteorder="big")
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
command = PusTelecommand(service=8, subservice=128, ssc=ssc, app_data=command)
return command