From 03a5b8739434376d88c81ce7bff55ac06ba635fd Mon Sep 17 00:00:00 2001
From: "Robin.Mueller" <robin.mueller.m@gmail.com>
Date: Thu, 10 Sep 2020 21:22:16 +0200
Subject: [PATCH] added gyro

---
 tm/obsw_tm_service_3.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tm/obsw_tm_service_3.py b/tm/obsw_tm_service_3.py
index 158d477..3acfad2 100644
--- a/tm/obsw_tm_service_3.py
+++ b/tm/obsw_tm_service_3.py
@@ -138,7 +138,17 @@ class Service3TM(PusTelemetry):
         self.validity_buffer = self._tm_data[13:]
 
     def handle_gyro_hk_data(self):
-        pass
+        self.numberOfParameters = 3
+        if len(self._tm_data) < 21:
+            LOGGER.error("Format of thermal sensor HK data might be invalid!")
+            return
+        
+        self.hkHeader = ["AngVel X", "Ang Vel Y", "AngVel Z"]
+        angular_velocity_x = struct.unpack('!f', self._tm_data[8:12])[0]
+        angular_velocity_y = struct.unpack('!f', self._tm_data[12:16])[0]
+        angular_velocity_z = struct.unpack('!f', self._tm_data[16:20])[0]
+        self.hkContent = [angular_velocity_x, angular_velocity_y, angular_velocity_z]
+        self.validity_buffer = self._tm_data[20:]
 
 
 Service3TM: Type[PusTelemetry]
-- 
GitLab