From 5b25f910aecb34aece9c0edecd9301ed75fcd821 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 May 2022 11:53:34 +0200 Subject: [PATCH] RW update --- pus_tc/devs/reaction_wheels.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pus_tc/devs/reaction_wheels.py b/pus_tc/devs/reaction_wheels.py index 9a03e71..970f964 100644 --- a/pus_tc/devs/reaction_wheels.py +++ b/pus_tc/devs/reaction_wheels.py @@ -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