Pass acc data in mG in SCALED_IMU to comply with mavlink standard

https://mavlink.io/en/messages/common.html#SCALED_IMU
pyflix@0.13
This commit is contained in:
Oleg Kalachev
2026-04-24 07:42:39 +03:00
parent 350a82bfed
commit d6a79d6c66
3 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -186,7 +186,8 @@ class Flix:
self._trigger('motors', self.motors)
if isinstance(msg, mavlink.MAVLink_scaled_imu_message):
self.acc = self._mavlink_to_flu([msg.xacc / 1000, msg.yacc / 1000, msg.zacc / 1000])
ONE_G = 9.80665
self.acc = self._mavlink_to_flu([msg.xacc * ONE_G / 1000, msg.yacc * ONE_G / 1000, msg.zacc * ONE_G / 1000])
self.gyro = self._mavlink_to_flu([msg.xgyro / 1000, msg.ygyro / 1000, msg.zgyro / 1000])
self._trigger('acc', self.acc)
self._trigger('gyro', self.gyro)