From 9777556b679e91aa30a5bbfebac3cb44bc98a5a8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Mar 2024 07:28:05 +1100 Subject: [PATCH] SIYI: auto thermal capture and set time --- MAVProxy/modules/mavproxy_SIYI/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MAVProxy/modules/mavproxy_SIYI/__init__.py b/MAVProxy/modules/mavproxy_SIYI/__init__.py index 204ffe47a0..68f5b3a820 100644 --- a/MAVProxy/modules/mavproxy_SIYI/__init__.py +++ b/MAVProxy/modules/mavproxy_SIYI/__init__.py @@ -1386,6 +1386,18 @@ def end_tracking(self): def mavlink_packet(self, m): '''process a mavlink message''' mtype = m.get_type() + + armed = self.master.motors_armed() + if armed and not self.last_armed: + print("Setting SIYI time") + self.cmd_settime() + print("Enabling thermal capture") + self.siyi_settings.therm_cap_rate = 1.0 + if not armed and self.last_armed: + print("Disabling thermal capture") + self.siyi_settings.therm_cap_rate = 0.0 + self.last_armed = armed + if mtype == 'GPS_RAW_INT': # ?!? why off by 18 hours gwk, gms = mp_util.get_gps_time(time.time()+18*3600)